2020-04-06 18:32:16 +00:00
#!/bin/sh
set -eux
2020-06-15 05:43:19 +00:00
cd " $SOURCE "
2020-05-15 11:37:09 +00:00
. /etc/os-release
2020-05-30 10:41:30 +00:00
test_optional =
test_basic =
2020-05-15 11:37:09 +00:00
2020-06-15 05:43:19 +00:00
if ls ../cockpit-appstream* 1> /dev/null 2>& 1; then
2020-05-15 11:37:09 +00:00
test_optional = 1
else
test_basic = 1
fi
if [ " $ID " = "fedora" ] ; then
test_basic = 1
test_optional = 1
fi
2020-04-06 18:32:16 +00:00
# tests need cockpit's bots/ libraries
git clone --depth= 1 https://github.com/cockpit-project/bots
2020-05-15 11:37:09 +00:00
2020-04-06 18:32:16 +00:00
# only install a subset to save time/space
npm install axe-core chrome-remote-interface sizzle
2020-04-27 16:09:06 +00:00
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
2020-04-06 18:32:16 +00:00
2020-06-14 20:48:42 +00:00
# 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'"
2020-04-06 18:32:16 +00:00
2020-05-28 16:34:54 +00:00
# select tests
TESTS = ""
RC = 0
2020-05-15 11:37:09 +00:00
if [ -n " $test_optional " ] ; then
2020-06-14 14:13:00 +00:00
# pre-download cirros image for Machines tests
bots/image-download cirros
2020-05-15 11:37:09 +00:00
# some tests are still too unstable: testCreate,testNetworkSettings,testVmNICs
# testAddDisk triggers SELinux violation
2020-05-28 16:34:54 +00:00
TESTS = " $TESTS
TestMachines.test{ Basic,VCPU,MultipleSettings,BootOrder,Libvirt}
TestMachines.testDetachDisk
TestMachines.test{ InlineConsole,ExternalConsole,SerialConsole}
TestMachines.test{ StoragePools,StoragePoolsCreate,NICAdd} "
2020-05-15 11:37:09 +00:00
# not all classes are nondestructive, and we can't run rebooting tests
2020-05-28 16:34:54 +00:00
TESTS = " $TESTS
TestUpdates.test{ Basic,SecurityOnly}
2020-06-14 14:13:00 +00:00
TestAutoUpdates
TestStorage"
2020-05-15 11:37:09 +00:00
fi
if [ -n " $test_basic " ] ; then
# TestFirewall.testNetworkingPage is still too unstable
2020-05-28 16:34:54 +00:00
TESTS = " $TESTS TestFirewall.test{AddCustomServices,AddServices,FirewallPage,MultipleZones} "
2020-06-15 07:35:27 +00:00
# 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
2020-05-28 16:34:54 +00:00
TESTS = " $TESTS
TestAccounts
TestNetworking
TestSOS"
fi
2020-06-15 05:48:30 +00:00
# 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
2020-05-28 16:34:54 +00:00
# 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 = $?
2020-05-15 11:37:09 +00:00
fi
2020-04-06 18:32:16 +00:00
2020-04-27 16:09:06 +00:00
echo $RC > " $LOGS /exitcode "
cp --verbose Test* " $LOGS " || true
# deliver test result via exitcode file
exit 0