Debian Codegraph @

tools/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 echo " * socket unit is set up correctly, login page available"
27 OUT=$(curl --silent --show-error --insecure https://localhost:9090)
28 check_out "login-user-input.*User"
29 echo "smoke test passed"