test: 'run-test.sh' can decide which tests to run
We currently have 3 versions of this script (one in fedora, one in rhel cockpit and one in rhel cockpit-appstream). With this patch we can keep this same file in all 3. Also backporting hack in verify.sh.
This commit is contained in:
parent
8f952d3560
commit
b6bc45dfef
@ -1,15 +1,31 @@
|
||||
#!/bin/sh
|
||||
set -eux
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
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
|
||||
|
||||
# tests need cockpit's bots/ libraries
|
||||
cd "$SOURCE"
|
||||
git clone --depth=1 https://github.com/cockpit-project/bots
|
||||
# pre-download cirros image for Machines tests
|
||||
bots/image-download cirros
|
||||
|
||||
if [ -n "$test_optional" ]; then
|
||||
# pre-download cirros image for Machines tests
|
||||
bots/image-download cirros
|
||||
fi
|
||||
|
||||
# only install a subset to save time/space
|
||||
npm install axe-core chrome-remote-interface sizzle
|
||||
|
||||
. /etc/os-release
|
||||
export TEST_OS="${ID}-${VERSION_ID/./-}"
|
||||
# HACK: upstream does not yet know about fedora rawhide
|
||||
if [ "$TEST_OS" = "fedora-33" ]; then
|
||||
@ -18,32 +34,40 @@ fi
|
||||
|
||||
RC=0
|
||||
|
||||
# some tests are still too unstable: testCreate,testNetworkSettings,testVmNICs
|
||||
# testAddDisk triggers SELinux violation
|
||||
test/verify/check-machines -tv --machine localhost:22 --browser localhost:9090 \
|
||||
TestMachines.test{Basic,VCPU,MultipleSettings,BootOrder,Libvirt} \
|
||||
TestMachines.testDetachDisk \
|
||||
TestMachines.test{InlineConsole,ExternalConsole,SerialConsole} \
|
||||
TestMachines.test{StoragePools,StoragePoolsCreate,NICAdd} || RC=$?
|
||||
if [ -n "$test_optional" ]; then
|
||||
# some tests are still too unstable: testCreate,testNetworkSettings,testVmNICs
|
||||
# testAddDisk triggers SELinux violation
|
||||
test/verify/check-machines -tv --machine localhost:22 --browser localhost:9090 \
|
||||
TestMachines.test{Basic,VCPU,MultipleSettings,BootOrder,Libvirt} \
|
||||
TestMachines.testDetachDisk \
|
||||
TestMachines.test{InlineConsole,ExternalConsole,SerialConsole} \
|
||||
TestMachines.test{StoragePools,StoragePoolsCreate,NICAdd} || RC=$?
|
||||
|
||||
# TestFirewall.testNetworkingPage is still too unstable
|
||||
test/verify/check-networking-firewall -tv --machine localhost:22 --browser localhost:9090 \
|
||||
TestFirewall.test{AddCustomServices,AddServices,FirewallPage,MultipleZones} || RC=$?
|
||||
# not all classes are nondestructive, and we can't run rebooting tests
|
||||
test/verify/check-packagekit -tv --machine localhost:22 --browser localhost:9090 TestUpdates.test{Basic,SecurityOnly} TestAutoUpdates || RC=$?
|
||||
|
||||
# not all classes are nondestructive, and we can't run rebooting tests
|
||||
test/verify/check-packagekit -tv --machine localhost:22 --browser localhost:9090 TestUpdates.test{Basic,SecurityOnly} TestAutoUpdates || RC=$?
|
||||
for t in storage-basic \
|
||||
storage-ignored \
|
||||
storage-partitions \
|
||||
storage-used storage-lvm2; do
|
||||
test/verify/check-$t -tv --machine localhost:22 --browser localhost:9090 || RC=$?
|
||||
done
|
||||
fi
|
||||
|
||||
# check-menu is not @nondestructive yet, keep it last
|
||||
for t in accounts \
|
||||
login \
|
||||
networking-basic \
|
||||
sosreport storage-basic \
|
||||
storage-ignored \
|
||||
storage-partitions \
|
||||
storage-used storage-lvm2 \
|
||||
menu; do
|
||||
test/verify/check-$t -tv --machine localhost:22 --browser localhost:9090 || RC=$?
|
||||
done
|
||||
if [ -n "$test_basic" ]; then
|
||||
# TestFirewall.testNetworkingPage is still too unstable
|
||||
test/verify/check-networking-firewall -tv --machine localhost:22 --browser localhost:9090 \
|
||||
TestFirewall.test{AddCustomServices,AddServices,FirewallPage,MultipleZones} || RC=$?
|
||||
|
||||
# check-menu is not @nondestructive yet, keep it last
|
||||
for t in accounts \
|
||||
login \
|
||||
networking-basic \
|
||||
sosreport \
|
||||
menu; do
|
||||
test/verify/check-$t -tv --machine localhost:22 --browser localhost:9090 || RC=$?
|
||||
done
|
||||
fi
|
||||
|
||||
echo $RC > "$LOGS/exitcode"
|
||||
cp --verbose Test* "$LOGS" || true
|
||||
|
@ -10,7 +10,7 @@ chmod a+w "$LOGS"
|
||||
|
||||
# install browser; on RHEL, use chromium from epel
|
||||
if ! rpm -q chromium-headless; then
|
||||
if grep -q 'ID=rhel' /etc/os-release; then
|
||||
if grep -q 'ID=.*rhel' /etc/os-release; then
|
||||
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
|
||||
dnf config-manager --enable epel
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user