diff --git a/.cirrus.yml b/.cirrus.yml index cb45ef9d72..25201af5cb 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -558,7 +558,7 @@ apiv2_test_task: $CIRRUS_PR == '' || $CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' || changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') || - changesInclude('test/apiv2/**') || + changesInclude('test/apiv2/**', 'test/python/**') || (changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**')) depends_on: *build gce_instance: *standardvm diff --git a/test/python/docker/__init__.py b/test/python/docker/__init__.py index d46f465f79..78ff5c3725 100644 --- a/test/python/docker/__init__.py +++ b/test/python/docker/__init__.py @@ -44,17 +44,27 @@ class PodmanAPI: os.environ["CONTAINERS_REGISTRIES_CONF"] = os.path.join( self.anchor_directory, "registry.conf" ) - conf = """unqualified-search-registries = ["docker.io", "quay.io"] -[[registry]] -location="localhost:5000" -insecure=true + # Entry verified by compat/test_system.py + reg_conf_sfx = """ [[registry.mirror]] location = "mirror.localhost:5000" """ + # Assume developer-mode testing by default + reg_conf_source_path="./test/registries.conf" + + # When operating in a CI environment, use the local registry server. + # Ref: https://github.com/containers/automation_images/pull/357 + # https://github.com/containers/podman/pull/22726 + if os.getenv("CI_USE_REGISTRY_CACHE"): + reg_conf_source_path = "./test/registries-cached.conf" + + with open(os.path.join(reg_conf_source_path)) as file: + conf = file.read() + reg_conf_sfx + with open(os.environ["CONTAINERS_REGISTRIES_CONF"], "w") as file: file.write(conf)