Пример #1
0
    def test_init(self, conf_dict, expected):
        self.driver.configuration.replication_device = conf_dict
        device = replication.ReplicationDevice(conf_dict, self.driver)

        self.assertListEqual([
            device.backend_id, device.san_ip, device.san_login,
            device.san_password, device.max_time_out_of_sync
        ], expected)

        self.assertIs(self.driver, device.driver)
Пример #2
0
    def setUp(self):
        self.config = conf.Configuration(san_opts,
                                         config_group='unity-backend')
        self.config.san_ip = '1.1.1.1'
        self.config.san_login = '******'
        self.config.san_password = '******'
        self.driver = driver.UnityDriver(configuration=self.config)

        conf_dict = {'backend_id': 'secondary_unity', 'san_ip': '2.2.2.2'}
        self.mock_adapter = mock.MagicMock(is_setup=False)

        def mock_do_setup(*args):
            self.mock_adapter.is_setup = True

        self.mock_adapter.do_setup = mock.MagicMock(side_effect=mock_do_setup)
        with mock.patch(
                'cinder.volume.drivers.dell_emc.unity.'
                'replication.init_adapter',
                return_value=self.mock_adapter):
            self.replication_device = replication.ReplicationDevice(
                conf_dict, self.driver)
Пример #3
0
    def test_device_conf(self, conf_dict, expected):
        self.driver.configuration.replication_device = conf_dict
        device = replication.ReplicationDevice(conf_dict, self.driver)

        c = device.device_conf
        self.assertListEqual([c.san_ip, c.san_login, c.san_password], expected)