Skip to content

Commit

Permalink
containers/ws: Install our other Cockpit pages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinpitt authored and mvollmer committed Oct 15, 2024
1 parent 724ded5 commit 6af58ad
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 12 deletions.
22 changes: 16 additions & 6 deletions containers/ws/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
19 changes: 13 additions & 6 deletions test/ostree.install
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand Down
12 changes: 12 additions & 0 deletions test/verify/check-ws-bastion
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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):
Expand Down

0 comments on commit 6af58ad

Please sign in to comment.