From 72f4e27e2d08404dacf0f166d4a7645bfc6ed1a6 Mon Sep 17 00:00:00 2001 From: Pierre Libeau Date: Mon, 23 Jan 2023 09:30:30 +0100 Subject: [PATCH] Fix rally test can't update device_id In neutron-lib new default policy disallowed create_port and update_port with device_id parameter. This parameter is only for admin. Bug #1986969 Change-Id: Ie2b42192b0233c3c30f08d2ef79de754922f012d --- rally_openstack/task/scenarios/neutron/trunk.py | 2 -- tests/unit/task/scenarios/neutron/test_trunk.py | 3 --- 2 files changed, 5 deletions(-) diff --git a/rally_openstack/task/scenarios/neutron/trunk.py b/rally_openstack/task/scenarios/neutron/trunk.py index bf9d7038..0f8f5ac1 100644 --- a/rally_openstack/task/scenarios/neutron/trunk.py +++ b/rally_openstack/task/scenarios/neutron/trunk.py @@ -54,10 +54,8 @@ class CreateAndListTrunks(neutron_utils.NeutronScenario): trunk_payload = {"port_id": parent["port"]["id"], "sub_ports": subport_payload} trunk = self._create_trunk(trunk_payload) - self._update_port(parent, {"device_id": "sometrunk"}) self._list_trunks() self._list_subports_by_trunk(trunk["trunk"]["id"]) - self._list_ports_by_device_id("sometrunk") @types.convert(image={"type": "glance_image"}, diff --git a/tests/unit/task/scenarios/neutron/test_trunk.py b/tests/unit/task/scenarios/neutron/test_trunk.py index 1fd35005..b6900f05 100644 --- a/tests/unit/task/scenarios/neutron/test_trunk.py +++ b/tests/unit/task/scenarios/neutron/test_trunk.py @@ -31,7 +31,6 @@ class NeutronTrunkTestCase(test.ScenarioTestCase): scenario._create_trunk = mock.MagicMock() scenario._list_subports_by_trunk = mock.MagicMock() scenario._update_port = mock.Mock() - scenario._list_ports_by_device_id = mock.Mock() scenario.run(network_create_args=network_create_args, subport_count=subport_count) scenario._create_network.assert_called_once_with( @@ -40,9 +39,7 @@ class NeutronTrunkTestCase(test.ScenarioTestCase): [mock.call(net, {}) for _ in range(subport_count + 1)]) self.assertEqual(1, scenario._create_trunk.call_count) - self.assertEqual(1, scenario._update_port.call_count) self.assertEqual(1, scenario._list_subports_by_trunk.call_count) - self.assertEqual(1, scenario._list_ports_by_device_id.call_count) def test_boot_server_with_subports(self): img_name = "img"