Пример #1
0
 def testOverridePubKeyFile(self):
     fd = open(self.pub_key_filename, "w")
     fd.write("Pink Bunny")
     fd.close()
     gnt_cluster._BuildGanetiPubKeys(
         self._options,
         pub_key_file=self.pub_key_filename,
         cl=self.mock_cl,
         get_online_nodes_fn=self._get_online_nodes_mock,
         get_nodes_ssh_ports_fn=self._get_nodes_ssh_ports_mock,
         get_node_uuids_fn=self._get_node_uuids_mock,
         homedir_fn=self._GetTempHomedir)
     self.assertFalse("Pink Bunny" in self.pub_key_filename)
 def testOverridePubKeyFile(self):
   fd = open(self.pub_key_filename, "w")
   fd.write("Pink Bunny")
   fd.close()
   gnt_cluster._BuildGanetiPubKeys(
     self._options,
     pub_key_file=self.pub_key_filename,
     cl=self.mock_cl,
     get_online_nodes_fn=self._get_online_nodes_mock,
     get_nodes_ssh_ports_fn=self._get_nodes_ssh_ports_mock,
     get_node_uuids_fn=self._get_node_uuids_mock,
     homedir_fn=self._GetTempHomedir)
   self.assertFalse("Pink Bunny" in self.pub_key_filename)
Пример #3
0
 def testNewPubKeyFile(self):
     gnt_cluster._BuildGanetiPubKeys(
         self._options,
         pub_key_file=self.pub_key_filename,
         cl=self.mock_cl,
         get_online_nodes_fn=self._get_online_nodes_mock,
         get_nodes_ssh_ports_fn=self._get_nodes_ssh_ports_mock,
         get_node_uuids_fn=self._get_node_uuids_mock,
         homedir_fn=self._GetTempHomedir)
     key_file_result = utils.ReadFile(self.pub_key_filename)
     for node_uuid in self._ONLINE_NODE_UUIDS + [self._MASTER_NODE_UUID]:
         self.assertTrue(node_uuid in key_file_result)
     self.assertTrue(self._PUB_KEY in key_file_result)
 def testNewPubKeyFile(self):
   gnt_cluster._BuildGanetiPubKeys(
     self._options,
     pub_key_file=self.pub_key_filename,
     cl=self.mock_cl,
     get_online_nodes_fn=self._get_online_nodes_mock,
     get_nodes_ssh_ports_fn=self._get_nodes_ssh_ports_mock,
     get_node_uuids_fn=self._get_node_uuids_mock,
     homedir_fn=self._GetTempHomedir)
   key_file_result = utils.ReadFile(self.pub_key_filename)
   for node_uuid in self._ONLINE_NODE_UUIDS + [self._MASTER_NODE_UUID]:
     self.assertTrue(node_uuid in key_file_result)
   self.assertTrue(self._PUB_KEY in key_file_result)