Skip to content

Commit

Permalink
test: Apply pasta hack to scenarios as well
Browse files Browse the repository at this point in the history
Commit 9279fd4 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
  • Loading branch information
martinpitt authored and allisonkarlitskaya committed Mar 12, 2024
1 parent 9542fb2 commit 7920fbb
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7920fbb

Please sign in to comment.