From 1b2bbb354460830e77dc46d9afbb2f984728c428 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Thu, 13 Apr 2017 08:14:58 +0300 Subject: [PATCH] Fix api-replay unittest teardown The api-replay unittests change the global resources attributes, causing other nsx-v3 tests to fail. This patch reverts those changes at teardown. Change-Id: I4f03ac558604cb82b8d0f3ea01fc884174ffb153 --- vmware_nsx/tests/unit/nsx_v3/test_api_replay.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vmware_nsx/tests/unit/nsx_v3/test_api_replay.py b/vmware_nsx/tests/unit/nsx_v3/test_api_replay.py index d6926422a4..36793c61f9 100644 --- a/vmware_nsx/tests/unit/nsx_v3/test_api_replay.py +++ b/vmware_nsx/tests/unit/nsx_v3/test_api_replay.py @@ -15,6 +15,7 @@ from vmware_nsx.tests.unit.nsx_v3 import test_plugin +from neutron.api.v2 import attributes from neutron_lib.plugins import directory from oslo_config import cfg @@ -35,6 +36,12 @@ class TestApiReplay(test_plugin.NsxV3PluginTestCaseMixin): directory.get_plugin().supported_extension_aliases.remove( 'api-replay') + # Revert the attributes map back to normal + for attr_name in ('ports', 'networks', 'security_groups', + 'security_group_rules', 'routers', 'policies'): + attr_info = attributes.RESOURCE_ATTRIBUTE_MAP[attr_name] + attr_info['id']['allow_post'] = False + super(TestApiReplay, self).tearDown() def test_create_port_specify_id(self):