|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import logging |
| 4 | +import shlex |
4 | 5 | import time |
5 | 6 |
|
6 | 7 | import lib.commands as commands |
|
26 | 27 | from lib.host import Host |
27 | 28 | from lib.pool import Pool |
28 | 29 |
|
| 30 | +QUICKTEST_SR_SUITES = ( |
| 31 | + "cbt,copy,SR tests,Quicktest_vdi,Quicktest_async_calls," |
| 32 | + "Quicktest_vm_import_export,Quicktest_vm_lifecycle,Quicktest_vm_snapshot," |
| 33 | + "Quicktest_vdi_ops_data_integrity,Quicktest_max_vdi_size,Quicktest_static_vdis" |
| 34 | +) |
| 35 | + |
| 36 | +QUICKTEST_COMMON_SUITES = ( |
| 37 | + "Quicktest_example,Quicktest_message,xenstore,event,import_raw_vdi," |
| 38 | + "Quicktest_date,Quicktest_crypt_r,http,unixext,Timer" |
| 39 | +) |
| 40 | + |
29 | 41 | class SR: |
30 | 42 | xe_prefix = 'sr' |
31 | 43 |
|
@@ -230,14 +242,20 @@ def create_vdi( |
230 | 242 | vdi_uuid = self.pool.master.xe('vdi-create', args) |
231 | 243 | return VDI(vdi_uuid, sr=self) |
232 | 244 |
|
233 | | - def run_quicktest(self) -> None: |
234 | | - logging.info(f"Run quicktest on SR {self.uuid}") |
| 245 | + def run_quicktest(self, run_only: str | None = QUICKTEST_SR_SUITES) -> None: |
| 246 | + cmd = f'/opt/xensource/debug/quicktest -sr {self.uuid}' |
| 247 | + if run_only is None: |
| 248 | + logging.info(f"Run quicktest on SR {self.uuid}") |
| 249 | + else: |
| 250 | + logging.info(f"Run {run_only} on SR {self.uuid}") |
| 251 | + cmd += f' -run-only {shlex.quote(run_only)}' |
| 252 | + |
235 | 253 | # Always display the output of quicktest, failed or not. |
236 | 254 | # This will duplicate the output in some cases, but it ensures we always have it for failure analysis, |
237 | 255 | # even when quicktest leaves SRs in a state which makes teardown fail (in this case, pytest often doesn't |
238 | 256 | # manage to display the details of the failed command, for a reason unknown - no usable reproducer found) |
239 | 257 | try: |
240 | | - output = self.pool.master.ssh(f'/opt/xensource/debug/quicktest -sr {self.uuid}') |
| 258 | + output = self.pool.master.ssh(cmd) |
241 | 259 | logging.info(f"Quicktest output: {output}") |
242 | 260 | except commands.SSHCommandFailed as e: |
243 | 261 | logging.error(f"Quicktest output: {e.stdout}") |
|
0 commit comments