コード例 #1
0
ファイル: test_powervm.py プロジェクト: faye89/nova
 def test_check_connection_ssh_is_none(self):
     """
     Passes a null ssh object to the check_connection method.
     The method should create a new ssh connection using the
     Connection object and return it.
     """
     self.stubs.Set(common, 'ssh_connect', fake_ssh_connect)
     ssh = common.check_connection(None, self.connection)
     self.assertIsNotNone(ssh)
コード例 #2
0
ファイル: test_powervm.py プロジェクト: jhesketh/nova
 def test_check_connection_ssh_is_none(self):
     """
     Passes a null ssh object to the check_connection method.
     The method should create a new ssh connection using the
     Connection object and return it.
     """
     self.stubs.Set(common, 'ssh_connect', fake_ssh_connect)
     ssh = common.check_connection(None, self.connection)
     self.assertIsNotNone(ssh)
コード例 #3
0
ファイル: test_powervm.py プロジェクト: faye89/nova
 def test_check_connection_transport_is_dead(self):
     """
     Passes an ssh object to the check_connection method which
     does not have a transport set.
     The method should create a new ssh connection using the
     Connection object and return it.
     """
     self.stubs.Set(common, 'ssh_connect', fake_ssh_connect)
     ssh1 = fake_ssh_connect(self.connection)
     ssh2 = common.check_connection(ssh1, self.connection)
     self.assertIsNotNone(ssh2)
     self.assertNotEqual(ssh1, ssh2)
コード例 #4
0
ファイル: test_powervm.py プロジェクト: jhesketh/nova
 def test_check_connection_transport_is_dead(self):
     """
     Passes an ssh object to the check_connection method which
     does not have a transport set.
     The method should create a new ssh connection using the
     Connection object and return it.
     """
     self.stubs.Set(common, 'ssh_connect', fake_ssh_connect)
     ssh1 = fake_ssh_connect(self.connection)
     ssh2 = common.check_connection(ssh1, self.connection)
     self.assertIsNotNone(ssh2)
     self.assertNotEqual(ssh1, ssh2)
コード例 #5
0
ファイル: operator.py プロジェクト: abhirajbutala/nova
 def _set_connection(self):
     # create a new connection or verify an existing connection
     # and re-establish if the existing connection is dead
     self._connection = common.check_connection(self._connection,
                                                self.connection_data)
コード例 #6
0
ファイル: blockdev.py プロジェクト: wingo1990/nova
 def _set_connection(self):
     # create a new connection or verify an existing connection
     # and re-establish if the existing connection is dead
     self._connection = common.check_connection(self._connection,
                                                self.connection_data)