-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathostree.setup
executable file
·52 lines (39 loc) · 1.96 KB
/
ostree.setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
set -eux
IMAGE="$1"
podman pull quay.io/cockpit/ws
# HACK: latest is broken: https://gitlab.com/jitesoft/dockerfiles/nginx/-/issues/2
podman pull quay.io/jitesoft/nginx:stable
# the tests don't specify a tag, so re-tag stable
podman tag quay.io/jitesoft/nginx:stable quay.io/jitesoft/nginx:latest
# for c-podman tests
/var/lib/testvm/podman-images.setup
# Prevent SSH from hanging for a long time when no external network access
echo 'UseDNS no' >> /etc/ssh/sshd_config.d/10-no-usedns.conf
# disable ens15 to avoid long boot hang on NetworkManager-wait-online.service
nmcli con add con-name "ens15" ifname ens15 type ethernet ipv4.method disabled ipv6.method ignore
if [ "$IMAGE" == "fedora-coreos" ]; then
# disable automatic updates
systemctl disable --now zincati.service
# pre-install the distro version, which is useful for testing extensions and manual experiments
# also install glib-networking, so that tests can install cockpit-ws (as long as it has that dependency)
rpm-ostree install cockpit-system cockpit-bridge cockpit-networkmanager glib-networking
fi
# Wait for all systemd jobs to finish before cleaning up. In
# particular, this will allow kdump.service to finish creating the
# kdump initramfs.
while [ -n "$(systemctl list-jobs --legend=no)" ]; do
sleep 10
done
# Installing RPMs in a OSTree image sometimes triggers something that
# will change the mtime of all of /etc on the next boot. This in turn
# will trigger a regeneration of the kdump initrd. This would happen
# in each test run, which is wasteful and also might interfere with
# the test itself. Let's just switch the automatic regeneration off.
! test -e /etc/kdump.conf || echo "force_no_rebuild 1" >>/etc/kdump.conf
# Disable PerSourcePenalties, they interfere with the rapid failed
# logins performed by some tests.
echo "PerSourcePenalties no" >/etc/ssh/sshd_config.d/99-no-penalties.conf
# reduce image size
rpm-ostree cleanup --repomd
/var/lib/testvm/zero-disk.setup