CI: test composefs on rawhide

Run root e2e & system tests using composefs on rawhide.

Write magic settings to storage.conf. That part is easy.

e2e tests, however, ignore storage.conf. They require everything
to be specified on the command line. And "everything", in the
case of composefs, includes a long complicated --pull-options
string which in turn requires containers-storage PR 1966
which, as of this writing, is finally vendored into podman.

Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
Ed Santiago
2024-04-18 09:14:49 -06:00
parent d5eb3c5b37
commit d4c0e7ecbd
12 changed files with 105 additions and 41 deletions

View File

@@ -266,11 +266,6 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
}
}
storageOptions := os.Getenv("STORAGE_OPTIONS")
if storageOptions == "" {
storageOptions = STORAGE_OPTIONS
}
cgroupManager := os.Getenv("CGROUP_MANAGER")
if cgroupManager == "" {
cgroupManager = CGROUP_MANAGER
@@ -313,9 +308,17 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
if isRootless() {
storageFs = ROOTLESS_STORAGE_FS
}
storageOptions := STORAGE_OPTIONS
if os.Getenv("STORAGE_FS") != "" {
storageFs = os.Getenv("STORAGE_FS")
storageOptions = "--storage-driver " + storageFs
// Look for STORAGE_OPTIONS_OVERLAY / STORAGE_OPTIONS_VFS
extraOptions := os.Getenv("STORAGE_OPTIONS_" + strings.ToUpper(storageFs))
if extraOptions != "" {
storageOptions += " --storage-opt " + extraOptions
}
}
p := &PodmanTestIntegration{

View File

@@ -1,15 +1,14 @@
package integration
var (
STORAGE_FS = "overlay" //nolint:revive,stylecheck
STORAGE_OPTIONS = "--storage-driver overlay" //nolint:revive,stylecheck
ROOTLESS_STORAGE_FS = "overlay" //nolint:revive,stylecheck
ROOTLESS_STORAGE_OPTIONS = "--storage-driver overlay" //nolint:revive,stylecheck
CACHE_IMAGES = []string{ALPINE, BB, NGINX_IMAGE, REDIS_IMAGE, REGISTRY_IMAGE, INFRA_IMAGE, CITEST_IMAGE, HEALTHCHECK_IMAGE, SYSTEMD_IMAGE} //nolint:revive,stylecheck
NGINX_IMAGE = "quay.io/libpod/alpine_nginx:latest" //nolint:revive,stylecheck
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
REGISTRY_IMAGE = "quay.io/libpod/registry:2.8.2" //nolint:revive,stylecheck
CITEST_IMAGE = "quay.io/libpod/testimage:20240123" //nolint:revive,stylecheck
SYSTEMD_IMAGE = "quay.io/libpod/systemd-image:20240124" //nolint:revive,stylecheck
CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck
STORAGE_FS = "overlay" //nolint:revive,stylecheck
STORAGE_OPTIONS = "--storage-driver overlay" //nolint:revive,stylecheck
ROOTLESS_STORAGE_FS = "overlay" //nolint:revive,stylecheck
CACHE_IMAGES = []string{ALPINE, BB, NGINX_IMAGE, REDIS_IMAGE, REGISTRY_IMAGE, INFRA_IMAGE, CITEST_IMAGE, HEALTHCHECK_IMAGE, SYSTEMD_IMAGE} //nolint:revive,stylecheck
NGINX_IMAGE = "quay.io/libpod/alpine_nginx:latest" //nolint:revive,stylecheck
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
REGISTRY_IMAGE = "quay.io/libpod/registry:2.8.2" //nolint:revive,stylecheck
CITEST_IMAGE = "quay.io/libpod/testimage:20240123" //nolint:revive,stylecheck
SYSTEMD_IMAGE = "quay.io/libpod/systemd-image:20240124" //nolint:revive,stylecheck
CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck
)

View File

@@ -1,15 +1,14 @@
package integration
var (
STORAGE_FS = "overlay" //nolint:revive,stylecheck
STORAGE_OPTIONS = "--storage-driver overlay" //nolint:revive,stylecheck
ROOTLESS_STORAGE_FS = "overlay" //nolint:revive,stylecheck
ROOTLESS_STORAGE_OPTIONS = "--storage-driver overlay" //nolint:revive,stylecheck
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, REGISTRY_IMAGE, INFRA_IMAGE, CITEST_IMAGE, HEALTHCHECK_IMAGE, SYSTEMD_IMAGE} //nolint:revive,stylecheck
NGINX_IMAGE = "quay.io/lsm5/alpine_nginx-aarch64:latest" //nolint:revive,stylecheck
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
REGISTRY_IMAGE = "quay.io/libpod/registry:2.8.2" //nolint:revive,stylecheck
CITEST_IMAGE = "quay.io/libpod/testimage:20240123" //nolint:revive,stylecheck
SYSTEMD_IMAGE = "quay.io/libpod/systemd-image:20240124" //nolint:revive,stylecheck
CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck
STORAGE_FS = "overlay" //nolint:revive,stylecheck
STORAGE_OPTIONS = "--storage-driver overlay" //nolint:revive,stylecheck
ROOTLESS_STORAGE_FS = "overlay" //nolint:revive,stylecheck
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, REGISTRY_IMAGE, INFRA_IMAGE, CITEST_IMAGE, HEALTHCHECK_IMAGE, SYSTEMD_IMAGE} //nolint:revive,stylecheck
NGINX_IMAGE = "quay.io/lsm5/alpine_nginx-aarch64:latest" //nolint:revive,stylecheck
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
REGISTRY_IMAGE = "quay.io/libpod/registry:2.8.2" //nolint:revive,stylecheck
CITEST_IMAGE = "quay.io/libpod/testimage:20240123" //nolint:revive,stylecheck
SYSTEMD_IMAGE = "quay.io/libpod/systemd-image:20240124" //nolint:revive,stylecheck
CIRROS_IMAGE = "quay.io/libpod/cirros:latest" //nolint:revive,stylecheck
)

View File

@@ -1,13 +1,12 @@
package integration
var (
STORAGE_FS = "overlay"
STORAGE_OPTIONS = "--storage-driver overlay"
ROOTLESS_STORAGE_FS = "overlay"
ROOTLESS_STORAGE_OPTIONS = "--storage-driver overlay"
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, INFRA_IMAGE, CITEST_IMAGE}
NGINX_IMAGE = "quay.io/libpod/alpine_nginx-ppc64le:latest"
BB_GLIBC = "docker.io/ppc64le/busybox:glibc"
CITEST_IMAGE = "quay.io/libpod/testimage:20240123"
REGISTRY_IMAGE string
STORAGE_FS = "overlay"
STORAGE_OPTIONS = "--storage-driver overlay"
ROOTLESS_STORAGE_FS = "overlay"
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, INFRA_IMAGE, CITEST_IMAGE}
NGINX_IMAGE = "quay.io/libpod/alpine_nginx-ppc64le:latest"
BB_GLIBC = "docker.io/ppc64le/busybox:glibc"
CITEST_IMAGE = "quay.io/libpod/testimage:20240123"
REGISTRY_IMAGE string
)

View File

@@ -240,6 +240,18 @@ var _ = Describe("Podman Info", func() {
session.WaitWithDefaultTimeout()
Expect(session).To(ExitCleanly())
Expect(session.OutputToString()).To(Equal(want), ".Store.GraphDriverName from podman info")
// Confirm desired setting of composefs
if want == "overlay" {
expect := "<no value>"
if os.Getenv("CI_DESIRED_COMPOSEFS") != "" {
expect = "true"
}
session = podmanTest.Podman([]string{"info", "--format", `{{index .Store.GraphOptions "overlay.use_composefs"}}`})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitCleanly())
Expect(session.OutputToString()).To(Equal(expect), ".Store.GraphOptions -> overlay.use_composefs")
}
})
It("Podman info: check lock count", Serial, func() {

View File

@@ -124,6 +124,16 @@ host.slirp4netns.executable | $expr_path
fi
is "$(podman_storage_driver)" "$CI_DESIRED_STORAGE" "podman storage driver is not CI_DESIRED_STORAGE (from .cirrus.yml)"
# Confirm desired setting of composefs
if [[ "$CI_DESIRED_STORAGE" = "overlay" ]]; then
expect="<no value>"
if [[ -n "$CI_DESIRED_COMPOSEFS" ]]; then
expect="true"
fi
run_podman info --format '{{index .Store.GraphOptions "overlay.use_composefs"}}'
assert "$output" = "$expect" ".Store.GraphOptions -> overlay.use_composefs"
fi
}
# 2021-04-06 discussed in watercooler: RHEL must never use crun, even if

View File

@@ -360,6 +360,12 @@ driver="$storagedriver"
additionalimagestores = [ "$imstore/root" ]
EOF
# If composefs (root only) is enabled, we must mirror that setting in our conf
if grep -q 'BEGIN CI-enabled composefs' /etc/containers/storage.conf; then
sed -ne '/BEGIN CI-enabled composefs/,/END CI-enabled composefs/p' /etc/containers/storage.conf \
| grep -vF '[storage.options]' >>$sconf
fi
skopeo copy containers-storage:$IMAGE \
containers-storage:\[${storagedriver}@${imstore}/root+${imstore}/runroot\]$IMAGE