| 1 | #!/bin/shscip-shell filesystem . . `/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_outscip-shell shell shell-project 0.0.0 check_out().() { |
| 7 | echoscip-shell system . . echo. "$OUT" | grepscip-shell system . . grep. -q "$1" || { |
| 8 | echoscip-shell system . . echo. "output does not match '$1'" >&2 |
| 9 | exit 1 |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | echoscip-shell system . . echo. " * bridge works and has expected packages" |
| 14 | OUT=$(cockpit-bridge --packages) |
| 15 | echoscip-shell system . . echo. "$OUT" |
| 16 | check_outscip-shell shell shell-project 0.0.0 check_out(). "^base1.* /usr/share/cockpit/base1" |
| 17 | check_outscip-shell shell shell-project 0.0.0 check_out(). "^system" |
| 18 | check_outscip-shell shell shell-project 0.0.0 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/nullscip-shell filesystem . . `/dev/null`. 2>&1; then |
| 23 | systemctl start cockpit.socket |
| 24 | fi |
| 25 | |
| 26 | echoscip-shell system . . echo. " * socket unit is set up correctly, login page available" |
| 27 | OUT=$(curlscip-shell system . . curl. --silent --show-error --insecure https://localhost:9090) |
| 28 | check_outscip-shell shell shell-project 0.0.0 check_out(). "login-user-input.*User" |
| 29 | echoscip-shell system . . echo. "smoke test passed" |