From 6af58ad6655d7b9de0358e9a701081e7e6014c36 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 14 Oct 2024 16:27:22 +0200 Subject: [PATCH] containers/ws: Install our other Cockpit pages Kdump, Networking, SELinux, Storaged, and Software Updates are all fine and useful for beiboot mode. Apps doesn't, but that's hidden by the manifest condition. --- containers/ws/install.sh | 22 ++++++++++++++++------ test/ostree.install | 19 +++++++++++++------ test/verify/check-ws-bastion | 12 ++++++++++++ 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/containers/ws/install.sh b/containers/ws/install.sh index 768542dace8d..e46e08ac064a 100755 --- a/containers/ws/install.sh +++ b/containers/ws/install.sh @@ -6,6 +6,17 @@ OSVER=$(. /etc/os-release && echo "$VERSION_ID") INSTALLROOT=/build INSTALL="dnf install -y --installroot=$INSTALLROOT --releasever=$OSVER --setopt=install_weak_deps=False" +# keep in sync with test/ostree.install +PACKAGES=" +kdump +networkmanager +packagekit +selinux +sosreport +storaged +system +" + dnf install -y 'dnf-command(download)' cpio $INSTALL coreutils-single util-linux-core sed sscg python3 openssh-clients @@ -20,15 +31,14 @@ unpack() { # -system and -networkmanager are only for beibooting; don't install their dependencies if [ -n "$rpm" ]; then $INSTALL /container/rpms/cockpit-ws-*$OSVER.*$arch.rpm /container/rpms/cockpit-bridge-*$OSVER.*$arch.rpm - for rpm in /container/rpms/cockpit-system-*$OSVER.*$arch.rpm \ - /container/rpms/cockpit-networkmanager-*$OSVER.*$arch.rpm; do - unpack $rpm + for rpm in $PACKAGES; do + unpack /container/rpms/cockpit-$rpm-*$OSVER.*$arch.rpm done else $INSTALL cockpit-ws cockpit-bridge - dnf download cockpit-networkmanager cockpit-system - for rpm in cockpit-networkmanager*.rpm cockpit-system*.rpm; do - unpack $rpm + for rpm in $PACKAGES; do + dnf download cockpit-$rpm + unpack cockpit-$rpm-*.rpm done fi diff --git a/test/ostree.install b/test/ostree.install index 89ad443f1b9a..4f80c873ae14 100644 --- a/test/ostree.install +++ b/test/ostree.install @@ -1,6 +1,17 @@ #!/bin/sh set -eu +# keep in sync with containers/ws/install.sh +PACKAGES=" +kdump +networkmanager +packagekit +selinux +sosreport +storaged +system +" + cd /var/tmp/ # install/upgrade RPMs that apply to OSTree @@ -9,12 +20,8 @@ rpm-ostree install --cache-only cockpit-bridge-*.rpm \ cockpit-networkmanager-*.rpm cockpit-system-*.rpm cockpit-tests-*.rpm # update cockpit packages and install scripts in the container -for rpm in /var/tmp/cockpit-ws-*.rpm \ - /var/tmp/cockpit-bridge-*.rpm \ - /var/tmp/cockpit-networkmanager-*.rpm \ - /var/tmp/cockpit-system-*.rpm \ - /var/tmp/cockpit-tests-*.rpm; do - rpm2cpio "$rpm" | cpio -i --make-directories --directory=/var/tmp/install +for rpm in ws bridge tests $PACKAGES; do + rpm2cpio /var/tmp/cockpit-$rpm-*.rpm | cpio -i --make-directories --directory=/var/tmp/install done podman run --name build-cockpit -i \ -v /var/tmp/:/run/build:Z \ diff --git a/test/verify/check-ws-bastion b/test/verify/check-ws-bastion index 9de1e3bd7341..a7d8a2423b99 100755 --- a/test/verify/check-ws-bastion +++ b/test/verify/check-ws-bastion @@ -70,6 +70,10 @@ class TestWsBastionContainer(testlib.MachineCase): b.wait_visible('#content') b.wait_text('#current-username', 'admin') + # Our test VM only pre-installs -system and -networkmanager + b.wait_in_text("#host-apps", "Overview") + b.wait_in_text("#host-apps", "Networking") + self.assertNotIn("Kernel dump", b.text("#host-apps")) # runs the ssh target's bridge (no beiboot) m.execute("pgrep -f /usr/bin/[c]ockpit-bridge") b.logout() @@ -89,6 +93,14 @@ class TestWsBastionContainer(testlib.MachineCase): b.try_login() b.wait_visible('#content') m.execute("pgrep -f '[p]ython3 -ic # cockpit-bridge'") + # beiboot mode has extra included pages + b.wait_in_text("#host-apps", "Overview") + b.wait_in_text("#host-apps", "Networking") + b.wait_in_text("#host-apps", "Kernel dump") + b.wait_in_text("#host-apps", "SELinux") + # but Storage and Applications are hidden due to failing manifest conditions + self.assertNotIn("Storage", b.text("#host-apps")) + self.assertNotIn("Applications", b.text("#host-apps")) b.logout() def testKnownHosts(self):