Merge branch 'stable-2.15' into stable-2.16
[ganeti-github.git] / test / py / ganeti.client.gnt_cluster_unittest.py
index be28eb2..38bda23 100755 (executable)
@@ -293,21 +293,24 @@ class InitDrbdHelper(DrbdHelperTestCase):
     opts = mock.Mock()
     opts.drbd_helper = None
     self.disableDrbd()
-    helper = gnt_cluster._InitDrbdHelper(opts, self.enabled_disk_templates)
+    helper = gnt_cluster._InitDrbdHelper(opts, self.enabled_disk_templates,
+                                         feedback_fn=mock.Mock())
     self.assertEquals(None, helper)
 
   def testNoDrbdHelper(self):
     opts = mock.Mock()
     self.disableDrbd()
     opts.drbd_helper = "/bin/true"
-    helper = gnt_cluster._InitDrbdHelper(opts, self.enabled_disk_templates)
+    helper = gnt_cluster._InitDrbdHelper(opts, self.enabled_disk_templates,
+                                         feedback_fn=mock.Mock())
     self.assertEquals(opts.drbd_helper, helper)
 
   def testDrbdHelperNone(self):
     opts = mock.Mock()
     self.enableDrbd()
     opts.drbd_helper = None
-    helper = gnt_cluster._InitDrbdHelper(opts, self.enabled_disk_templates)
+    helper = gnt_cluster._InitDrbdHelper(opts, self.enabled_disk_templates,
+                                         feedback_fn=mock.Mock())
     self.assertEquals(constants.DEFAULT_DRBD_HELPER, helper)
 
   def testDrbdHelperEmpty(self):
@@ -315,13 +318,14 @@ class InitDrbdHelper(DrbdHelperTestCase):
     self.enableDrbd()
     opts.drbd_helper = ''
     self.assertRaises(errors.OpPrereqError, gnt_cluster._InitDrbdHelper, opts,
-        self.enabled_disk_templates)
+        self.enabled_disk_templates, feedback_fn=mock.Mock())
 
   def testDrbdHelper(self):
     opts = mock.Mock()
     self.enableDrbd()
     opts.drbd_helper = "/bin/true"
-    helper = gnt_cluster._InitDrbdHelper(opts, self.enabled_disk_templates)
+    helper = gnt_cluster._InitDrbdHelper(opts, self.enabled_disk_templates,
+                                         feedback_fn=mock.Mock())
     self.assertEquals(opts.drbd_helper, helper)
 
 
@@ -380,7 +384,9 @@ class TestBuildGanetiPubKeys(testutils.GanetiTestCase):
   _CLUSTER_NAME = "cluster_name"
   _PRIV_KEY = "master_private_key"
   _PUB_KEY = "master_public_key"
+  _MODIFY_SSH_SETUP = True
   _AUTH_KEYS = "a\nb\nc"
+  _SSH_KEY_TYPE = "dsa"
 
   def _setUpFakeKeys(self):
     os.makedirs(os.path.join(self.tmpdir, ".ssh"))
@@ -411,7 +417,8 @@ class TestBuildGanetiPubKeys(testutils.GanetiTestCase):
     self.mock_cl = mock.Mock()
     self.mock_cl.QueryConfigValues = mock.Mock()
     self.mock_cl.QueryConfigValues.return_value = \
-      (self._CLUSTER_NAME, self._MASTER_NODE_NAME)
+      (self._CLUSTER_NAME, self._MASTER_NODE_NAME, self._MODIFY_SSH_SETUP,
+       self._SSH_KEY_TYPE)
 
     self._get_online_nodes_mock = mock.Mock()
     self._get_online_nodes_mock.return_value = \