As the firewalld tests expect the libvirt "default" network, add cockpit-machines test dependency, which pulls in the libvirt stack. We will soon test the Machines page anyway.
71 lines
3.0 KiB
Bash
Executable File
71 lines
3.0 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eux
|
|
|
|
# from standard-test-source
|
|
SOURCE="$(pwd)/source"
|
|
LOGS="$(pwd)/logs"
|
|
mkdir -p "$LOGS"
|
|
chmod a+w "$LOGS"
|
|
# these get mounted into the tasks container
|
|
chcon -Rt container_file_t "$SOURCE" "$LOGS"
|
|
|
|
# create user account for logging in
|
|
if ! id admin 2>/dev/null; then
|
|
useradd -c Administrator -G wheel admin
|
|
echo admin:foobar | chpasswd
|
|
fi
|
|
|
|
# make sure that we can access cockpit through the firewall
|
|
systemctl start firewalld
|
|
firewall-cmd --add-service=cockpit --permanent
|
|
firewall-cmd --add-service=cockpit
|
|
|
|
# The cockpit/tests container has chromium-browser and other test
|
|
# dependencies, which we don't have on RHEL itself. Also, we don't actually
|
|
# want to install these on the tested image, so run the test in a container,
|
|
# which tests the host. Use a fixed tag to avoid running into failures with
|
|
# "latest", as we don't gate container updates on the dist-git tests for now.
|
|
RC=0
|
|
cat <<EOF | podman run --rm -i -v "$SOURCE:/source:ro" -v "$LOGS:/logs" docker.io/cockpit/tasks:2020-01-30 /bin/sh -eux || RC=$?
|
|
# CSP does not like the the invalid host name _gateway, so translate it
|
|
HOST=\$(getent hosts _gateway | cut -f1 -d' ')
|
|
|
|
trap "cp --verbose Test* /logs/ || true" EXIT
|
|
|
|
# tests need cockpit's bots/ libraries
|
|
cd /tmp
|
|
git clone --depth=1 https://github.com/cockpit-project/cockpit
|
|
cd cockpit
|
|
git clone --depth=1 https://github.com/cockpit-project/bots
|
|
# copy tests from our source, so that they match the released version
|
|
rm -rf test
|
|
cp -a /source/test .
|
|
|
|
# only install a subset to save time/space
|
|
npm install axe-core chrome-remote-interface sizzle
|
|
|
|
export TEST_OS=fedora-32
|
|
export TEST_AUDIT_NO_SELINUX=1
|
|
|
|
# FIXME: Test{Accounts,Login}.testBasic don't get along with the existing root session (https://github.com/cockpit-project/cockpit/pull/13773)
|
|
test/verify/check-accounts -tv --machine \$HOST:22 --browser \$HOST:9090 TestAccounts.{testRootLogin,testUnprivileged}
|
|
test/verify/check-login -tv --machine \$HOST:22 --browser \$HOST:9090 TestLogin.{testExpired,testSELinuxRestrictedUser}
|
|
# storage-lvm is buggy: https://github.com/cockpit-project/cockpit/pull/13777 and https://github.com/cockpit-project/cockpit/pull/13779
|
|
test/verify/check-storage-lvm2 -tv --machine \$HOST:22 --browser \$HOST:9090 TestStorage.testSnapshots
|
|
# TestFirewall.testNetworkingPage does not see libvirt zone, and testMultipleZones assumes eth1
|
|
test/verify/check-networking-firewall -tv --machine \$HOST:22 --browser \$HOST:9090 TestFirewall.{testAddCustomServices,testAddServices,testFirewallPage}
|
|
|
|
# check-menu is not @nondestructive yet, keep it last
|
|
for t in sosreport storage-basic storage-ignored storage-partitions storage-used menu; do
|
|
test/verify/check-\$t -tv --machine \$HOST:22 --browser \$HOST:9090
|
|
done
|
|
EOF
|
|
|
|
# reset system changes from verify tests, for running this multiple times in a row
|
|
# HACK: Isolate tests from each other: https://pagure.io/fedora-ci/general/issue/11
|
|
rm -f /etc/systemd/system/cockpit.service.d/notls.conf
|
|
systemctl daemon-reload
|
|
systemctl stop cockpit.service
|
|
|
|
exit $RC
|