From 13f9319b3fa97937719477d146bec277972564da Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 27 Jul 2022 10:09:18 +0200 Subject: [PATCH] Execute quicktest for each SM driver - Use the `-sr` option of quicktest to run it on a specific SR - Remove plain quicktest test that ran it at once on all SRs available - Remove `quicktest` job as the test no longer exists Co-authored-by: Guillaume Thouvenin Co-authored-by: Benjamin Reis Signed-off-by: Ronan Abhamon --- jobs.py | 10 ---------- tests/quicktest/__init__.py | 0 tests/quicktest/test_quicktest.py | 11 ----------- tests/storage/cephfs/test_cephfs_sr.py | 5 ++++- tests/storage/ext/test_ext_sr.py | 5 ++++- tests/storage/glusterfs/test_glusterfs_sr.py | 5 ++++- tests/storage/iso/test_cifs_iso_sr.py | 4 ++++ tests/storage/iso/test_local_iso_sr.py | 5 +++++ tests/storage/iso/test_nfs_iso_sr.py | 4 ++++ tests/storage/linstor/test_linstor_sr.py | 5 ++++- tests/storage/lvm/test_lvm_sr.py | 5 ++++- tests/storage/lvmoiscsi/test_lvmoiscsi_sr.py | 5 ++++- tests/storage/moosefs/test_moosefs_sr.py | 5 ++++- tests/storage/nfs/test_nfs_sr.py | 5 ++++- tests/storage/storage.py | 3 +++ tests/storage/xfs/test_xfs_sr.py | 5 ++++- tests/storage/zfs/test_zfs_sr.py | 5 ++++- 17 files changed, 56 insertions(+), 31 deletions(-) delete mode 100644 tests/quicktest/__init__.py delete mode 100644 tests/quicktest/test_quicktest.py diff --git a/jobs.py b/jobs.py index 8ef2a274f..4763a6013 100755 --- a/jobs.py +++ b/jobs.py @@ -56,16 +56,6 @@ "paths": ["tests/packages"], "markers": "", }, - "quicktest": { - "description": "XAPI's quicktest, not so quick by the way", - "requirements": [ - "Any pool.", - "Execution depends on the SRs present, as each SR from the pool will get tested.", - ], - "nb_pools": 1, - "params": {}, - "paths": ["tests/quicktest"], - }, "storage-main": { "description": "tests all storage drivers, but avoids migrations and reboots", "requirements": [ diff --git a/tests/quicktest/__init__.py b/tests/quicktest/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/quicktest/test_quicktest.py b/tests/quicktest/test_quicktest.py deleted file mode 100644 index 719a8544b..000000000 --- a/tests/quicktest/test_quicktest.py +++ /dev/null @@ -1,11 +0,0 @@ -import logging - -# Requirements: -# From --host parameter: -# - A XCP-ng host. -# -# /!\ Very long to execute - -def test_quicktest(host): - logging.info("Launching tests") - host.ssh(['/opt/xensource/debug/quicktest']) diff --git a/tests/storage/cephfs/test_cephfs_sr.py b/tests/storage/cephfs/test_cephfs_sr.py index 6370f2f70..39bffd7fd 100644 --- a/tests/storage/cephfs/test_cephfs_sr.py +++ b/tests/storage/cephfs/test_cephfs_sr.py @@ -4,7 +4,7 @@ from lib.commands import SSHCommandFailed from lib.common import wait_for, vm_image -from tests.storage import vdi_is_open +from tests.storage import run_quicktest_on_sr, vdi_is_open # Requirements: # - one XCP-ng host >= 8.2 @@ -42,6 +42,9 @@ def test_create_and_destroy_sr(self, host, cephfs_device_config, pool_with_ceph) @pytest.mark.usefixtures("cephfs_sr") class TestCephFSSR: + def test_quicktest(self, cephfs_sr): + run_quicktest_on_sr(cephfs_sr) + def test_vdi_is_not_open(self, vdi_on_cephfs_sr): assert not vdi_is_open(vdi_on_cephfs_sr) diff --git a/tests/storage/ext/test_ext_sr.py b/tests/storage/ext/test_ext_sr.py index d5a2050ce..d6bafec0f 100644 --- a/tests/storage/ext/test_ext_sr.py +++ b/tests/storage/ext/test_ext_sr.py @@ -1,6 +1,6 @@ import pytest from lib.common import wait_for, vm_image -from tests.storage import try_to_create_sr_with_missing_device, vdi_is_open +from tests.storage import run_quicktest_on_sr, try_to_create_sr_with_missing_device, vdi_is_open # Requirements: # - one XCP-ng host with an additional unused disk for the SR @@ -26,6 +26,9 @@ def test_create_and_destroy_sr(self, host, sr_disk): @pytest.mark.usefixtures("ext_sr") class TestEXTSR: + def test_quicktest(self, ext_sr): + run_quicktest_on_sr(ext_sr) + def test_vdi_is_not_open(self, vdi_on_ext_sr): assert not vdi_is_open(vdi_on_ext_sr) diff --git a/tests/storage/glusterfs/test_glusterfs_sr.py b/tests/storage/glusterfs/test_glusterfs_sr.py index 62e908073..acc78bf11 100644 --- a/tests/storage/glusterfs/test_glusterfs_sr.py +++ b/tests/storage/glusterfs/test_glusterfs_sr.py @@ -3,7 +3,7 @@ from lib.commands import SSHCommandFailed from lib.common import wait_for, vm_image -from tests.storage import vdi_is_open +from tests.storage import run_quicktest_on_sr, vdi_is_open # Requirements: # - one XCP-ng host >= 8.2 with an additional unused disk for the SR @@ -41,6 +41,9 @@ def test_create_and_destroy_sr(self, host, glusterfs_device_config, pool_with_gl @pytest.mark.usefixtures("sr_disk_for_all_hosts", "glusterfs_sr") class TestGlusterFSSR: + def test_quicktest(self, glusterfs_sr): + run_quicktest_on_sr(glusterfs_sr) + def test_vdi_is_not_open(self, vdi_on_glusterfs_sr): assert not vdi_is_open(vdi_on_glusterfs_sr) diff --git a/tests/storage/iso/test_cifs_iso_sr.py b/tests/storage/iso/test_cifs_iso_sr.py index a962d6a92..41d0b750a 100644 --- a/tests/storage/iso/test_cifs_iso_sr.py +++ b/tests/storage/iso/test_cifs_iso_sr.py @@ -1,7 +1,9 @@ import pytest import logging import os + from .conftest import copy_tools_iso_to_iso_sr, check_iso_mount_and_read_from_vm, remove_iso_from_sr +from tests.storage import run_quicktest_on_sr # Requirements: # From --hosts parameter: @@ -35,6 +37,8 @@ def test_create_and_destroy_sr(self, host, cifs_iso_device_config): @pytest.mark.small_vm @pytest.mark.usefixtures("cifs_iso_sr") class TestCIFSISOSR: + def test_quicktest(self, cifs_iso_sr): + run_quicktest_on_sr(cifs_iso_sr) def test_iso_mount_and_read(self, host, cifs_iso_sr, running_unix_vm): # create the ISO SR on CIFS diff --git a/tests/storage/iso/test_local_iso_sr.py b/tests/storage/iso/test_local_iso_sr.py index 3b4555199..768c0ac75 100644 --- a/tests/storage/iso/test_local_iso_sr.py +++ b/tests/storage/iso/test_local_iso_sr.py @@ -1,8 +1,10 @@ import pytest import logging import os + from .conftest import create_local_iso_sr, copy_tools_iso_to_iso_sr, \ check_iso_mount_and_read_from_vm, remove_iso_from_sr +from tests.storage import run_quicktest_on_sr # Requirements: # From --hosts parameter: @@ -41,6 +43,9 @@ def test_create_and_destroy_sr(self, host, formatted_and_mounted_ext4_disk): @pytest.mark.small_vm @pytest.mark.usefixtures("local_iso_sr") class TestLocalISOSR: + def test_quicktest(self, local_iso_sr): + sr, location = local_iso_sr + run_quicktest_on_sr(sr) def test_iso_mount_and_read(self, host, local_iso_sr, unix_vm): sr, location = local_iso_sr diff --git a/tests/storage/iso/test_nfs_iso_sr.py b/tests/storage/iso/test_nfs_iso_sr.py index 57ae4e652..c9d3f830c 100644 --- a/tests/storage/iso/test_nfs_iso_sr.py +++ b/tests/storage/iso/test_nfs_iso_sr.py @@ -1,7 +1,9 @@ import pytest import os import logging + from .conftest import copy_tools_iso_to_iso_sr, check_iso_mount_and_read_from_vm, remove_iso_from_sr +from tests.storage import run_quicktest_on_sr # Requirements: # From --hosts parameter: @@ -37,6 +39,8 @@ def test_create_and_destroy_sr(self, host, nfs_iso_device_config): @pytest.mark.small_vm @pytest.mark.usefixtures("nfs_iso_sr") class TestNFSISOSR: + def test_quicktest(self, nfs_iso_sr): + run_quicktest_on_sr(nfs_iso_sr) def test_iso_mount_and_read(self, host, nfs_iso_sr, running_unix_vm): # create the ISO SR on NFS diff --git a/tests/storage/linstor/test_linstor_sr.py b/tests/storage/linstor/test_linstor_sr.py index 8c540196a..e80698b21 100644 --- a/tests/storage/linstor/test_linstor_sr.py +++ b/tests/storage/linstor/test_linstor_sr.py @@ -5,7 +5,7 @@ from .conftest import STORAGE_POOL_NAME, LINSTOR_PACKAGE from lib.commands import SSHCommandFailed from lib.common import wait_for, vm_image -from tests.storage import vdi_is_open +from tests.storage import run_quicktest_on_sr, vdi_is_open # Requirements: # - one XCP-ng host >= 8.2 with an additional unused disk for the SR @@ -52,6 +52,9 @@ def test_create_and_destroy_sr(self, pool_with_linstor): @pytest.mark.usefixtures("linstor_sr") class TestLinstorSR: + def test_quicktest(self, linstor_sr): + run_quicktest_on_sr(linstor_sr) + def test_vdi_is_not_open(self, vdi_on_linstor_sr): assert not vdi_is_open(vdi_on_linstor_sr) diff --git a/tests/storage/lvm/test_lvm_sr.py b/tests/storage/lvm/test_lvm_sr.py index 4eb76965c..613311c01 100644 --- a/tests/storage/lvm/test_lvm_sr.py +++ b/tests/storage/lvm/test_lvm_sr.py @@ -1,6 +1,6 @@ import pytest from lib.common import wait_for, vm_image -from tests.storage import try_to_create_sr_with_missing_device, vdi_is_open +from tests.storage import run_quicktest_on_sr, try_to_create_sr_with_missing_device, vdi_is_open # Requirements: # - one XCP-ng host with an additional unused disk for the SR @@ -26,6 +26,9 @@ def test_create_and_destroy_sr(self, host, sr_disk): @pytest.mark.usefixtures("lvm_sr") class TestLVMSR: + def test_quicktest(self, lvm_sr): + run_quicktest_on_sr(lvm_sr) + def test_vdi_is_not_open(self, vdi_on_lvm_sr): assert not vdi_is_open(vdi_on_lvm_sr) diff --git a/tests/storage/lvmoiscsi/test_lvmoiscsi_sr.py b/tests/storage/lvmoiscsi/test_lvmoiscsi_sr.py index 65381eb26..b3a3a2ca7 100644 --- a/tests/storage/lvmoiscsi/test_lvmoiscsi_sr.py +++ b/tests/storage/lvmoiscsi/test_lvmoiscsi_sr.py @@ -1,6 +1,6 @@ import pytest from lib.common import wait_for, vm_image -from tests.storage import vdi_is_open +from tests.storage import run_quicktest_on_sr, vdi_is_open # Requirements: # - one XCP-ng host >= 8.2 @@ -24,6 +24,9 @@ def test_create_and_destroy_sr(self, host, lvmoiscsi_device_config): @pytest.mark.usefixtures("lvmoiscsi_sr") class TestLVMOISCSISR: + def test_quicktest(self, lvmoiscsi_sr): + run_quicktest_on_sr(lvmoiscsi_sr) + def test_vdi_is_not_open(self, vdi_on_lvmoiscsi_sr): assert not vdi_is_open(vdi_on_lvmoiscsi_sr) diff --git a/tests/storage/moosefs/test_moosefs_sr.py b/tests/storage/moosefs/test_moosefs_sr.py index 94568e33d..e77d979ce 100644 --- a/tests/storage/moosefs/test_moosefs_sr.py +++ b/tests/storage/moosefs/test_moosefs_sr.py @@ -4,7 +4,7 @@ from lib.commands import SSHCommandFailed from lib.common import wait_for, vm_image -from tests.storage import vdi_is_open +from tests.storage import run_quicktest_on_sr, vdi_is_open # Requirements: # - one XCP-ng host >= 8.2 @@ -43,6 +43,9 @@ def test_create_and_destroy_sr(self, moosefs_device_config, pool_with_moosefs_en @pytest.mark.usefixtures("moosefs_sr") class TestMooseFSSR: + def test_quicktest(self, moosefs_sr): + run_quicktest_on_sr(moosefs_sr) + def test_vdi_is_not_open(self, vdi_on_moosefs_sr): assert not vdi_is_open(vdi_on_moosefs_sr) diff --git a/tests/storage/nfs/test_nfs_sr.py b/tests/storage/nfs/test_nfs_sr.py index 727ba3936..e8fd1355a 100644 --- a/tests/storage/nfs/test_nfs_sr.py +++ b/tests/storage/nfs/test_nfs_sr.py @@ -1,6 +1,6 @@ import pytest from lib.common import wait_for, vm_image -from tests.storage import vdi_is_open +from tests.storage import run_quicktest_on_sr, vdi_is_open # Requirements: # - one XCP-ng host >= 8.0 with an additional unused disk for the SR @@ -17,6 +17,9 @@ def test_create_and_destroy_sr(self, host, nfs_device_config): @pytest.mark.usefixtures("nfs_sr") class TestNFSSR: + def test_quicktest(self, nfs_sr): + run_quicktest_on_sr(nfs_sr) + def test_vdi_is_not_open(self, vdi_on_nfs_sr): assert not vdi_is_open(vdi_on_nfs_sr) diff --git a/tests/storage/storage.py b/tests/storage/storage.py index 8ea85347e..8ba3ff960 100644 --- a/tests/storage/storage.py +++ b/tests/storage/storage.py @@ -70,3 +70,6 @@ def get_xapi_session(): 'vdiUuid': vdi.uuid, 'srRef': master.execute_script(get_sr_ref, shebang='python') })) + +def run_quicktest_on_sr(sr): + sr.pool.master.ssh(['/opt/xensource/debug/quicktest', '-sr', sr.uuid]) diff --git a/tests/storage/xfs/test_xfs_sr.py b/tests/storage/xfs/test_xfs_sr.py index f22284572..cb152868f 100644 --- a/tests/storage/xfs/test_xfs_sr.py +++ b/tests/storage/xfs/test_xfs_sr.py @@ -4,7 +4,7 @@ from lib.commands import SSHCommandFailed from lib.common import wait_for, vm_image -from tests.storage import vdi_is_open +from tests.storage import run_quicktest_on_sr, vdi_is_open # Requirements: # - one XCP-ng host >= 8.2 with an additional unused disk for the SR @@ -42,6 +42,9 @@ def test_create_and_destroy_sr(self, sr_disk, host_with_xfsprogs): @pytest.mark.usefixtures("xfs_sr") class TestXFSSR: + def test_quicktest(self, xfs_sr): + run_quicktest_on_sr(xfs_sr) + def test_vdi_is_not_open(self, vdi_on_xfs_sr): assert not vdi_is_open(vdi_on_xfs_sr) diff --git a/tests/storage/zfs/test_zfs_sr.py b/tests/storage/zfs/test_zfs_sr.py index f02191971..0ffdf9839 100755 --- a/tests/storage/zfs/test_zfs_sr.py +++ b/tests/storage/zfs/test_zfs_sr.py @@ -5,7 +5,7 @@ from .conftest import VOLUME_PATH, VOLUME_NAME from lib.commands import SSHCommandFailed from lib.common import wait_for, vm_image -from tests.storage import vdi_is_open +from tests.storage import run_quicktest_on_sr, vdi_is_open # Requirements: # - one XCP-ng host >= 8.2 with an additional unused disk for the SR @@ -44,6 +44,9 @@ def test_create_and_destroy_sr(self, host): @pytest.mark.usefixtures("zpool_vol0") class TestZFSSR: + def test_quicktest(self, zfs_sr): + run_quicktest_on_sr(zfs_sr) + def test_vdi_is_not_open(self, vdi_on_zfs_sr): assert not vdi_is_open(vdi_on_zfs_sr)