#!/bin/sh set -eux cd "$SOURCE" . /etc/os-release test_optional= test_basic= if ls ../cockpit-appstream* 1> /dev/null 2>&1; then test_optional=1 else test_basic=1 fi if [ "$ID" = "fedora" ]; then test_basic=1 test_optional=1 fi # tests need cockpit's bots/ libraries git clone --depth=1 https://github.com/cockpit-project/bots # only install a subset to save time/space npm install axe-core chrome-remote-interface sizzle export TEST_OS="${ID}-${VERSION_ID/./-}" # HACK: upstream does not yet know about fedora rawhide if [ "$TEST_OS" = "fedora-33" ]; then export TEST_OS=fedora-32 fi # HACK: CI hits this selinux denial. Unrelated to our tests. export TEST_ALLOW_JOURNAL_MESSAGES=".*Permission denied: '/var/cache/app-info/xmls/beakerlib-libraries.xml'" # select tests TESTS="" RC=0 if [ -n "$test_optional" ]; then # pre-download cirros image for Machines tests bots/image-download cirros # some tests are still too unstable: testCreate,testNetworkSettings,testVmNICs # testAddDisk triggers SELinux violation TESTS="$TESTS TestMachines.test{Basic,VCPU,MultipleSettings,BootOrder,Libvirt} TestMachines.testDetachDisk TestMachines.test{InlineConsole,ExternalConsole,SerialConsole} TestMachines.test{StoragePools,StoragePoolsCreate,NICAdd}" # not all classes are nondestructive, and we can't run rebooting tests TESTS="$TESTS TestUpdates.test{Basic,SecurityOnly} TestAutoUpdates TestStorage" fi if [ -n "$test_basic" ]; then # TestFirewall.testNetworkingPage is still too unstable TESTS="$TESTS TestFirewall.test{AddCustomServices,AddServices,FirewallPage,MultipleZones}" # testExpired in RHEL 8 is a PAM bug -- it shouldn't pwquality the old password when having to set a new one, that's completely counter-productive and wrong if [ "${TEST_OS#rhel}" != "$TEST_OS" ]; then TESTS="$TESTS TestLogin.test{Basic,Conversation,FailingWebsocket,FailingWebsocketSafari,FailingWebsocketSafariNoCA,Logging,Raw,SELinuxRestrictedUser,SessionRecordingShell,UnsupportedBrowser}" else TESTS="$TESTS TestLogin" fi TESTS="$TESTS TestAccounts TestNetworking TestSOS" fi # HACK: use fixed run-tests for BlockingIOError, until version 222 gets packaged curl https://raw.githubusercontent.com/cockpit-project/cockpit/master/test/common/run-tests > test/common/run-tests chmod a+x test/common/run-tests # execute run-tests test/common/run-tests --test-dir test/verify --trace --verbose --nondestructive \ --machine localhost:22 --browser localhost:9090 $TESTS || RC=$? # check-menu is not @nondestructive yet, keep it last if [ -n "$test_basic" ]; then test/verify/check-menu -tv --machine localhost:22 --browser localhost:9090 || RC=$? fi echo $RC > "$LOGS/exitcode" cp --verbose Test* "$LOGS" || true # deliver test result via exitcode file exit 0