|
| 1 | +#!/bin/sh |
| 2 | +set -eux |
| 3 | + |
| 4 | +cd "$SOURCE" |
| 5 | + |
| 6 | +. /etc/os-release |
| 7 | +test_optional= |
| 8 | +test_basic= |
| 9 | + |
| 10 | +if ls ../cockpit-appstream* 1> /dev/null 2>&1; then |
| 11 | + test_optional=1 |
| 12 | +else |
| 13 | + test_basic=1 |
| 14 | +fi |
| 15 | + |
| 16 | +if [ "$ID" = "fedora" ]; then |
| 17 | + test_basic=1 |
| 18 | + test_optional=1 |
| 19 | +fi |
| 20 | + |
| 21 | +# tests need cockpit's bots/ libraries |
| 22 | +git clone --depth=1 https://github.com/cockpit-project/bots |
| 23 | + |
| 24 | +# support running from clean git tree |
| 25 | +if [ ! -d node_modules/chrome-remote-interface ]; then |
| 26 | + npm install chrome-remote-interface sizzle |
| 27 | +fi |
| 28 | + |
| 29 | +export TEST_OS="${ID}-${VERSION_ID/./-}" |
| 30 | +# HACK: upstream does not yet know about rawhide |
| 31 | +if [ "$TEST_OS" = "fedora-35" ]; then |
| 32 | + export TEST_OS=fedora-33 |
| 33 | +fi |
| 34 | + |
| 35 | +# HACK: CI hits this selinux denial. Unrelated to our tests. |
| 36 | +export TEST_ALLOW_JOURNAL_MESSAGES=".*Permission denied:.*/var/cache/app-info/xmls.*" |
| 37 | + |
| 38 | +# select tests |
| 39 | +TESTS="" |
| 40 | +EXCLUDES="" |
| 41 | +RC=0 |
| 42 | +if [ -n "$test_optional" ]; then |
| 43 | + # pre-download cirros image for Machines tests |
| 44 | + bots/image-download cirros |
| 45 | + |
| 46 | + # triggers SELinux violation |
| 47 | + # See journal: SELinux is preventing /usr/libexec/qemu-kvm from open access on the file /var/lib/cockpittest/nfs_pool/nfs-volume-0. |
| 48 | + EXCLUDES="$EXCLUDES TestMachinesDisks.testAddDiskNFS" |
| 49 | + # not investigated yet |
| 50 | + EXCLUDES="$EXCLUDES |
| 51 | + TestAutoUpdates.testPrivilegeChange" |
| 52 | + |
| 53 | + # TestUpdates: we can't run rebooting tests |
| 54 | + TESTS="$TESTS |
| 55 | + TestAutoUpdates |
| 56 | + TestStorage |
| 57 | + TestUpdates.testBasic |
| 58 | + TestUpdates.testSecurityOnly" |
| 59 | + |
| 60 | + # Fedora gating tests are running on infra without /dev/kvm; Machines tests are too darn slow there |
| 61 | + if [ "$ID" = "fedora" ]; then |
| 62 | + TESTS="$TESTS TestMachinesCreate.testCreateImportDisk" |
| 63 | + else |
| 64 | + TESTS="$TESTS TestMachines" |
| 65 | + fi |
| 66 | +fi |
| 67 | + |
| 68 | +if [ -n "$test_basic" ]; then |
| 69 | + # still too unstable |
| 70 | + EXCLUDES="$EXCLUDES TestFirewall.testNetworkingPage" |
| 71 | + |
| 72 | + # TODO: fix for CI environment |
| 73 | + EXCLUDES="$EXCLUDES TestLogin.testTally" |
| 74 | + EXCLUDES="$EXCLUDES TestAccounts.testBasic" |
| 75 | + |
| 76 | + # PCI devices list is not predictable |
| 77 | + EXCLUDES="$EXCLUDES TestSystemInfo.testHardwareInfo" |
| 78 | + |
| 79 | + # Known issue #1008 |
| 80 | + EXCLUDES="$EXCLUDES TestTuned.testBasic" |
| 81 | + |
| 82 | + TESTS="$TESTS |
| 83 | + TestAccounts |
| 84 | + TestBonding |
| 85 | + TestBridge |
| 86 | + TestFirewall |
| 87 | + TestKdump |
| 88 | + TestLogin |
| 89 | + TestNetworking |
| 90 | + TestServices |
| 91 | + TestSOS |
| 92 | + TestSystemInfo |
| 93 | + TestTeam |
| 94 | + TestTerminal |
| 95 | + TestTuned |
| 96 | + " |
| 97 | +fi |
| 98 | + |
| 99 | +exclude_options="" |
| 100 | +for t in $EXCLUDES; do |
| 101 | + exclude_options="$exclude_options --exclude $t" |
| 102 | +done |
| 103 | + |
| 104 | +# execute run-tests |
| 105 | +test/common/run-tests --test-dir test/verify --nondestructive $exclude_options \ |
| 106 | + --machine localhost:22 --browser localhost:9090 $TESTS || RC=$? |
| 107 | + |
| 108 | +# check-shell-menu is not @nondestructive yet, keep it last |
| 109 | +if [ -n "$test_basic" ]; then |
| 110 | + test/verify/check-shell-menu --machine localhost:22 --browser localhost:9090 || RC=$? |
| 111 | +fi |
| 112 | + |
| 113 | +echo $RC > "$LOGS/exitcode" |
| 114 | +cp --verbose Test* "$LOGS" || true |
| 115 | +# deliver test result via exitcode file |
| 116 | +exit 0 |
0 commit comments