Skip to content

Commit 2ec6fe5

Browse files
Added test_linstor_sr_pool_update for rolling pool update with VM availability check.
It performs - An update of all hosts in a LINSTOR SR pool (starting with the master) - Reboots updated hosts - 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 2ec6fe5

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

tests/storage/linstor/test_linstor_sr.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,47 @@ 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 update on the Linstor SR pool hosts while ensuring VM availability.
139+
1. Identify all hosts in the SR pool and order them with the master first.
140+
2. Sequentially update each host.
141+
3. Sequentially reboot each host.
142+
4. Ensure that the VM can start on all hosts.
143+
"""
144+
145+
sr = linstor_sr
146+
vm = vm_on_linstor_sr
147+
updates_applied = []
148+
149+
# Sort hosts so that pool master is first
150+
hosts = sorted(sr.pool.hosts, key=lambda h: h != sr.pool.master)
151+
152+
# RPU is disabled for pools with XOSTOR SRs.
153+
# LINSTOR expects that we always use satellites and controllers with the same version on all hosts.
154+
155+
for h in hosts:
156+
logging.info("Checking on host %s", h.hostname_or_ip)
157+
if h.has_updates():
158+
h.install_updates()
159+
updates_applied.append(h)
160+
else:
161+
logging.info("No updates available for host %s", h.hostname_or_ip)
162+
163+
# Reboot updated hosts
164+
for h in updates_applied:
165+
h.reboot(verify=True)
166+
167+
# Ensure VM is able to boot on all the hosts
168+
for h in hosts:
169+
vm.start(on=h.uuid)
170+
vm.wait_for_os_booted()
171+
vm.shutdown(verify=True)
172+
173+
sr.scan()
174+
134175
# *** End of tests with reboots
135176

136177
# --- Test diskless resources --------------------------------------------------

0 commit comments

Comments
 (0)