Debian Codegraph @

test/browser/run-test.sh

raw
1 # shellcheck shell=sh
2
3 set -eux
4
5 PLAN="$1"
6
7 cd "${SOURCE}"
8
9 # tests need cockpit's bots/ libraries
10 git clone --depth=1 https://github.com/cockpit-project/bots
11
12 # release tarballs include the necessary npm modules for testing
13 if [ -d .git ]; then
14 ./tools/node-modules checkout
15 fi
16
17 TEST_ALLOW_JOURNAL_MESSAGES=""
18
19 # HACK: CI hits this selinux denial. Unrelated to our tests.
20 TEST_ALLOW_JOURNAL_MESSAGES=".*Permission denied:.*/var/cache/app-info/xmls.*"
21
22 export TEST_ALLOW_JOURNAL_MESSAGES
23
24 # Chromium sometimes gets OOM killed on testing farm
25 export TEST_BROWSER=firefox
26
27 # make it easy to check in logs
28 echo "TEST_ALLOW_JOURNAL_MESSAGES: ${TEST_ALLOW_JOURNAL_MESSAGES:-}"
29 echo "TEST_AUDIT_NO_SELINUX: ${TEST_AUDIT_NO_SELINUX:-}"
30
31 EXCLUDES=""
32
33 # We only have one VM per plan and tests should take at most one hour. So run those tests which exercise external API
34 # (and thus are useful for reverse dependency testing and gating), and exclude those which test cockpit-internal
35 # functionality to upstream CI. We also need to leave out some which make too strict assumptions about the testbed.
36 if [ "$PLAN" = "main" ]; then
37 # Don't run TestPages, TestPackages, and TestTerminal at all -- not testing external APIs
38 TESTS="TestAutoUpdates
39 TestAccounts
40 TestBonding
41 TestBridge
42 TestFirewall
43 TestJournal
44 TestKdump
45 TestLogin
46 TestNetworking
47 TestSOS
48 TestServices
49 TestSystemInfo
50 TestTeam
51 TestTuned
52 TestUpdates
53 "
54
55 # PCI devices list is not predictable
56 EXCLUDES="$EXCLUDES TestSystemInfo.testHardwareInfo"
57
58 # TODO: investigate failure
59 if [ "$TEST_OS" = "centos-10" ]; then
60 EXCLUDES="$EXCLUDES TestLogin.testClientCertAuthentication"
61 fi
62
63 # TODO: our /usr/local/ bind mount isn't "visible" to systemd
64 if [ "${TEST_OS%bootc}" != "$TEST_OS" ]; then
65 EXCLUDES="$EXCLUDES TestServices.testTimer"
66 fi
67
68 # These don't test more external APIs
69 EXCLUDES="$EXCLUDES
70 TestAccounts.testAccountLogs
71 TestAccounts.testExpire
72 TestAccounts.testRootLogin
73 TestAccounts.testUnprivileged
74
75 TestAutoUpdates.testBasic
76 TestAutoUpdates.testPrivilegeChange
77
78 TestBonding.testActive
79 TestBonding.testAmbiguousMember
80 TestBonding.testNonDefaultSettings
81
82 TestFirewall.testAddCustomServices
83 TestFirewall.testNetworkingPage
84
85 TestLogin.testConversation
86 TestLogin.testExpired
87 TestLogin.testFailingWebsocket
88 TestLogin.testFailingWebsocketSafari
89 TestLogin.testFailingWebsocketSafariNoCA
90 TestLogin.testLogging
91 TestLogin.testNFSHomeDir
92 TestLogin.testSSH
93 TestLogin.testRaw
94 TestLogin.testServer
95 TestLogin.testSELinuxRestrictedUser
96 TestLogin.testUnsupportedBrowser
97
98 TestNetworkingBasic.testIpHelper
99 TestNetworkingBasic.testNoService
100 TestNetworkingCheckpoints.testCheckpoint
101 TestNetworkingCheckpoints.testCheckpointSlowRollback
102 TestNetworkingCheckpoints.testCheckpointSessionStorageEventSuccess
103 TestNetworkingCheckpoints.testCheckpointSessionStorageEventRollback
104 TestNetworkingUnmanaged.testUnmanaged
105
106 TestSOS.testWithUrlRoot
107 TestSOS.testCancel
108 TestSOS.testAppStream
109
110 TestSystemInfo.testInsightsStatus
111 TestSystemInfo.testMotd
112 TestSystemInfo.testOverview
113 TestSystemInfo.testShutdownStatus
114
115 TestJournal.testBinary
116 TestJournal.testNoMessage
117
118 TestServices.testApi
119 TestServices.testConditions
120 TestServices.testHiddenFailure
121 TestServices.testLogs
122 TestServices.testLogsUser
123 TestServices.testNotFound
124 TestServices.testNotifyFailed
125 TestServices.testRelationships
126 TestServices.testRelationshipsUser
127 TestServices.testResetFailed
128 TestServices.testTransientUnits
129 TestServices.testUnprivileged
130 TestServices.testQuadlets
131
132 TestUpdates.testUnprivileged
133 TestUpdates.testPackageKitCrash
134 TestUpdates.testNoPackageKit
135 TestUpdates.testInfoTruncation
136 "
137
138 # Testing Farm machines often have pending restarts/reboot
139 EXCLUDES="$EXCLUDES
140 TestUpdates.testBasic
141 TestUpdates.testBasicTZFullHour
142 TestUpdates.testBasicTZHalfHour
143 TestUpdates.testDnfRestart
144 TestUpdates.testFailServiceRestart
145 TestUpdates.testKpatch
146 "
147
148 # FIXME: TestingFarm will fix their auto-reboot ansible
149 # https://gitlab.com/testing-farm/profiles/-/merge_requests/92
150 EXCLUDES="$EXCLUDES
151 TestNetworkingWifi.testHidden
152 TestNetworkingWifi.testWifi
153 "
154 fi
155
156 if [ "$PLAN" = "storage-basic" ]; then
157 TESTS="TestStorageBasic
158 TestStorageBtrfs
159 TestStorageMdRaid
160 TestStorageMounting
161 TestStorageMountingLUKS
162 TestStorageMsDOS
163 TestStorageNfs
164 TestStoragePartitions
165 TestStorageRaid
166 TestStorageStratis
167 TestStorageUnrecognized
168 TestStorageUsed
169 TestStorageswap
170 "
171
172 # These don't test more external APIs
173 EXCLUDES="$EXCLUDES
174 TestStorageAnaconda.testBasic
175
176 TestStorageBtrfs.testNothingMounted
177
178 TestStorageMounting.testAtBoot
179 TestStorageMounting.testBadOption
180 TestStorageMounting.testFirstMount
181 TestStorageMounting.testMounting
182 TestStorageMounting.testMountingHelp
183 TestStorageMounting.testNeverAuto
184 TestStorageMountingLUKS.testEncryptedMountingHelp
185 TestStorageMountingLUKS.testDuplicateMountPoints
186 TestStorageMountingLUKS.testNeverAuto
187
188 TestStoragePartitions.testSizeSlider
189 TestStorageStratis.testAlerts
190 "
191
192 # RHEL test machines have a lot of junk mounted on /mnt
193 if [ "${TEST_OS#rhel-}" != "$TEST_OS" ]; then
194 EXCLUDES="$EXCLUDES
195 TestStorageNfs.testNfsBusy
196 TestStorageNfs.testNfsClient
197 TestStorageNfs.testNfsMountWithoutDiscovery
198 "
199 fi
200
201 if [ "$TEST_OS" = "centos-9-bootc" ]; then
202 # FIXME: pcp is installed, but not working on CentOS 9 (10 is fine)
203 # warn: PM_ERR_NOPMNS PMNS not accessible <pcp.pmapi.c_uint_Array_1 object at 0x...>
204 EXCLUDES="$EXCLUDES
205 TestStorageswap.testBasic
206 TestStorageswap.testEncrypted
207 "
208 fi
209 fi
210
211 if [ "$PLAN" = "storage-extra" ]; then
212 TESTS="TestStorageAnaconda
213 TestStorageLuks
214 TestStorageMountingLUKS
215 TestStorageLvm
216 "
217 if [ "$TEST_OS" = "fedora-eln" ]; then
218 EXCLUDES="$EXCLUDES
219 TestStorageAnaconda.testBtrfs
220 TestStorageAnaconda.testDegradedBtrfs
221 "
222 fi
223
224 # These don't test more external APIs
225 EXCLUDES="$EXCLUDES
226 TestStorageAnaconda.testBasic
227 TestStorageAnaconda.testStratis
228
229 TestStorageMountingLUKS.testEncryptedMountingHelp
230 TestStorageMountingLUKS.testDuplicateMountPoints
231 TestStorageMountingLUKS.testNeverAuto
232 "
233
234 if [ "$TEST_OS" = "centos-10-bootc" ]; then
235 # FIXME: targetcli fails with code 255 and no error message; needs investigation
236 EXCLUDES="$EXCLUDES
237 TestStorageLvm2.testDegradation
238 "
239 fi
240 fi
241
242 exclude_options=""
243 for t in $EXCLUDES; do
244 exclude_options="$exclude_options --exclude $t"
245 done
246
247 GATEWAY="$(python3 -c 'import socket; print(socket.gethostbyname("_gateway"))')"
248 RC=0
249 ./test/common/run-tests \
250 --test-dir test/verify \
251 --nondestructive \
252 --machine "${GATEWAY}":22 \
253 --browser "${GATEWAY}":9090 \
254 $exclude_options \
255 $TESTS \
256 || RC=$?
257
258 echo $RC > "$LOGS/exitcode"
259 cp --verbose Test* "$LOGS" || true
260 exit $RC