Skip to content

Commit

Permalink
restart toolstack in test_linstor_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Wescoeur committed Jun 27, 2023
1 parent b2bcbed commit b1d84c9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/storage/linstor/test_linstor_sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@ def test_reboot(self, vm_on_linstor_sr, host, linstor_sr):

@pytest.mark.reboot
def test_linstor_missing(self, linstor_sr, host):
packages = ['python-linstor', 'linstor-client']
sr = linstor_sr
linstor_installed = True
try:
host.yum_remove(packages)
host.yum_remove(['python-linstor', 'linstor-client'])
linstor_installed = False
try:
sr.scan()
Expand All @@ -104,8 +103,14 @@ def test_linstor_missing(self, linstor_sr, host):
time.sleep(10)
logging.info("Assert PBD not attached")
assert not sr.all_pbds_attached()
host.yum_install(packages)
host.yum_install(['xcp-ng-linstor'])
linstor_installed = True

# Needed because the linstor driver is not in the xapi
# sm-plugins list because xcp-ng-linstor RPM has been
# removed by the `yum remove ...` call.
host.restart_toolstack(verify=True)

sr.plug_pbds(verify=True)
sr.scan()
finally:
Expand Down

0 comments on commit b1d84c9

Please sign in to comment.