projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix redistribution of files w.r.t. offline nodes
[ganeti-local]
/
test
/
ganeti.cmdlib_unittest.py
diff --git
a/test/ganeti.cmdlib_unittest.py
b/test/ganeti.cmdlib_unittest.py
index
b2aa6c7
..
485161f
100755
(executable)
--- a/
test/ganeti.cmdlib_unittest.py
+++ b/
test/ganeti.cmdlib_unittest.py
@@
-1,7
+1,7
@@
#!/usr/bin/python
#
#!/usr/bin/python
#
-# Copyright (C) 2008, 2011 Google Inc.
+# Copyright (C) 2008, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-586,24
+586,24
@@
class TestComputeMinMaxSpec(unittest.TestCase):
}
def testNoneValue(self):
}
def testNoneValue(self):
- self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_MEM_SIZE,
+ self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_MEM_SIZE, None,
self.ipolicy, None) is None)
def testAutoValue(self):
self.ipolicy, None) is None)
def testAutoValue(self):
- self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_MEM_SIZE,
+ self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_MEM_SIZE, None,
self.ipolicy,
constants.VALUE_AUTO) is None)
def testNotDefined(self):
self.ipolicy,
constants.VALUE_AUTO) is None)
def testNotDefined(self):
- self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_NIC_COUNT,
+ self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_NIC_COUNT, None,
self.ipolicy, 3) is None)
def testNoMinDefined(self):
self.ipolicy, 3) is None)
def testNoMinDefined(self):
- self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_DISK_SIZE,
+ self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_DISK_SIZE, None,
self.ipolicy, 128) is None)
def testNoMaxDefined(self):
self.ipolicy, 128) is None)
def testNoMaxDefined(self):
- self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_DISK_COUNT,
+ self.assertTrue(cmdlib._ComputeMinMaxSpec(constants.ISPEC_DISK_COUNT, None,
self.ipolicy, 16) is None)
def testOutOfRange(self):
self.ipolicy, 16) is None)
def testOutOfRange(self):
@@
-613,9
+613,14
@@
class TestComputeMinMaxSpec(unittest.TestCase):
(constants.ISPEC_DISK_COUNT, 0)):
min_v = self.ipolicy[constants.ISPECS_MIN].get(name, val)
max_v = self.ipolicy[constants.ISPECS_MAX].get(name, val)
(constants.ISPEC_DISK_COUNT, 0)):
min_v = self.ipolicy[constants.ISPECS_MIN].get(name, val)
max_v = self.ipolicy[constants.ISPECS_MAX].get(name, val)
- self.assertEqual(cmdlib._ComputeMinMaxSpec(name, self.ipolicy, val),
+ self.assertEqual(cmdlib._ComputeMinMaxSpec(name, None,
+ self.ipolicy, val),
"%s value %s is not in range [%s, %s]" %
(name, val,min_v, max_v))
"%s value %s is not in range [%s, %s]" %
(name, val,min_v, max_v))
+ self.assertEqual(cmdlib._ComputeMinMaxSpec(name, "1",
+ self.ipolicy, val),
+ "%s/1 value %s is not in range [%s, %s]" %
+ (name, val,min_v, max_v))
def test(self):
for (name, val) in ((constants.ISPEC_MEM_SIZE, 256),
def test(self):
for (name, val) in ((constants.ISPEC_MEM_SIZE, 256),
@@
-625,7
+630,7
@@
class TestComputeMinMaxSpec(unittest.TestCase):
(constants.ISPEC_DISK_SIZE, 0),
(constants.ISPEC_DISK_COUNT, 1),
(constants.ISPEC_DISK_COUNT, 5)):
(constants.ISPEC_DISK_SIZE, 0),
(constants.ISPEC_DISK_COUNT, 1),
(constants.ISPEC_DISK_COUNT, 5)):
- self.assertTrue(cmdlib._ComputeMinMaxSpec(name, self.ipolicy, val)
+ self.assertTrue(cmdlib._ComputeMinMaxSpec(name, None, self.ipolicy, val)
is None)
is None)