From 7ae3e0bc63be6e0efaf793d51c14e4d62680085c Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Sat, 25 Oct 2025 18:52:57 -0400 Subject: [PATCH 1/3] Recreate hack/test-system.sh `hack/test-system.sh` earlier removed in commit 7e235ea contained a storage.conf setup useful for running system tests in skopeo_cidev container. Getting rid of that also broke `make test-system` because the systemtest: `copy: additional tag` started to break. Running `make test-system-local` isn't ideal for local environments due to creation of system-global containers with predictable names. See: https://github.com/containers/skopeo/issues/2701#issuecomment-3415769846 So, this commit resurrects hack/test-system.sh. Followup commit will modify Makefile targets to use this script again. Signed-off-by: Lokesh Mandvekar --- hack/test-system.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 hack/test-system.sh diff --git a/hack/test-system.sh b/hack/test-system.sh new file mode 100755 index 0000000000..f80737557f --- /dev/null +++ b/hack/test-system.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e + +# These tests can run in/outside of a container. However, +# not all storage drivers are supported in a container +# environment. Detect this and setup storage when +# running in a container. +# +# Paradoxically (FIXME: clean this up), SKOPEO_CONTAINER_TESTS is set +# both inside a container and without a container (in a CI VM); it actually means +# "it is safe to destructively modify the system for tests". +# +# On a CI VM, we can just use Podman as it is already configured; the changes below, +# to use VFS, are necessary only inside a container, because overlay-inside-overlay +# does not work. So, make these changes conditional on both +# SKOPEO_CONTAINER_TESTS (for acceptability to do destructive modification) and !CI +# (for necessity to adjust for in-container operation) +if ((SKOPEO_CONTAINER_TESTS)) && [[ "$CI" != true ]]; then + if [[ -r /etc/containers/storage.conf ]]; then + echo "MODIFYING existing storage.conf" + sed -i \ + -e 's/^driver\s*=.*/driver = "vfs"/' \ + -e 's/^mountopt/#mountopt/' \ + /etc/containers/storage.conf + else + echo "CREATING NEW storage.conf" + cat >> /etc/containers/storage.conf << EOF +[storage] +driver = "vfs" +runroot = "/run/containers/storage" +graphroot = "/var/lib/containers/storage" +EOF + fi + # The logic of finding the relevant storage.conf file is convoluted + # and in effect differs between Skopeo and Podman, at least in some versions; + # explicitly point at the file we want to use to hopefully avoid that. + export CONTAINERS_STORAGE_CONF=/etc/containers/storage.conf +fi + +SKOPEO_BINARY="$SKOPEO_BINARY" bats --tap systemtest From 85a14032ccb3b15b6387efcb5559defdc6d165c0 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Sat, 25 Oct 2025 17:03:55 -0400 Subject: [PATCH 2/3] Makefile: use hack/test-system.sh for test-system-local MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will ensure both `test-system` and `test-system-local` work. The `test-system` target will use the skopeo binary at `./bin/skopeo`. Setting SKOPEO_BINARY should have no effect on it. The `test-system-local` (and `test-integration-local`) target can use SKOPEO_BINARY at any location. This will be useful in CI where we need to test skopeo installed by the package at /usr/bin. Co-authored-by: Miloslav Trmač Signed-off-by: Lokesh Mandvekar --- Makefile | 6 +++++- hack/test-system.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6a1a3e6c14..b76e7b34bb 100644 --- a/Makefile +++ b/Makefile @@ -202,6 +202,10 @@ test-integration: # Helper target to set up SKOPEO_BINARY variable for local test targets +# SKOPEO_BINARY only takes effect on `test-integration-local` and +# `test-system-local` targets. It's not propagated into the container used for `test-integration` and +# `test-system`. These targets will (build and) use skopeo binary at +# ./bin/skopeo. .eval-skopeo-binary: $(if $(SKOPEO_BINARY),,bin/skopeo) $(eval SKOPEO_BINARY := $(or $(SKOPEO_BINARY),./bin/skopeo)) @echo "Testing with $(SKOPEO_BINARY) ..." @@ -226,7 +230,7 @@ test-system: # Primarily intended for CI. test-system-local: .eval-skopeo-binary hack/warn-destructive-tests.sh - bats --tap systemtest + hack/test-system.sh test-unit: # Just call (make test unit-local) here instead of worrying about environment differences diff --git a/hack/test-system.sh b/hack/test-system.sh index f80737557f..4be68e786a 100755 --- a/hack/test-system.sh +++ b/hack/test-system.sh @@ -37,4 +37,4 @@ EOF export CONTAINERS_STORAGE_CONF=/etc/containers/storage.conf fi -SKOPEO_BINARY="$SKOPEO_BINARY" bats --tap systemtest +bats --tap systemtest From 8181f14eaa4be9975e91c0fff8e9cfe3d91defdc Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Sat, 25 Oct 2025 17:33:10 -0400 Subject: [PATCH 3/3] Makefile: remove stale target Old cruft. Isn't even expected to work. Not used anywhere. Signed-off-by: Lokesh Mandvekar --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index b76e7b34bb..8d70c2c418 100644 --- a/Makefile +++ b/Makefile @@ -269,8 +269,3 @@ vendor: vendor-in-container: podman run --privileged --rm --env HOME=/root -v $(CURDIR):/src -w /src golang $(MAKE) vendor - -# CAUTION: This is not a replacement for RPMs provided by your distro. -# Only intended to build and test the latest unreleased changes. -rpm: - rpkg local