Commit 861610e9 authored by Guido Trotter's avatar Guido Trotter
Browse files

unittests: use max/min memory


Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 63c55458
......@@ -562,7 +562,7 @@ class TestInstanceQuery(unittest.TestCase):
return query.Query(query.INSTANCE_FIELDS, selected)
def testSimple(self):
q = self._Create(["name", "be/memory", "ip"])
q = self._Create(["name", "be/maxmem", "ip"])
self.assertEqual(q.RequestedData(), set([query.IQ_CONFIG]))
cluster = objects.Cluster(cluster_name="testcluster",
......@@ -582,7 +582,7 @@ class TestInstanceQuery(unittest.TestCase):
objects.Instance(name="inst2", hvparams={}, nics=[], osparams={},
os="foomoo",
beparams={
constants.BE_MEMORY: 512,
constants.BE_MAXMEM: 512,
}),
objects.Instance(name="inst3", hvparams={}, beparams={}, osparams={},
os="dos", nics=[objects.NIC(ip="192.0.2.99", nicparams={})]),
......@@ -659,7 +659,8 @@ class TestInstanceQuery(unittest.TestCase):
disk_template=constants.DT_DISKLESS,
disks=[],
beparams={
constants.BE_MEMORY: 512,
constants.BE_MAXMEM: 512,
constants.BE_MINMEM: 256,
},
osparams={}),
objects.Instance(name="inst3", hvparams={}, beparams={},
......@@ -712,7 +713,8 @@ class TestInstanceQuery(unittest.TestCase):
disk_template=constants.DT_DISKLESS,
disks=[],
beparams={
constants.BE_MEMORY: 512,
constants.BE_MAXMEM: 512,
constants.BE_MINMEM: 512,
},
osparams={}),
objects.Instance(name="inst6", hvparams={}, nics=[],
......@@ -724,7 +726,8 @@ class TestInstanceQuery(unittest.TestCase):
disk_template=constants.DT_DISKLESS,
disks=[],
beparams={
constants.BE_MEMORY: 768,
constants.BE_MAXMEM: 768,
constants.BE_MINMEM: 256,
},
osparams={
"clean_install": "no",
......@@ -833,8 +836,8 @@ class TestInstanceQuery(unittest.TestCase):
(_, status) = row[fieldidx["status"]]
tested_status.add(status)
for (field, livefield) in [("oper_ram", "memory"),
("oper_vcpus", "vcpus")]:
#FIXME(dynmem): check oper_ram vs min/max mem
for (field, livefield) in [("oper_vcpus", "vcpus")]:
if inst.primary_node in bad_nodes:
exp = (constants.RS_NODATA, None)
elif inst.name in live_data:
......
......@@ -818,9 +818,11 @@ class TestInstanceCreation(testutils.GanetiTestCase):
None,
{},
{ constants.BE_VCPUS: 2, },
{ constants.BE_MEMORY: 123, },
{ constants.BE_MAXMEM: 200, },
{ constants.BE_MEMORY: 256, },
{ constants.BE_VCPUS: 2,
constants.BE_MEMORY: 1024,
constants.BE_MAXMEM: 1024,
constants.BE_MINMEM: 1024,
constants.BE_AUTO_BALANCE: True, }
]
......@@ -1248,7 +1250,7 @@ class TestParseModifyInstanceRequest(unittest.TestCase):
for osparams in [{}, { "some": "value", "other": "Hello World", }]:
for hvparams in [{}, { constants.HV_KERNEL_PATH: "/some/kernel", }]:
for beparams in [{}, { constants.BE_MEMORY: 128, }]:
for beparams in [{}, { constants.BE_MAXMEM: 128, }]:
for force in [False, True]:
for nics in [[], [(0, { constants.INIC_IP: "192.0.2.1", })]]:
for disks in test_disks:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment