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 # select tests
TESTS="" TESTS=""
EXCLUDES=""
RC=0 RC=0
if [ -n "$test_optional" ]; then if [ -n "$test_optional" ]; then
# pre-download cirros image for Machines tests # pre-download cirros image for Machines tests
bots/image-download cirros bots/image-download cirros
# some tests are still too unstable: testCreate,testNetworkSettings,testVmNICs # still too unstable
# testAddDisk triggers SELinux violation EXCLUDES="$EXCLUDES
TESTS="$TESTS TestMachines.testCreate
TestMachines.test{Basic,VCPU,MultipleSettings,BootOrder,Libvirt} TestMachines.testNetworkSettings
TestMachines.testDetachDisk TestMachines.testVmNICs"
TestMachines.test{InlineConsole,ExternalConsole,SerialConsole}
TestMachines.test{StoragePools,StoragePoolsCreate,NICAdd}"
# 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 TESTS="$TESTS
TestUpdates.test{Basic,SecurityOnly}
TestAutoUpdates TestAutoUpdates
TestStorage" TestMachines
TestStorage
TestUpdates.testBasic
TestUpdates.testSecurityOnly"
fi fi
if [ -n "$test_basic" ]; then if [ -n "$test_basic" ]; then
# TestFirewall.testNetworkingPage is still too unstable # still too unstable
TESTS="$TESTS TestFirewall.test{AddCustomServices,AddServices,FirewallPage,MultipleZones}" 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 if [ "${TEST_OS#rhel}" != "$TEST_OS" ]; then
TESTS="$TESTS EXCLUDES="$EXCLUDES TestLogin.testExpired"
TestLogin.test{Basic,Conversation,FailingWebsocket,FailingWebsocketSafari,FailingWebsocketSafariNoCA,Logging,Raw,SELinuxRestrictedUser,SessionRecordingShell,UnsupportedBrowser}"
else
TESTS="$TESTS
TestLogin"
fi fi
TESTS="$TESTS TESTS="$TESTS
TestAccounts TestAccounts
TestFirewall
TestLogin
TestNetworking TestNetworking
TestSOS" TestSOS"
fi 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 curl https://raw.githubusercontent.com/cockpit-project/cockpit/master/test/common/run-tests > test/common/run-tests
chmod a+x 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 # 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=$? --machine localhost:22 --browser localhost:9090 $TESTS || RC=$?
# check-menu is not @nondestructive yet, keep it last # check-menu is not @nondestructive yet, keep it last