Ejemplo n.º 1
0
    def test_brick_get_connector(self):

        root_helper = utils.get_root_helper()

        self.mox.StubOutClassWithMocks(connector, 'ISCSIConnector')
        connector.ISCSIConnector(execute=putils.execute,
                                 driver=None,
                                 root_helper=root_helper,
                                 use_multipath=False)

        self.mox.StubOutClassWithMocks(connector, 'FibreChannelConnector')
        connector.FibreChannelConnector(execute=putils.execute,
                                        driver=None,
                                        root_helper=root_helper,
                                        use_multipath=False)

        self.mox.StubOutClassWithMocks(connector, 'AoEConnector')
        connector.AoEConnector(execute=putils.execute,
                               driver=None,
                               root_helper=root_helper)

        self.mox.StubOutClassWithMocks(connector, 'LocalConnector')
        connector.LocalConnector(execute=putils.execute,
                                 driver=None,
                                 root_helper=root_helper)

        self.mox.ReplayAll()
        utils.brick_get_connector('iscsi')
        utils.brick_get_connector('fibre_channel')
        utils.brick_get_connector('aoe')
        utils.brick_get_connector('local')
        self.mox.VerifyAll()
Ejemplo n.º 2
0
 def test_connect_volume_with_invalid_connection_data(self):
     self.connector = connector.LocalConnector(None)
     cprops = {}
     self.assertRaises(ValueError,
                       self.connector.connect_volume, cprops)
Ejemplo n.º 3
0
 def test_connect_volume(self):
     self.connector = connector.LocalConnector(None)
     cprops = self.connection_properties
     dev_info = self.connector.connect_volume(cprops)
     self.assertEqual(dev_info['type'], 'local')
     self.assertEqual(dev_info['path'], cprops['device_path'])