Skip to content

Commit 799fae5

Browse files
test: re-merge {ws-container → ostree}.install
This is a partial/"in spirit" revert of 64ec91c ("test: Split ostree and cockpit/ws install scripts"). This introduces a bunch of duplicate code (since it keeps the ws-container.install script as well) but the next commit will start modifying that code in a way that's not currently compatible with fedora-coreos. We'll fix that up in #22923.
1 parent 5b6f233 commit 799fae5

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

test/image-prepare

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ def build_install_ostree(dist_tars: list[str], image: str, *, verbose: bool, qui
154154
args += ["--upload", f"{rpm}:/var/tmp/"]
155155
args += [
156156
"--upload", os.path.join(BASE_DIR, "containers") + ":/var/tmp/",
157-
"--script", os.path.join(TEST_DIR, "ws-container.install"),
158157
"--script", os.path.join(TEST_DIR, "ostree.install"),
159158
"--upload", os.path.join(BASE_DIR, "dist/playground") + ":/usr/local/share/cockpit/"]
160159
return args

test/ostree.install

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,55 @@
22
# install/upgrade RPMs that apply to OSTree
33
set -eu
44

5+
# keep in sync with containers/ws/install.sh
6+
PACKAGES="
7+
kdump
8+
networkmanager
9+
packagekit
10+
selinux
11+
sosreport
12+
storaged
13+
system
14+
"
15+
516
cd /var/tmp/
617

18+
# install/upgrade RPMs that apply to OSTree
719
# Note: cockpit-selinux would be desirable, but needs setroubleshoot-server which isn't installed
820
rpm-ostree install --cache-only cockpit-bridge-*.rpm \
921
cockpit-networkmanager-*.rpm cockpit-system-*.rpm
1022

23+
# update cockpit packages and install scripts in the container
24+
for rpm in ws bridge $PACKAGES; do
25+
rpm2cpio /var/tmp/cockpit-$rpm-*.rpm | cpio -i --make-directories --directory=/var/tmp/install
26+
done
27+
28+
# Sometimes the actual quay.io/cockpit/ws Fedora version lags behind containers/ws/Containerfile, i.e. in between
29+
# moving the latter to a new Fedora version, and releasing Cockpit and landing it in Fedora. Then the Python version
30+
# in the rpms does not match the actual Python version in the container. So remove any traces of the old Python
31+
# deployment first, unpack the new rpms, and move our Python module into place.
32+
ws_pyver=$(podman run --rm --entrypoint /usr/bin/python3 quay.io/cockpit/ws -c \
33+
'import sys; print("%d.%d" % sys.version_info[:2])')
34+
ws_sitelib="/var/tmp/install/usr/lib/python${ws_pyver}"
35+
if ! [ -d "$ws_sitelib" ]; then
36+
echo "Adjusting Python module location to $ws_sitelib" >&2
37+
mv --verbose /var/tmp/install/usr/lib/python3.* "$ws_sitelib" >&2
38+
fi
39+
40+
podman run --name build-cockpit -i \
41+
-v /var/tmp/:/run/build:Z \
42+
quay.io/cockpit/ws sh -exc '
43+
cp -a /run/build/install/* /
44+
cp /run/build/containers/ws/label-* /run/build/containers/ws/default-bastion.conf /run/build/containers/ws/cockpit-auth-ssh-key /container/
45+
# done in containers/ws/install.sh; this can be removed once that change is in our VM images
46+
rm -f /usr/libexec/cockpit-session
47+
'
48+
podman commit --change CMD=/container/label-run build-cockpit localhost/cockpit/ws
49+
podman rm -f build-cockpit
50+
51+
# move original quay.io image away, to make sure that our tests use the updated one
52+
podman tag quay.io/cockpit/ws:latest quay.io/cockpit/original-ws:released
53+
podman rmi quay.io/cockpit/ws:latest
54+
1155
# run cockpit/ws once to generate certificate; avoids slow down on every start
1256
podman container runlabel INSTALL cockpit/ws

0 commit comments

Comments
 (0)