Skip to content

Commit

Permalink
test: Add ws-container scenario
Browse files Browse the repository at this point in the history
cockpit-files currently works fine on RHEL 8 with beibooting. Let's keep
it that way: Add a rhel-8.10/ws-container scenario that runs the tests
through our ws container.

Fixes #914
  • Loading branch information
martinpitt committed Jan 28, 2025
1 parent 841968b commit 9928627
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,17 @@ rpm: $(TARFILE) $(NODE_CACHE) $(SPEC)
rm -r "`pwd`/rpmbuild"
rm -r "`pwd`/output" "`pwd`/build"

ifeq ("$(TEST_SCENARIO)","ws-container")
VM_INSTALL = --upload $(TARFILE):/var/tmp/ --script $(CURDIR)/test/vm-ws.install
else
VM_INSTALL = --upload $(NODE_CACHE):/var/tmp/ --build $(TARFILE) --script $(CURDIR)/test/vm.install
endif

# build a VM with locally built distro pkgs installed
# disable networking, VM images have mock/pbuilder with the common build dependencies pre-installed
$(VM_IMAGE): export XZ_OPT=-0
$(VM_IMAGE): $(TARFILE) $(NODE_CACHE) packaging/arch/PKGBUILD bots test/vm.install
bots/image-customize --no-network --fresh \
$(VM_CUSTOMIZE_FLAGS) \
--upload $(NODE_CACHE):/var/tmp/ --build $(TARFILE) \
--script $(CURDIR)/test/vm.install $(TEST_OS)
$(VM_IMAGE): $(TARFILE) $(NODE_CACHE) packaging/arch/PKGBUILD bots test/vm.install test/vm-ws.install
bots/image-customize --no-network --fresh $(VM_CUSTOMIZE_FLAGS) $(VM_INSTALL) $(TEST_OS)

# convenience target for the above
vm: $(VM_IMAGE)
Expand Down
24 changes: 24 additions & 0 deletions test/vm-ws.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# image-customize script to prepare a bots VM for testing this application
# in TEST_SCENARIO=ws-container.
set -eux

# back up original ws image
podman tag quay.io/cockpit/ws:latest localhost/ws:released

# update ws container with our current code
cd /var/tmp
tar --strip-components=1 -xvf cockpit-files*.tar.* cockpit-files/dist

podman build -f - -t quay.io/cockpit/ws:latest . <<EOF
FROM quay.io/cockpit/ws
RUN rm -rf /usr/share/cockpit/files
COPY dist /usr/share/cockpit/files
EOF

# remove preinstalled rpms
dnf -C remove -y cockpit-bridge cockpit-ws

if systemctl is-active -q firewalld.service; then
firewall-cmd --add-service=cockpit --permanent
fi

0 comments on commit 9928627

Please sign in to comment.