Merge "Revert "Skip test_qos_min_bw_allocation_basic when not supported""
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index add5c32..cbe8c20 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -329,13 +329,16 @@
floating_ip, server = self.floating_ip_tuple
# get internal ports' ips:
# get all network and compute ports in the new network
+ # NOTE(ralonsoh): device_owner="network:distributed" ports are OVN
+ # metadata ports and should be filtered out.
internal_ips = (
p['fixed_ips'][0]['ip_address'] for p in
self.os_admin.ports_client.list_ports(
project_id=server['tenant_id'],
network_id=network['id'])['ports']
- if p['device_owner'].startswith('network') or
- p['device_owner'].startswith('compute')
+ if ((p['device_owner'].startswith('network') and
+ not p['device_owner'] == 'network:distributed') or
+ p['device_owner'].startswith('compute'))
)
self._check_server_connectivity(floating_ip,
diff --git a/tempest/tests/lib/cmd/test_check_uuid.py b/tempest/tests/lib/cmd/test_check_uuid.py
index 403de38..edfb2c8 100644
--- a/tempest/tests/lib/cmd/test_check_uuid.py
+++ b/tempest/tests/lib/cmd/test_check_uuid.py
@@ -28,37 +28,33 @@
" def test_tests(self):\n" \
" pass"
- def create_tests_file(self, directory):
- init_file = open(directory + "/__init__.py", "w")
+ def setUp(self):
+ super(TestCLInterface, self).setUp()
+ self.directory = tempfile.mkdtemp(prefix='check-uuid', dir=".")
+ self.addCleanup(shutil.rmtree, self.directory, ignore_errors=True)
+
+ init_file = open(self.directory + "/__init__.py", "w")
init_file.close()
- tests_file = directory + "/tests.py"
- with open(tests_file, "w") as fake_file:
+ self.tests_file = self.directory + "/tests.py"
+ with open(self.tests_file, "w") as fake_file:
fake_file.write(TestCLInterface.CODE)
fake_file.close()
- return tests_file
-
def test_fix_argument_no(self):
- temp_dir = tempfile.mkdtemp(prefix='check-uuid-no', dir=".")
- self.addCleanup(shutil.rmtree, temp_dir, ignore_errors=True)
- tests_file = self.create_tests_file(temp_dir)
sys.argv = [sys.argv[0]] + ["--package",
- os.path.relpath(temp_dir)]
+ os.path.relpath(self.directory)]
self.assertRaises(SystemExit, check_uuid.run)
- with open(tests_file, "r") as f:
+ with open(self.tests_file, "r") as f:
self.assertTrue(TestCLInterface.CODE == f.read())
def test_fix_argument_yes(self):
- temp_dir = tempfile.mkdtemp(prefix='check-uuid-yes', dir=".")
- self.addCleanup(shutil.rmtree, temp_dir, ignore_errors=True)
- tests_file = self.create_tests_file(temp_dir)
sys.argv = [sys.argv[0]] + ["--fix", "--package",
- os.path.relpath(temp_dir)]
+ os.path.relpath(self.directory)]
check_uuid.run()
- with open(tests_file, "r") as f:
+ with open(self.tests_file, "r") as f:
self.assertTrue(TestCLInterface.CODE != f.read())