Debian Codegraph @

debian/tests/smoke

raw
1 #!/bin/sh
2 set -e
3
4 trap 'if [ "$?" -ne 0 ]; then id cockpit-systemd-service || true; systemctl --all | grep cockpit; sudo journalctl -b; fi' EXIT
5
6 check_out() {
7 echo "$OUT" | grep -q "$1" || {
8 echo "output does not match '$1'" >&2
9 exit 1
10 }
11 }
12
13 echo " * bridge works and has expected packages"
14 OUT=$(cockpit-bridge --packages)
15 echo "$OUT"
16 check_out "^base1.* /usr/share/cockpit/base1"
17 check_out "^system"
18 check_out "^users"
19
20 # on an RPM based system we expect cockpit.socket not to be enabled by default;
21 # on a Debian-based system we do
22 if rpm -q cockpit >/dev/null 2>&1; then
23 systemctl start cockpit.socket
24 fi
25
26 # HACK: debian stable kernel+LXC (running on ci.d.n) breaks DynamicUser=
27 # https://bugs.debian.org/1073815
28 if uname -r | grep -q ^6.1 && systemd-detect-virt --container; then
29 echo "skipping socket test with LXC on Debian 12, https://bugs.debian.org/1073815"
30 exit 0
31 fi
32
33 echo " * socket unit is set up correctly, login page available"
34 OUT=$(curl --silent --show-error --insecure https://localhost:9090)
35 check_out "login-user-input.*User"
36 echo "smoke test passed"