From 8e216b4913e8b842cab983c100165949bed7def2 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 23 Feb 2021 18:59:07 -0800 Subject: [PATCH] Make functional tests set node_staging_uri Currently it is not possible to configure the staging directory URI of the functional workers. We need to be able to do that in order to enable the stage cleaning behavior. Right now, they're all sharing /tmp/staging, which will cause workers to conflict while running in parallel. This causes them to use their private test directory, which may also help some other spurious failures due to interaction. Related-Bug: #1913625 Change-Id: Ic2ac2a528206c50c38e948a096daf9eb8e5eb715 (cherry picked from commit e9852fb6251c655f0e384c6b0b8677bd556f17a1) --- glance/tests/functional/__init__.py | 4 ++++ glance/tests/functional/v2/test_images.py | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/glance/tests/functional/__init__.py b/glance/tests/functional/__init__.py index 90ffb5b39a..3f8896ff6a 100644 --- a/glance/tests/functional/__init__.py +++ b/glance/tests/functional/__init__.py @@ -424,6 +424,9 @@ class ApiServer(Server): self.send_identity_headers = False + self.node_staging_uri = 'file://%s' % os.path.join( + self.test_dir, 'staging') + self.conf_base = """[DEFAULT] debug = %(debug)s default_log_levels = eventlet.wsgi.server=DEBUG,stevedore.extension=INFO @@ -453,6 +456,7 @@ image_tag_quota=%(image_tag_quota)s image_location_quota=%(image_location_quota)s location_strategy=%(location_strategy)s allow_additional_image_properties = True +node_staging_uri=%(node_staging_uri)s [oslo_policy] policy_file = %(policy_file)s policy_default_rule = %(policy_default_rule)s diff --git a/glance/tests/functional/v2/test_images.py b/glance/tests/functional/v2/test_images.py index c9a6826a31..0bc0c0a107 100644 --- a/glance/tests/functional/v2/test_images.py +++ b/glance/tests/functional/v2/test_images.py @@ -235,7 +235,6 @@ class TestImages(functional.FunctionalTest): self.stop_servers() def test_image_import_using_web_download(self): - self.config(node_staging_uri="file:///tmp/staging/") self.start_servers(**self.__dict__.copy()) # Image list should be empty @@ -4817,7 +4816,6 @@ class TestImagesMultipleBackend(functional.MultipleBackendFunctionalTest): self.stop_servers() def test_image_import_using_web_download(self): - self.config(node_staging_uri="file:///tmp/staging/") self.start_servers(**self.__dict__.copy()) # Image list should be empty @@ -4980,7 +4978,6 @@ class TestImagesMultipleBackend(functional.MultipleBackendFunctionalTest): self.stop_servers() def test_image_import_using_web_download_different_backend(self): - self.config(node_staging_uri="file:///tmp/staging/") self.start_servers(**self.__dict__.copy()) # Image list should be empty @@ -5144,7 +5141,6 @@ class TestImagesMultipleBackend(functional.MultipleBackendFunctionalTest): self.stop_servers() def test_image_import_multi_stores(self): - self.config(node_staging_uri="file:///tmp/staging/") self.start_servers(**self.__dict__.copy()) # Image list should be empty @@ -5759,7 +5755,6 @@ class TestImagesMultipleBackend(functional.MultipleBackendFunctionalTest): self.stop_servers() def test_image_import_multi_stores_specifying_all_stores(self): - self.config(node_staging_uri="file:///tmp/staging/") self.start_servers(**self.__dict__.copy()) # Image list should be empty