From 73cebc9782594a1ccbfe969c61bf554e6fad8721 Mon Sep 17 00:00:00 2001 From: Sampat Ponnaganti Date: Wed, 5 May 2021 16:43:36 +0000 Subject: [PATCH] Fix test to prevent network leak Fix the test case such that the original network ID is used during the clean up of the network. Closes-Bug: #1927249 Change-Id: I82f3c5320c5b324167a8c22966e16828090ab4b7 --- neutron_tempest_plugin/api/test_ports_negative.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neutron_tempest_plugin/api/test_ports_negative.py b/neutron_tempest_plugin/api/test_ports_negative.py index e327c257..004feb94 100644 --- a/neutron_tempest_plugin/api/test_ports_negative.py +++ b/neutron_tempest_plugin/api/test_ports_negative.py @@ -54,10 +54,13 @@ class PortsNegativeTestJSON(base.BaseNetworkTest): @decorators.idempotent_id('7cf473ae-7ec8-4834-ae17-9ef6ec6b8a32') def test_add_port_with_nonexist_network_id(self): network = self.network + # Copy and restore net ID so the cleanup will delete correct net + original_network_id = network['id'] network['id'] = uuidutils.generate_uuid() self.assertRaises(lib_exc.NotFound, self.create_port, network) + network['id'] = original_network_id @decorators.attr(type='negative') @decorators.idempotent_id('cad2d349-25fa-490e-9675-cd2ea24164bc')