Skip to content

Commit ec0613c

Browse files
storage/linstor: add test for VDI resize support
Implemented `test_resize_vdi` in LINSTOR, verifying VDI resize functionality and ensuring VM boot post-resize. Co-authored-by: Alexandre Sollier <alexandre.sollier@vates.tech> Signed-off-by: Rushikesh Jadhav <rushikesh7@gmail.com> Signed-off-by: Alexandre Sollier <alexandre.sollier@vates.tech>
1 parent 9d8c607 commit ec0613c

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

tests/storage/linstor/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ def pool_with_linstor(
118118
import concurrent.futures
119119
pool = pool_with_saved_yum_state
120120

121-
def check_linstor_installed(host: Host) -> None:
121+
def ensure_linstor_not_installed(host: Host) -> None:
122122
if host.is_package_installed(LINSTOR_PACKAGE):
123123
raise Exception(
124124
f'{LINSTOR_PACKAGE} is already installed on host {host}. This should not be the case.'
125125
)
126126

127127
with concurrent.futures.ThreadPoolExecutor() as executor:
128-
executor.map(check_linstor_installed, pool.hosts)
128+
executor.map(ensure_linstor_not_installed, pool.hosts)
129129

130130
def install_linstor(host: Host) -> None:
131131
logging.info(f"Installing {LINSTOR_PACKAGE} on host {host}...")

tests/storage/linstor/test_linstor_sr.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,23 @@ def test_resynchronization(
189189
finally:
190190
vm.shutdown(verify=True)
191191

192+
@pytest.mark.small_vm
193+
@pytest.mark.big_vm
194+
def test_resize_vdi(self, vm_on_linstor_sr: VM) -> None:
195+
vm = vm_on_linstor_sr
196+
if vm.is_running():
197+
vm.shutdown(verify=True)
198+
199+
for vdi in vm.vdis:
200+
size = vdi.get_virtual_size()
201+
vdi.resize(size * 2)
202+
assert vdi.get_virtual_size() == size * 2
203+
204+
# Make sure the VM still starts up successfully after resizing
205+
vm.start()
206+
vm.wait_for_os_booted()
207+
vm.shutdown(verify=True)
208+
192209
# *** tests with reboots (longer tests).
193210

194211
@pytest.mark.reboot

0 commit comments

Comments
 (0)