Merge "Fix: storage_pools key in Huawei Driver"
This commit is contained in:
commit
3343b0e09f
@ -5622,6 +5622,42 @@ class HuaweiConfTestCase(test.TestCase):
|
||||
self.assertRaises(expect_result,
|
||||
self.huawei_conf._lun_type, xml_root)
|
||||
|
||||
@ddt.data(
|
||||
[{
|
||||
'backend_id': "default",
|
||||
'san_address': 'https://192.0.2.69:8088/deviceManager/rest/',
|
||||
'san_user': 'admin',
|
||||
'san_password': '123456',
|
||||
'storage_pool': 'OpenStack_Pool',
|
||||
'iscsi_info': """{Name:iqn.1993-08.debian:01:ec2bff7acxxx;
|
||||
TargetIP:1.1.1.1;
|
||||
CHAPinfo:mm-user@storage;
|
||||
ALUA:1;
|
||||
TargetPortGroup:portgroup-test}"""
|
||||
}]
|
||||
)
|
||||
def test_get_replication_devices(self, config):
|
||||
self.mock_object(self.conf,
|
||||
'safe_get',
|
||||
mock.Mock(return_value=config)
|
||||
)
|
||||
|
||||
replication_devices = self.huawei_conf.get_replication_devices()
|
||||
expected = [
|
||||
{'backend_id': 'default',
|
||||
'iscsi_default_target_ip': [],
|
||||
'iscsi_info': [{'ALUA': '1',
|
||||
'CHAPinfo': 'mm-user@storage',
|
||||
'Name': 'iqn.1993-08.debian:01:ec2bff7acxxx',
|
||||
'TargetIP': '1.1.1.1',
|
||||
'TargetPortGroup': 'portgroup-test'}],
|
||||
'san_address': ['https://192.0.2.69:8088/deviceManager/rest/'],
|
||||
'san_password': '123456',
|
||||
'san_user': 'admin',
|
||||
'storage_pools': ['OpenStack_Pool']}]
|
||||
|
||||
self.assertEqual(expected, replication_devices)
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class HuaweiRestClientTestCase(test.TestCase):
|
||||
|
@ -315,7 +315,7 @@ class HuaweiConf(object):
|
||||
dev_config['san_address'] = dev['san_address'].split(';')
|
||||
dev_config['san_user'] = dev['san_user']
|
||||
dev_config['san_password'] = dev['san_password']
|
||||
dev_config['storage_pool'] = dev['storage_pool'].split(';')
|
||||
dev_config['storage_pools'] = dev['storage_pool'].split(';')
|
||||
dev_config['iscsi_info'] = self._parse_rmt_iscsi_info(
|
||||
dev.get('iscsi_info'))
|
||||
dev_config['iscsi_default_target_ip'] = (
|
||||
@ -332,7 +332,7 @@ class HuaweiConf(object):
|
||||
'san_address': self.conf.san_address,
|
||||
'san_user': self.conf.san_user,
|
||||
'san_password': self.conf.san_password,
|
||||
'storage_pool': self.conf.storage_pools,
|
||||
'storage_pools': self.conf.storage_pools,
|
||||
'iscsi_info': self.conf.iscsi_info,
|
||||
'iscsi_default_target_ip': self.conf.iscsi_default_target_ip,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user