From 89a36e2ceab34f4e716fcb294ed58c469cab41ad Mon Sep 17 00:00:00 2001 From: Guillaume Date: Mon, 8 Apr 2024 18:20:37 +0200 Subject: [PATCH 1/2] Only host with zfsvol can create SR of type zfsvol An host with zfsvol is required to run create and destroy SR. Also, running quicktest on zfsvol generates dangling VDI. So don't run quicktest on zfsvol while bugs are not fixed. Signed-off-by: Guillaume --- jobs.py | 5 ++++- tests/storage/zfsvol/test_zfsvol_sr.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jobs.py b/jobs.py index 73a29099f..50713dfb6 100755 --- a/jobs.py +++ b/jobs.py @@ -122,7 +122,7 @@ }, "paths": ["tests/storage"], "markers": "quicktest", - "name_filter": "not linstor", + "name_filter": "not linstor and not zfsvol", }, "linstor-main": { "description": "tests the linstor storage driver, but avoids migrations and reboots", @@ -341,6 +341,9 @@ BROKEN_TESTS = [ # not really broken but has complex prerequisites (3 NICs on 3 different networks) "tests/migration/test_host_evacuate.py::TestHostEvacuateWithNetwork", + # running quicktest on zfsvol generates dangling TAP devices that are hard to + # cleanup. Bug needs to be fixed before enabling quicktest on zfsvol. + "tests/storage/zfsvol/test_zfsvol_sr.py::TestZfsvolVm::test_quicktest", ] # Returns the vm filename or None if a host_version is passed and matches the one specified diff --git a/tests/storage/zfsvol/test_zfsvol_sr.py b/tests/storage/zfsvol/test_zfsvol_sr.py index cc449e9c8..92b06880b 100755 --- a/tests/storage/zfsvol/test_zfsvol_sr.py +++ b/tests/storage/zfsvol/test_zfsvol_sr.py @@ -19,7 +19,8 @@ class TestZfsvolSRCreateDestroy: and VM import. """ - def test_create_and_destroy_sr(self, host, sr_disk_wiped): + def test_create_and_destroy_sr(self, sr_disk_wiped, host_with_zfsvol): + host = host_with_zfsvol # Create and destroy tested in the same test to leave the host as unchanged as possible sr = host.sr_create('zfs-vol', "ZFS-local-SR-test", {'device': '/dev/' + sr_disk_wiped}, verify=True) # import a VM in order to detect vm import issues here rather than in the vm_on_xfs_fixture used in From eb4c3a645010553f49e4ae6b3b571bbd2f0086dd Mon Sep 17 00:00:00 2001 From: Guillaume Date: Sun, 14 Apr 2024 12:04:10 +0200 Subject: [PATCH 2/2] Restart the toolstack After installing SMAPIv3 zfs volume plugin we need to restart the xapi toolstack. Signed-off-by: Guillaume --- tests/storage/zfsvol/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/storage/zfsvol/conftest.py b/tests/storage/zfsvol/conftest.py index a49912447..910240cd3 100644 --- a/tests/storage/zfsvol/conftest.py +++ b/tests/storage/zfsvol/conftest.py @@ -8,6 +8,7 @@ def host_with_zfsvol(host_with_saved_yum_state): host = host_with_saved_yum_state host.yum_install(['xcp-ng-xapi-storage-volume-zfsvol']) + host.restart_toolstack(verify=True) yield host @pytest.fixture(scope='package')