From 0e8fcab930e1922833bfc4cfeeb45bf2da540070 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Tue, 23 May 2023 09:40:54 +0200 Subject: [PATCH] Skip test_list_all_networks if no known network configured If test_list_all_networks is run in an env without networks configured then it will fail as it tries to assert that the list of networks are not empty but actually it is empty. So this PR skip the test if no known network is configured. Note that the test API here is deprecated since Newton. So I did the minimal effort to stabilize this test. Change-Id: I5e0bc22da5281dec0e4679fcc3891f9c2e7cb770 --- tempest/api/compute/admin/test_networks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py index fb6376e313..d7fb62d099 100644 --- a/tempest/api/compute/admin/test_networks.py +++ b/tempest/api/compute/admin/test_networks.py @@ -64,5 +64,5 @@ class NetworksTest(base.BaseV2ComputeAdminTest): configured_network = CONF.compute.fixed_network_name self.assertIn(configured_network, [x['label'] for x in networks]) else: - network_labels = [x['label'] for x in networks] - self.assertNotEmpty(network_labels) + raise self.skipException( + "Environment has no known-for-sure existing network.")