Skip to content

Commit

Permalink
Merge pull request #222 from xcp-ng/gtn-use-host-with-zfsvol
Browse files Browse the repository at this point in the history
Only host with zfsvol can create SR of type zfsvol
  • Loading branch information
stormi authored Apr 16, 2024
2 parents ef84569 + eb4c3a6 commit 4cca513
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/storage/zfsvol/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion tests/storage/zfsvol/test_zfsvol_sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4cca513

Please sign in to comment.