From 7920fbbd587e8bdca213ec25e67f8878cc3b47a8 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 12 Mar 2024 07:04:14 +0100 Subject: [PATCH] test: Apply pasta hack to scenarios as well Commit 9279fd46f1c1a73 didn't apply the hack to the "updates-testing" and "podman-next" scenarios, as these *overwrite* `VM_CUSTOMIZE_FLAGS` to get rid of the `--offline`. Reorganize VM_CUSTOMIZE_FLAGS a bit to deal with `--no-network` in a cleaner way. Fixes #1611 --- Makefile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 6c3424f7d..422df63e0 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,22 @@ DIST_TEST=dist/manifest.json COCKPIT_REPO_STAMP=pkg/lib/cockpit-po-plugin.js # common arguments for tar, mostly to make the generated tarballs reproducible TAR_ARGS = --sort=name --mtime "@$(shell git show --no-patch --format='%at')" --mode=go=rX,u+rw,a-s --numeric-owner --owner=0 --group=0 -# default customize_flags -VM_CUSTOMIZE_FLAGS = --no-network + +VM_CUSTOMIZE_FLAGS = # HACK: https://github.com/containers/podman/issues/21896 VM_CUSTOMIZE_FLAGS += --run-command 'nmcli con add type dummy con-name fake ifname fake0 ip4 1.2.3.4/24 gw4 1.2.3.1 >&2' +# the following scenarios need network access +ifeq ("$(TEST_SCENARIO)","updates-testing") +VM_CUSTOMIZE_FLAGS += --run-command 'dnf -y update --setopt=install_weak_deps=False --enablerepo=updates-testing >&2' +else ifeq ("$(TEST_SCENARIO)","podman-next") +VM_CUSTOMIZE_FLAGS = --run-command 'dnf -y copr enable rhcontainerbot/podman-next >&2; dnf -y update --repo "copr*" >&2' +else +# default scenario does not install packages +VM_CUSTOMIZE_FLAGS += --no-network +endif + ifeq ($(TEST_COVERAGE),yes) RUN_TESTS_OPTIONS+=--coverage NODE_ENV=development @@ -157,14 +167,6 @@ rpm: $(TARFILE) find tmp/rpmbuild -name '*.rpm' -printf '%f\n' -exec mv {} . \; rm -r tmp/rpmbuild -ifeq ("$(TEST_SCENARIO)","updates-testing") -VM_CUSTOMIZE_FLAGS = --run-command 'dnf -y update --setopt=install_weak_deps=False --enablerepo=updates-testing >&2' -endif - -ifeq ("$(TEST_SCENARIO)","podman-next") -VM_CUSTOMIZE_FLAGS = --run-command 'dnf -y copr enable rhcontainerbot/podman-next >&2; dnf -y update --repo "copr*" >&2' -endif - # build a VM with locally built distro pkgs installed $(VM_IMAGE): $(TARFILE) packaging/debian/rules packaging/debian/control packaging/arch/PKGBUILD bots # HACK for ostree images: skip the rpm build/install