Skip to content

Commit de11940

Browse files
committed
quicktest: split QT into SR specific and common suites
Currently we are calling quicktest for all SRs. The problem is that it takes long time to run and some tests are not related to the type of the SR. This patch creates one new test that runs the common suites one, and we only run SR specific tests per SR. Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@vates.tech>
1 parent c6e1187 commit de11940

2 files changed

Lines changed: 30 additions & 3 deletions

File tree

lib/sr.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import logging
4+
import shlex
45
import time
56

67
import lib.commands as commands
@@ -26,6 +27,17 @@
2627
from lib.host import Host
2728
from lib.pool import Pool
2829

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+
2941
class SR:
3042
xe_prefix = 'sr'
3143

@@ -230,14 +242,20 @@ def create_vdi(
230242
vdi_uuid = self.pool.master.xe('vdi-create', args)
231243
return VDI(vdi_uuid, sr=self)
232244

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+
235253
# Always display the output of quicktest, failed or not.
236254
# This will duplicate the output in some cases, but it ensures we always have it for failure analysis,
237255
# even when quicktest leaves SRs in a state which makes teardown fail (in this case, pytest often doesn't
238256
# manage to display the details of the failed command, for a reason unknown - no usable reproducer found)
239257
try:
240-
output = self.pool.master.ssh(f'/opt/xensource/debug/quicktest -sr {self.uuid}')
258+
output = self.pool.master.ssh(cmd)
241259
logging.info(f"Quicktest output: {output}")
242260
except commands.SSHCommandFailed as e:
243261
logging.error(f"Quicktest output: {e.stdout}")
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from __future__ import annotations
2+
3+
import pytest
4+
5+
from lib.sr import QUICKTEST_COMMON_SUITES, SR
6+
7+
@pytest.mark.quicktest
8+
def test_common_quicktest(local_sr_on_hostA1: SR) -> None:
9+
local_sr_on_hostA1.run_quicktest(run_only=QUICKTEST_COMMON_SUITES)

0 commit comments

Comments
 (0)