body = {'qos_specs': {'key1': 'value1',
'key2': 'value2'}}
res = self.controller.update(req, '555', body)
- self.assertDictMatch(res, body)
+ self.assertDictMatch(body, res)
self.assertEqual(1, notifier.get_notification_count())
@mock.patch('cinder.volume.qos_specs.update',
continue
new_dict.update({element.tag: element.text})
- self.assertDictMatch(new_dict, qos_dict['specs'])
+ self.assertDictMatch(qos_dict['specs'], new_dict)
class TestAssociationsTemplate(test.TestCase):
self.req.environ['cinder.context'].project_id = self.A.id
result = self.controller.show(self.req, self.D.id)
expected = make_subproject_body(tenant_id=self.D.id)
- self.assertDictMatch(result, expected)
+ self.assertDictMatch(expected, result)
# An user scoped to a parent project can see its immediate children
# quotas.
self.req.environ['cinder.context'].project_id = self.B.id
result = self.controller.show(self.req, self.D.id)
expected = make_subproject_body(tenant_id=self.D.id)
- self.assertDictMatch(result, expected)
+ self.assertDictMatch(expected, result)
def test_subproject_show_target_project_equals_to_context_project(self):
self.controller._get_project = mock.Mock()
self.req.environ['cinder.context'].project_id = self.B.id
result = self.controller.show(self.req, self.B.id)
expected = make_subproject_body(tenant_id=self.B.id)
- self.assertDictMatch(result, expected)
+ self.assertDictMatch(expected, result)
def test_show_not_authorized(self):
self.controller._get_project = mock.Mock()
body = make_body(gigabytes=2000, snapshots=15,
volumes=5, backups=5, tenant_id=None)
result = self.controller.update(self.req, self.A.id, body)
- self.assertDictMatch(result, body)
+ self.assertDictMatch(body, result)
# Update the quota of B to be equal to its parent quota
self.req.environ['cinder.context'].project_id = self.A.id
body = make_body(gigabytes=2000, snapshots=15,
volumes=5, backups=5, tenant_id=None)
result = self.controller.update(self.req, self.B.id, body)
- self.assertDictMatch(result, body)
+ self.assertDictMatch(body, result)
# Try to update the quota of C, it will not be allowed, since the
# project A doesn't have free quota available.
self.req.environ['cinder.context'].project_id = self.A.id
body = make_body(gigabytes=1000, snapshots=7,
volumes=3, backups=3, tenant_id=None)
result = self.controller.update(self.req, self.D.id, body)
- self.assertDictMatch(result, body)
+ self.assertDictMatch(body, result)
# An admin of B can also update the quota of D, since D is its an
# immediate child.
self.req.environ['cinder.context'].project_id = self.B.id
body = make_body(gigabytes=2000, snapshots=15,
volumes=5, backups=5, tenant_id=None)
result = self.controller.update(self.req, self.A.id, body)
- self.assertDictMatch(result, body)
+ self.assertDictMatch(body, result)
# Try to update the quota of F, it will not be allowed, since the
# project E doesn't belongs to the project hierarchy of A.
self.req.environ['cinder.context'].project_id = self.A.id
body = make_body(gigabytes=2000, snapshots=15,
volumes=5, backups=5, tenant_id=None)
result = self.controller.update(self.req, self.A.id, body)
- self.assertDictMatch(result, body)
+ self.assertDictMatch(body, result)
# Try to update the quota of B, it will not be allowed, since the
# project in the context (B) is not a root project.
self.req.environ['cinder.context'].project_id = self.B.id
self.controller._get_project = mock.Mock()
self.controller._get_project.side_effect = self._get_project
result_show = self.controller.show(self.req, 'foo')
- self.assertDictMatch(result_show, make_body())
+ self.assertDictMatch(make_body(), result_show)
body = make_body(gigabytes=2000, snapshots=15,
volumes=5, backups=5,
backup_gigabytes=1000, tenant_id=None)
result_update = self.controller.update(self.req, 'foo', body)
- self.assertDictMatch(result_update, body)
+ self.assertDictMatch(body, result_update)
self.controller.delete(self.req, 'foo')
volumes=5, backups=5,
backup_gigabytes=1000, tenant_id=None)
result_update = self.controller.update(self.req, self.A.id, body)
- self.assertDictMatch(result_update, body)
+ self.assertDictMatch(body, result_update)
# Set usage param to True in order to see get allocated values.
self.req.params = {'usage': 'True'}
result_show = self.controller.show(self.req, self.A.id)
result_update = self.controller.update(self.req, self.B.id, body)
- self.assertDictMatch(result_update, body)
+ self.assertDictMatch(body, result_update)
self.controller.delete(self.req, self.B.id)
volumes=5, backups=5,
backup_gigabytes=1000, tenant_id=None)
result_update = self.controller.update(self.req, self.A.id, body)
- self.assertDictMatch(result_update, body)
+ self.assertDictMatch(body, result_update)
# Set usage param to True in order to see get allocated values.
self.req.params = {'usage': 'True'}
result_show = self.controller.show(self.req, self.A.id)
result_update = self.controller.update(self.req, self.B.id, body)
- self.assertDictMatch(result_update, body)
+ self.assertDictMatch(body, result_update)
self.controller.delete(self.req, self.B.id)
def test_show(self):
volume_types.create(self.ctxt, 'fake_type')
result = self.controller.show(self.req, 'foo')
- self.assertDictMatch(result, make_body())
+ self.assertDictMatch(make_body(), result)
def test_show_not_authorized(self):
self.req.environ['cinder.context'].is_admin = False
body = make_body(gigabytes=2000, snapshots=15,
volumes=5, tenant_id=None)
result = self.controller.update(self.req, 'foo', body)
- self.assertDictMatch(result, body)
+ self.assertDictMatch(body, result)
@mock.patch('cinder.api.openstack.wsgi.Controller.validate_string_length')
@mock.patch('cinder.api.openstack.wsgi.Controller.validate_integer')
volume_types.create(self.ctxt, 'fake_type')
body = {'quota_class_set': {'bad': 'bad'}}
result = self.controller.update(self.req, 'foo', body)
- self.assertDictMatch(result, make_body(tenant_id=None))
+ self.assertDictMatch(make_body(tenant_id=None), result)
def test_update_invalid_key_value(self):
body = {'quota_class_set': {'gigabytes': "should_be_int"}}
body = {'quota_class_set': {'gigabytes_fake_type_1': 1111,
'volumes_fake_type_2': 2222}}
result = self.controller.update(self.req, 'foo', body)
- self.assertDictMatch(result, make_response_body(ctxt=self.ctxt,
- quota_class='foo',
- request_body=body,
- tenant_id=None))
+ self.assertDictMatch(make_response_body(ctxt=self.ctxt,
+ quota_class='foo',
+ request_body=body,
+ tenant_id=None),
+ result)
class QuotaClassesSerializerTest(test.TestCase):
]
}
- self.assertDictMatch(res, expected)
+ self.assertDictMatch(expected, res)
def test_get_pools_detail(self):
req = fakes.HTTPRequest.blank('/v2/fake/scheduler_stats?detail=True')
]
}
- self.assertDictMatch(res, expected)
+ self.assertDictMatch(expected, res)
'container_format': 'bare',
'disk_format': 'raw',
'image_name': 'image_name'}}
- self.assertDictMatch(res_dict, expected)
+ self.assertDictMatch(expected, res_dict)
def test_copy_volume_to_image_volumenotfound(self):
def stub_volume_get_raise_exc(self, context, volume_id):
}
}
- self.assertDictMatch(res_dict, expected_res)
+ self.assertDictMatch(expected_res, res_dict)
def test_copy_volume_to_image_without_glance_metadata(self):
"""Test create image from volume if volume is created without image.
}
}
- self.assertDictMatch(res_dict, expected_res)
+ self.assertDictMatch(expected_res, res_dict)
def test_copy_volume_to_image_without_protected_prop(self):
"""Test protected property is not defined with the root image."""
}
}
- self.assertDictMatch(res_dict, expected_res)
+ self.assertDictMatch(expected_res, res_dict)
def test_copy_volume_to_image_without_core_prop(self):
"""Test glance_core_properties defined in cinder.conf is empty."""
}
}
- self.assertDictMatch(res_dict, expected_res)
+ self.assertDictMatch(expected_res, res_dict)
output = self.view_builder.build(self.rate_limits,
self.absolute_limits)
- self.assertDictMatch(output, expected_limits)
+ self.assertDictMatch(expected_limits, output)
def test_build_limits_empty_limits(self):
expected_limits = {"limits": {"rate": [],
abs_limits = {}
rate_limits = []
output = self.view_builder.build(rate_limits, abs_limits)
- self.assertDictMatch(output, expected_limits)
+ self.assertDictMatch(expected_limits, output)
class LimitsXMLSerializationTest(test.TestCase):
description=None,
is_public=None,
id=42)
- self.assertDictMatch(output['volume_type'], expected_volume_type)
+ self.assertDictMatch(expected_volume_type, output['volume_type'])
def test_view_builder_list(self):
view_builder = views_types.ViewBuilder()
id=42 + i,
is_public=None,
description=None)
- self.assertDictMatch(output['volume_types'][i],
- expected_volume_type)
+ self.assertDictMatch(expected_volume_type,
+ output['volume_types'][i])
class VolumeTypesSerializerTest(test.TestCase):
is_public=True,
id=42,
)
- self.assertDictMatch(output['volume_type'], expected_volume_type)
+ self.assertDictMatch(expected_volume_type, output['volume_type'])
def test_view_builder_show_admin(self):
view_builder = views_types.ViewBuilder()
is_public=True,
id=42 + i
)
- self.assertDictMatch(output['volume_types'][i],
- expected_volume_type)
+ self.assertDictMatch(expected_volume_type,
+ output['volume_types'][i])
def test_view_builder_list_admin(self):
view_builder = views_types.ViewBuilder()
expected = dict(name='Name1', id=specs_id, consumer='front-end')
del value['consumer']
expected.update(dict(specs=value))
- self.assertDictMatch(specs, expected)
+ self.assertDictMatch(expected, specs)
def test_qos_specs_get_all(self):
value1 = dict(consumer='front-end',
'id': specs_id,
'consumer': 'front-end',
'specs': value}
- self.assertDictMatch(specs, expected)
+ self.assertDictMatch(expected, specs)
def test_qos_specs_delete(self):
name = str(int(time.time()))
'specs': value}
db.qos_specs_item_delete(self.ctxt, specs_id, 'foo')
specs = db.qos_specs_get_by_name(self.ctxt, name)
- self.assertDictMatch(specs, expected)
+ self.assertDictMatch(expected, specs)
def test_associate_type_with_qos(self):
self.assertRaises(exception.VolumeTypeNotFound,
'properties': {'instance_id': '42', 'user_id': 'fake'},
'owner': None,
}
- self.assertDictMatch(image_meta, expected)
+ self.assertDictMatch(expected, image_meta)
image_metas = self.service.detail(self.context)
- self.assertDictMatch(image_metas[0], expected)
+ self.assertDictMatch(expected, image_metas[0])
def test_create_without_instance_id(self):
"""Test Creating images without instance_id.
'owner': None,
}
actual = self.service.show(self.context, image_id)
- self.assertDictMatch(actual, expected)
+ self.assertDictMatch(expected, actual)
def test_create(self):
fixture = self._make_fixture(name='test image')
'owner': None,
}
- self.assertDictMatch(meta, expected)
+ self.assertDictMatch(expected, meta)
i = i + 1
def test_detail_limit(self):
'deleted': None,
'owner': None,
}
- self.assertDictMatch(meta, expected)
+ self.assertDictMatch(expected, meta)
i = i + 1
def test_detail_invalid_marker(self):
@mock.patch('oslo_utils.timeutils.utcnow')
def test_update_service_capabilities(self, _mock_utcnow):
service_states = self.host_manager.service_states
- self.assertDictMatch(service_states, {})
+ self.assertDictMatch({}, service_states)
_mock_utcnow.side_effect = [31337, 31338, 31339]
host1_volume_capabs = dict(free_capacity_gb=4321, timestamp=1)
self.assertEqual(512,
fake_pool.provisioned_capacity_gb)
- self.assertDictMatch(fake_pool.capabilities, volume_capability)
+ self.assertDictMatch(volume_capability, fake_pool.capabilities)
expected +
self.standard_logout)
- self.assertDictMatch(result, self.properties)
+ self.assertDictMatch(self.properties, result)
@mock.patch('cinder.zonemanager.utils.create_lookup_service')
def test_initialize_connection_with_lookup_single_nsp(self, mock_lookup):
expected +
self.standard_logout)
- self.assertDictMatch(result, expected_properties)
+ self.assertDictMatch(expected_properties, result)
def test_initialize_connection_encrypted(self):
# setup_mock_client drive with default configuration
expected_properties = self.properties
expected_properties['data']['encrypted'] = True
- self.assertDictMatch(result, expected_properties)
+ self.assertDictMatch(expected_properties, result)
def test_terminate_connection(self):
# setup_mock_client drive with default configuration
expected +
self.standard_logout)
- self.assertDictMatch(result, self.properties)
+ self.assertDictMatch(self.properties, result)
def test_initialize_connection_multipath(self):
# setup_mock_client drive with default configuration
expected_properties = self.properties
expected_properties['data']['encrypted'] = True
- self.assertDictMatch(result, self.properties)
+ self.assertDictMatch(self.properties, result)
def test_get_volume_stats(self):
# setup_mock_client drive with the configuration
result = self.driver.initialize_connection(volume,
self.connector)
self.assertEqual('iscsi', result['driver_volume_type'])
- self.assertDictMatch(result['data'], self.properties)
+ self.assertDictMatch(self.properties, result['data'])
expected = [
mock.call(
if isinstance(out, list):
for i in range(len(test_data[1])):
- self.assertDictMatch(out[i], test_data[1][i])
+ self.assertDictMatch(test_data[1][i], out[i])
else:
- self.assertDictMatch(out, test_data[1])
+ self.assertDictMatch(test_data[1], out)
@mock.patch.object(cli.LOG, 'debug', mock.Mock())
def test_cli_all_command_execute(self):
self.driver._init_map_info(True)
- self.assertDictMatch(self.driver.map_dict, test_map_dict)
- self.assertDictMatch(self.driver.target_dict, test_target_dict)
+ self.assertDictMatch(test_map_dict, self.driver.map_dict)
+ self.assertDictMatch(test_target_dict, self.driver.target_dict)
def test_normal_channel_with_r_model(self):
self.driver._init_map_info(True)
- self.assertDictMatch(self.driver.map_dict, test_map_dict)
- self.assertDictMatch(self.driver.target_dict, test_target_dict)
+ self.assertDictMatch(test_map_dict, self.driver.map_dict)
+ self.assertDictMatch(test_target_dict, self.driver.target_dict)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_initialize_connection(self):
properties = self.driver.initialize_connection(
test_volume, test_connector)
- self.assertDictMatch(properties, self.cli_data.test_fc_properties)
+ self.assertDictMatch(self.cli_data.test_fc_properties, properties)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_initialize_connection_specific_channel(self):
test_volume, test_connector)
self.assertDictMatch(
- properties, self.cli_data.test_fc_properties_with_specific_channel)
+ self.cli_data.test_fc_properties_with_specific_channel, properties)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_initialize_connection_with_diff_target_id(self):
self._assert_cli_has_calls(expect_cli_cmd)
self.assertDictMatch(
- properties, self.cli_data.test_fc_properties_with_specific_channel)
+ self.cli_data.test_fc_properties_with_specific_channel, properties)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_initialize_connection_multipath_with_r_model(self):
test_volume, test_connector)
self.assertDictMatch(
- properties, self.cli_data.test_fc_properties_multipath_r_model)
+ self.cli_data.test_fc_properties_multipath_r_model, properties)
def test_initialize_connection_with_get_wwn_fail(self):
self._assert_cli_has_calls(expect_cli_cmd)
self.assertDictMatch(
- properties, self.cli_data.test_fc_properties_zoning)
+ self.cli_data.test_fc_properties_zoning, properties)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_initialize_connection_with_zoning_r_model(self):
self._assert_cli_has_calls(expect_cli_cmd)
self.assertDictMatch(
- properties, self.cli_data.test_fc_properties_zoning_r_model)
+ self.cli_data.test_fc_properties_zoning_r_model, properties)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_initialize_connection_with_zoning_r_model_diff_target_id(self):
self._assert_cli_has_calls(expect_cli_cmd)
self.assertDictMatch(
- properties, self.cli_data.test_fc_properties_zoning_r_model)
+ self.cli_data.test_fc_properties_zoning_r_model, properties)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_terminate_connection(self):
self._assert_cli_has_calls(expect_cli_cmd)
self.assertDictMatch(
- conn_info, self.cli_data.test_fc_terminate_conn_info)
+ self.cli_data.test_fc_terminate_conn_info, conn_info)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_terminate_connection_with_zoning_and_lun_map_exist(self):
self.driver._init_map_info()
- self.assertDictMatch(self.driver.map_dict, test_map_dict)
- self.assertDictMatch(self.driver.target_dict, test_target_dict)
+ self.assertDictMatch(test_map_dict, self.driver.map_dict)
+ self.assertDictMatch(test_target_dict, self.driver.target_dict)
def test_normal_channel_with_multipath(self):
self.driver._init_map_info(multipath=True)
- self.assertDictMatch(self.driver.map_dict, test_map_dict)
- self.assertDictMatch(self.driver.target_dict, test_target_dict)
+ self.assertDictMatch(test_map_dict, self.driver.map_dict)
+ self.assertDictMatch(test_target_dict, self.driver.target_dict)
def test_specific_channel(self):
self.driver._init_map_info()
- self.assertDictMatch(self.driver.map_dict, test_map_dict)
- self.assertDictMatch(self.driver.target_dict, test_target_dict)
+ self.assertDictMatch(test_map_dict, self.driver.map_dict)
+ self.assertDictMatch(test_target_dict, self.driver.target_dict)
def test_update_mcs_dict(self):
self.driver._init_map_info()
- self.assertDictMatch(self.driver.mcs_dict, test_mcs_dict)
+ self.assertDictMatch(test_mcs_dict, self.driver.mcs_dict)
def test_mapping_info_with_mcs(self):
map_chl, map_lun, mcs_id = self.driver._get_mapping_info_with_mcs()
- self.assertDictMatch(map_chl, test_map_chl)
+ self.assertDictMatch(test_map_chl, map_chl)
self.assertEqual(test_map_lun, map_lun)
self.assertEqual(test_mcs_id, mcs_id)
map_chl, map_lun, mcs_id = self.driver._get_mapping_info_with_mcs()
- self.assertDictMatch(map_chl, test_map_chl)
+ self.assertDictMatch(test_map_chl, map_chl)
self.assertEqual(test_map_lun, map_lun)
self.assertEqual(test_mcs_id, mcs_id)
self.driver._init_map_info(multipath=True)
- self.assertDictMatch(self.driver.map_dict, test_map_dict)
- self.assertDictMatch(self.driver.target_dict, test_target_dict)
+ self.assertDictMatch(test_map_dict, self.driver.map_dict)
+ self.assertDictMatch(test_target_dict, self.driver.target_dict)
def test_specific_channel_with_multipath_r_model(self):
self.driver._init_map_info(multipath=True)
- self.assertDictMatch(self.driver.map_dict, test_map_dict)
- self.assertDictMatch(self.driver.target_dict, test_target_dict)
+ self.assertDictMatch(test_map_dict, self.driver.map_dict)
+ self.assertDictMatch(test_target_dict, self.driver.target_dict)
@mock.patch.object(common_cli.LOG, 'info')
def test_create_volume(self, log_info):
model_update = self.driver.create_volume(test_volume)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
self.assertEqual(1, log_info.call_count)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
model_update = self.driver.create_cloned_volume(
test_dst_volume, test_src_volume)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
self.assertEqual(1, log_info.call_count)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
model_update = self.driver.create_export(None, test_volume)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
def test_get_volume_stats(self):
volume_states = self.driver.get_volume_stats(True)
- self.assertDictMatch(volume_states, test_volume_states)
+ self.assertDictMatch(test_volume_states, volume_states)
def test_get_volume_stats_fail(self):
model_update = self.driver.create_volume_from_snapshot(
test_dst_volume, test_snapshot)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
self.assertEqual(1, log_info.call_count)
@mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
model_update = self.driver.create_volume_from_snapshot(
test_dst_volume, test_snapshot)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
self.assertEqual(1, log_info.call_count)
def test_create_volume_from_snapshot_without_provider_location(
properties = self.driver.initialize_connection(
test_volume, test_connector)
- self.assertDictMatch(properties, test_iscsi_properties)
+ self.assertDictMatch(test_iscsi_properties, properties)
expect_cli_cmd = [
mock.call('CreateMap', 'part', test_partition_id, '2', '0', '0',
properties = self.driver.initialize_connection(
test_volume, test_connector)
- self.assertDictMatch(properties, test_iscsi_properties)
+ self.assertDictMatch(test_iscsi_properties, properties)
expect_cli_cmd = [
mock.call('CreateIQN', test_initiator, test_initiator[-16:]),
test_volume, test_connector)
self.assertDictMatch(
- properties, self.cli_data.test_iscsi_properties_empty_map)
+ self.cli_data.test_iscsi_properties_empty_map, properties)
def test_initialize_connection_with_create_map_fail(self):
properties = self.driver.initialize_connection(
test_volume, test_connector)
- self.assertDictMatch(properties, test_iscsi_properties)
+ self.assertDictMatch(test_iscsi_properties, properties)
expect_cli_cmd = [
mock.call('CreateMap', 'part', test_partition_id, '1', '0', '2',
]
self._assert_cli_has_calls(expect_cli_cmd)
self.assertTrue(rc)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
@mock.patch.object(common_cli.LOG, 'warning')
def test_migrate_volume_with_invalid_storage(self, log_warning):
]
self._assert_cli_has_calls(expect_cli_cmd)
self.assertEqual(1, log_info.call_count)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
def test_manage_existing_rename_fail(self):
]
self._assert_cli_has_calls(expect_cli_cmd)
self.assertEqual(1, log_info.call_count)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
@mock.patch.object(common_cli.LOG, 'info')
def test_unmanage(self, log_info):
]
self._assert_cli_has_calls(expect_cli_cmd)
self.assertTrue(rc)
- self.assertDictMatch(model_update, test_model_update)
+ self.assertDictMatch(test_model_update, model_update)
@mock.patch.object(common_cli.LOG, 'debug', mock.Mock())
@mock.patch.object(common_cli.LOG, 'info', mock.Mock())
self._conver_uuid2hex(DATA_IN_GROUP['id']))
self.DPL_MOCK.delete_vdev.assert_called_once_with(
self._conver_uuid2hex((DATA_IN_VOLUME_VG['id'])))
- self.assertDictMatch({'status': 'deleted'}, model_update, )
+ self.assertDictMatch({'status': 'deleted'}, model_update)
def test_update_consistencygroup(self):
self.DPL_MOCK.get_vg.return_value = (0, DATA_OUT_CG)
expected.update(dict(name='FakeName'))
del input['consumer']
expected.update(dict(specs=input))
- self.assertDictMatch(specs, expected)
+ self.assertDictMatch(expected, specs)
self.stubs.Set(db, 'qos_specs_create',
fake_db_qos_specs_create)
get_nameserver_info_mock.return_value = parsed_switch_port_wwns
device_map = self.get_device_mapping_from_network(
initiator_list, target_list)
- self.assertDictMatch(device_map, _device_map_to_verify)
+ self.assertDictMatch(_device_map_to_verify, device_map)
@mock.patch.object(brcd_lookup.BrcdFCSanLookupService, '_get_switch_data')
def test_get_nameserver_info(self, get_switch_data_mock):
get_switch_info_mock.return_value = cfgactvshow
active_zoneset_returned = self.get_active_zone_set()
get_switch_info_mock.assert_called_once_with(cmd_list)
- self.assertDictMatch(active_zoneset_returned, active_zoneset)
+ self.assertDictMatch(active_zoneset, active_zoneset_returned)
@mock.patch.object(client_cli.BrcdFCZoneClientCLI, '_run_ssh')
def test_get_active_zone_set_ssh_error(self, run_ssh_mock):
target_list = ['20240002ac000a50', '20240002ac000a40']
device_map = self.get_device_mapping_from_network(
initiator_list, target_list)
- self.assertDictMatch(device_map, _device_map_to_verify)
+ self.assertDictMatch(_device_map_to_verify, device_map)
def test_get_device_mapping_from_network_for_invalid_config(self):
GlobalParams._is_normal_test = False
get_nameserver_info_mock.return_value = (nsshow_data)
device_map = self.get_device_mapping_from_network(
initiator_list, target_list)
- self.assertDictMatch(device_map, _device_map_to_verify)
+ self.assertDictMatch(_device_map_to_verify, device_map)
@mock.patch.object(cisco_lookup.CiscoFCSanLookupService,
'_get_switch_info')
get_switch_info_mock.return_value = cfgactv
active_zoneset_returned = self.get_active_zone_set()
get_switch_info_mock.assert_called_once_with(cmd_list)
- self.assertDictMatch(active_zoneset_returned, active_zoneset)
+ self.assertDictMatch(active_zoneset, active_zoneset_returned)
@mock.patch.object(cli.CiscoFCZoneClientCLI, '_run_ssh')
def test_get_active_zone_set_ssh_error(self, run_ssh_mock):
get_zoning_status_mock.return_value = zoning_status_data_basic
zoning_status_returned = self.get_zoning_status()
get_zoning_status_mock.assert_called_once_with(cmd_list)
- self.assertDictMatch(zoning_status_returned, zoning_status_basic)
+ self.assertDictMatch(zoning_status_basic, zoning_status_returned)
@mock.patch.object(cli.CiscoFCZoneClientCLI, '_get_switch_info')
def test_get_zoning_status_enhanced_nosess(self, get_zoning_status_mock):
zoning_status_data_enhanced_nosess
zoning_status_returned = self.get_zoning_status()
get_zoning_status_mock.assert_called_once_with(cmd_list)
- self.assertDictMatch(zoning_status_returned,
- zoning_status_enhanced_nosess)
+ self.assertDictMatch(zoning_status_enhanced_nosess,
+ zoning_status_returned)
@mock.patch.object(cli.CiscoFCZoneClientCLI, '_get_switch_info')
def test_get_zoning_status_enhanced_sess(self, get_zoning_status_mock):
get_zoning_status_mock.return_value = zoning_status_data_enhanced_sess
zoning_status_returned = self.get_zoning_status()
get_zoning_status_mock.assert_called_once_with(cmd_list)
- self.assertDictMatch(zoning_status_returned,
- zoning_status_enhanced_sess)
+ self.assertDictMatch(zoning_status_enhanced_sess,
+ zoning_status_returned)
@mock.patch.object(cli.CiscoFCZoneClientCLI, '_get_switch_info')
def test_get_nameserver_info(self, get_switch_info_mock):
target_list = ['20240002ac000a50', '20240002ac000a40']
device_map = self.get_device_mapping_from_network(
initiator_list, target_list)
- self.assertDictMatch(device_map, _device_map_to_verify)
+ self.assertDictMatch(_device_map_to_verify, device_map)
def test_get_device_mapping_from_network_for_invalid_config(self):
GlobalParams._is_normal_test = False