Fix testGetHvDefaults testcase
authorThomas Thrainer <thomasth@google.com>
Thu, 20 Jun 2013 11:16:59 +0000 (13:16 +0200)
committerThomas Thrainer <thomasth@google.com>
Thu, 20 Jun 2013 11:52:26 +0000 (13:52 +0200)
The introduction of the migration_mode parameter to the fake hypervisor
broke the testGetHvDefaults. This patch fixes this by taking the default
parameters of the fake hypervisor into account.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

test/py/ganeti.objects_unittest.py

index e111e33..5ba7901 100755 (executable)
@@ -97,19 +97,19 @@ class TestClusterObject(unittest.TestCase):
                                           os_name="lenny-image"),
                          cl.os_hvp["lenny-image"][constants.HT_XEN_PVM])
 
-
   def testFillHvFullMerge(self):
     inst_hvparams = {
       "blah": "blubb",
       }
 
-    fake_dict = {
+    fake_dict = constants.HVC_DEFAULTS[constants.HT_FAKE].copy()
+    fake_dict.update({
       "foo": "baz",
       "bar": "foo",
       "foobar": "foobar",
       "blah": "blubb",
       "blubb": "blah",
-      }
+      })
     fake_inst = objects.Instance(name="foobar",
                                  os="lenny-image",
                                  hypervisor=constants.HT_FAKE,