Skip to content

Commit 25af1c3

Browse files
Added test_linstor_sr_pool_update for rolling pool update with VM availability check.
It performs - A rolling update and reboot of all hosts in a LINSTOR SR pool (starting with the master). - Verifies VM can start and shutdown successfully on each host after update. - Ensures SR remains usable throughout the process. Signed-off-by: Rushikesh Jadhav <[email protected]>
1 parent 4fbe63e commit 25af1c3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/storage/linstor/test_linstor_sr.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,32 @@ def test_linstor_missing(self, linstor_sr, host):
131131
if not linstor_installed:
132132
host.yum_install([LINSTOR_PACKAGE])
133133

134+
@pytest.mark.reboot
135+
@pytest.mark.small_vm
136+
def test_linstor_sr_pool_update(self, linstor_sr, vm_on_linstor_sr):
137+
"""
138+
Perform a rolling update on the Linstor SR pool while ensuring VM availability.
139+
1. Identify all hosts in the SR pool and order them with the master first.
140+
2. Sequentially update and reboot each host while ensuring the VM can start on it.
141+
"""
142+
143+
sr = linstor_sr
144+
vm = vm_on_linstor_sr
145+
146+
hosts = sorted(sr.pool.hosts, key=lambda h: h != sr.pool.master)
147+
148+
# Ensure that VM is able to start on all post applying available updates on hosts, starting with master
149+
for h in hosts:
150+
logging.info("Checking on host %s", h.hostname_or_ip)
151+
if h.has_updates():
152+
h.install_updates()
153+
h.reboot(verify=True)
154+
vm.start(on=h.uuid)
155+
vm.wait_for_os_booted()
156+
vm.shutdown(verify=True)
157+
158+
sr.scan()
159+
134160
# *** End of tests with reboots
135161

136162
# --- Test diskless resources --------------------------------------------------

0 commit comments

Comments
 (0)