2020-04-06 18:32:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -eux
|
|
|
|
|
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
|
|
|
|
|
|
|
if ls $(pwd)/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
|
|
|
|
|
2020-04-06 18:32:16 +00:00
|
|
|
# tests need cockpit's bots/ libraries
|
2020-04-27 16:09:06 +00:00
|
|
|
cd "$SOURCE"
|
2020-04-06 18:32:16 +00:00
|
|
|
git clone --depth=1 https://github.com/cockpit-project/bots
|
2020-05-15 11:37:09 +00:00
|
|
|
|
|
|
|
if [ -n "$test_optional" ]; then
|
|
|
|
# pre-download cirros image for Machines tests
|
|
|
|
bots/image-download cirros
|
|
|
|
fi
|
|
|
|
|
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-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
|
|
|
|
# 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}
|
|
|
|
TestAutoUpdates"
|
2020-05-15 11:37:09 +00:00
|
|
|
|
2020-05-28 16:34:54 +00:00
|
|
|
# FIXME: storage test classes are all called TestStorage, doesn't work with run-tests selection
|
2020-05-15 11:37:09 +00:00
|
|
|
for t in storage-basic \
|
|
|
|
storage-ignored \
|
|
|
|
storage-partitions \
|
2020-05-28 16:34:54 +00:00
|
|
|
storage-used \
|
|
|
|
storage-lvm2; do
|
2020-05-15 11:37:09 +00:00
|
|
|
test/verify/check-$t -tv --machine localhost:22 --browser localhost:9090 || RC=$?
|
|
|
|
done
|
|
|
|
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}"
|
|
|
|
|
|
|
|
TESTS="$TESTS
|
|
|
|
TestAccounts
|
|
|
|
TestLogin
|
|
|
|
TestNetworking
|
|
|
|
TestSOS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 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
|