tests: Use run-tests --exclude option

This is simpler, more robust, and fixes the silently skipped tests as
the `{}` did not get expanded by the shell any more.
This commit is contained in:
Martin Pitt 2020-06-15 10:33:34 +02:00
parent 029dfa3410
commit 1c54526baf

View File

@ -35,51 +35,58 @@ export TEST_ALLOW_JOURNAL_MESSAGES=".*Permission denied: '/var/cache/app-info/xm
# select tests
TESTS=""
EXCLUDES=""
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}"
# still too unstable
EXCLUDES="$EXCLUDES
TestMachines.testCreate
TestMachines.testNetworkSettings
TestMachines.testVmNICs"
# not all classes are nondestructive, and we can't run rebooting tests
# triggers SELinux violation
EXCLUDES="$EXCLUDES TestMachines.testAddDisk"
# TestUpdates: we can't run rebooting tests
TESTS="$TESTS
TestUpdates.test{Basic,SecurityOnly}
TestAutoUpdates
TestStorage"
TestMachines
TestStorage
TestUpdates.testBasic
TestUpdates.testSecurityOnly"
fi
if [ -n "$test_basic" ]; then
# TestFirewall.testNetworkingPage is still too unstable
TESTS="$TESTS TestFirewall.test{AddCustomServices,AddServices,FirewallPage,MultipleZones}"
# still too unstable
EXCLUDES="$EXCLUDES TestFirewall.testNetworkingPage"
# 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
# PAM bug in RHEL 8: 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"
EXCLUDES="$EXCLUDES TestLogin.testExpired"
fi
TESTS="$TESTS
TestAccounts
TestFirewall
TestLogin
TestNetworking
TestSOS"
fi
# HACK: use fixed run-tests for BlockingIOError, until version 222 gets packaged
# HACK: use fixed run-tests for BlockingIOError and --exclude, 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
exclude_options=""
for t in $EXCLUDES; do
exclude_options="$exclude_options --exclude $t"
done
# execute run-tests
test/common/run-tests --test-dir test/verify --trace --verbose --nondestructive \
test/common/run-tests --test-dir test/verify --trace --verbose --nondestructive $exclude_options \
--machine localhost:22 --browser localhost:9090 $TESTS || RC=$?
# check-menu is not @nondestructive yet, keep it last