Exemplo n.º 1
0
 def test_check_valid_device_with_cmd_error(self):
     def raise_except(*args, **kwargs):
         raise putils.ProcessExecutionError
     self.connector = connector.InitiatorConnector(None)
     self.stubs.Set(self.connector,
                    '_execute', raise_except)
     self.assertFalse(self.connector.check_valid_device('/dev'))
Exemplo n.º 2
0
 def test_check_valid_device_with_wrong_path(self):
     self.connector = connector.InitiatorConnector(None)
     self.stubs.Set(self.connector,
                    '_execute', lambda *args, **kwargs: ("", None))
     self.assertFalse(self.connector.check_valid_device('/d0v'))
Exemplo n.º 3
0
 def test_check_valid_device(self):
     self.connector = connector.InitiatorConnector(None)
     self.stubs.Set(self.connector,
                    '_execute', lambda *args, **kwargs: ("", ""))
     self.assertTrue(self.connector.check_valid_device('/dev'))
Exemplo n.º 4
0
 def test_disconnect_volume(self):
     self.connector = connector.InitiatorConnector(None)
     self.assertRaises(NotImplementedError,
                       self.connector.disconnect_volume, None, None)