-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathbootc.setup
More file actions
executable file
·48 lines (37 loc) · 1.84 KB
/
Copy pathbootc.setup
File metadata and controls
executable file
·48 lines (37 loc) · 1.84 KB
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
#!/bin/sh
set -eux
IMAGE="$1"
# config.json cannot set GECOS
usermod -c Administrator admin
podman pull quay.io/cockpit/ws
podman pull quay.io/jitesoft/nginx
# for c-podman tests
/var/lib/testvm/podman-images.setup
# store our own OCI image into a local registry, for c-ostree tests
podman load < /var/cache/bootc.oci.tar
mkdir /var/lib/cockpit-test-registry
chcon -t container_file_t /var/lib/cockpit-test-registry/
podman run -d --rm --name ostree-registry -p 5000:5000 -v /var/lib/cockpit-test-registry:/var/lib/registry localhost/test-registry
mv /etc/containers/registries.conf /etc/containers/registries.conf.orig
printf '[registries.insecure]\nregistries = ["localhost:5000"]\n' > /etc/containers/registries.conf
podman tag localhost/bootc:latest localhost:5000/bootc:latest
podman push localhost:5000/bootc:latest
podman rmi localhost:5000/bootc:latest localhost/bootc:latest
podman rm -f -t0 ostree-registry
rm /var/cache/bootc.oci.tar
# Older RHEL releases need vsock support for test.thing
if [ "${IMAGE#rhel-9}" != "$IMAGE" ] || [ "${IMAGE#centos-9}" != "$IMAGE" ]; then
cp -va /var/lib/testvm/test.thing-workarounds/*.{socket,service} /etc/systemd/system
systemctl daemon-reload
systemctl enable tt-sshd-vsock.socket tt-sd_notify.service
checkmodule -M -m -o /tmp/sshd_vsock.mod /var/lib/testvm/test.thing-workarounds/sshd_vsock.te
semodule_package -m /tmp/sshd_vsock.mod -o /tmp/sshd_vsock.pp
semodule -i /tmp/sshd_vsock.pp
fi
# https://github.com/openssh/openssh-portable/pull/388
# https://github.com/openssh/openssh-portable/pull/593
echo 100::55:4e4b:4e4f:574e UNKNOWN | tee -a /etc/hosts
# disable various maintenance tasks which interfere with tests and don't make sense for our tests
systemctl disable bootc-fetch-apply-updates.timer fstrim.timer logrotate.timer raid-check.timer
# reduce image size
/var/lib/testvm/zero-disk.setup