code
stringlengths
3
6.57k
test_client_create_luncopy(self, input_speed, actual_speed)
mock.Mock(wraps=self.driver.client.call)
HuaweiISCSIDriverTestCase(HuaweiTestBase)
setUp(self)
super(HuaweiISCSIDriverTestCase, self)
setUp()
mock.Mock(spec=conf.Configuration)
self.flags(rpc_backend='oslo_messaging._drivers.impl_fake')
FakeISCSIStorage(configuration=self.configuration)
self.driver.do_setup()
self.driver.client.login()
test_parse_rmt_iscsi_info(self)
self.driver.huawei_conf.get_replication_devices()
self.assertEqual(expected_iscsi_info, iscsi_info)
test_parse_rmt_iscsi_info_without_iscsi_configuration(self)
self.driver.huawei_conf.get_replication_devices()
self.assertEqual([], iscsi_info)
test_login_success(self)
self.driver.client.login()
self.assertEqual('210235G7J20000000000', device_id)
ddt.data(constants.PWD_EXPIRED, constants.PWD_RESET)
test_login_password_expires_and_reset_fail(self, state)
mock.patch.object(self.driver.client, 'logout')
mock_logout.assert_called_once_with()
test_login_logout_fail(self)
test_check_volume_exist_on_array(self)
test_create_volume_success(self)
self.driver.create_volume(self.volume)
self.assertEqual('1', lun_info['provider_location'])
self.driver.create_volume(self.volume)
self.assertEqual('1', lun_info['provider_location'])
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_delete_replication_fail(self, pool_data)
self.mock_object(replication.ReplicaCommonDriver, 'split')
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_migrate_volume_success_no_data(self, pool_data)
self.assertTrue(moved)
self.assertEqual(empty_dict, model_update)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_migrate_volume_success_with_replication(self, pool_data)
self.assertTrue(moved)
self.assertEqual(empty_dict, model_update)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_migrate_volume_fail_migration_fault(self, pool_data)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_migrate_volume_fail_no_migrate_task(self, pool_data)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_migrate_volume_with_type_id(self, pool_data)
self.assertTrue(moved)
self.assertEqual(empty_dict, model_update)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_manage_existing_fail(self, pool_data)
self.mock_object(rest_client.RestClient, 'rename_lun')
self.driver.manage_existing(self.volume, external_ref)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_delete_volume_success(self, pool_data)
self.driver.delete_volume(self.volume)
test_delete_snapshot_success(self)
self.driver.delete_snapshot(self.snapshot)
unittest.skip("Skip until bug #1578986 is fixed")
test_create_volume_from_snapsuccess(self)
self.mock_object(replication.ReplicaCommonDriver, 'sync')
self.assertEqual('1', model_update['provider_location'])
replication.to_string(driver_data)
self.assertEqual(driver_data, model_update['replication_driver_data'])
self.assertEqual('available', model_update['replication_status'])
test_initialize_connection_snapshot_success(self, mock_iscsi_init)
self.assertEqual(1, iscsi_properties['data']['target_lun'])
mock_iscsi_init.assert_called_with(volume, FakeConnector)
test_initialize_connection_success_multipath_portgroup(self)
copy.deepcopy(FakeConnector)
self.assertEqual([1, 1], iscsi_properties['data']['target_luns'])
test_initialize_connection_fail_multipath_portgroup(self)
copy.deepcopy(FakeConnector)
test_initialize_connection_success_multipath_targetip(self)
mock.Mock(spec = conf.Configuration)
FakeISCSIStorage(configuration = self.configuration)
driver.do_setup()
copy.deepcopy(FakeConnector)
self.assertEqual([1], iscsi_properties['data']['target_luns'])
test_initialize_connection_fail_multipath_targetip(self)
mock.Mock(spec = conf.Configuration)
FakeISCSIStorage(configuration = self.configuration)
driver.do_setup()
copy.deepcopy(FakeConnector)
test_initialize_connection_success_multipath_defaultip(self)
mock.Mock(spec = conf.Configuration)
FakeISCSIStorage(configuration = self.configuration)
driver.do_setup()
copy.deepcopy(FakeConnector)
self.assertEqual([1], iscsi_properties['data']['target_luns'])
test_initialize_connection_fail_multipath_defaultip(self)
mock.Mock(spec = conf.Configuration)
FakeISCSIStorage(configuration = self.configuration)
driver.do_setup()
copy.deepcopy(FakeConnector)
test_initialize_connection_fail_no_port_in_portgroup(self)
copy.deepcopy(FakeConnector)
test_initialize_connection_fail_multipath_no_ip(self)
mock.Mock(spec = conf.Configuration)