Skip to content

Commit 3b66cbf

Browse files
committed
Robustify LINSTOR _get_diskful_hosts test to ignore OLD volumes
Without this change we can have a result like that: ``` linstor-kv-tool --dump-volumes -g xcp-sr-linstor_group_thin_device | grep volume-name | grep fe2bc8da-8bff-4543-bfd9-587b48b5cbe7 "xcp/volume/OLD_fe2bc8da-8bff-4543-bfd9-587b48b5cbe7/volume-name": "xcp-volume-2154355c-2c55-469f-aac2-6c778d6a28b9", "xcp/volume/fe2bc8da-8bff-4543-bfd9-587b48b5cbe7/volume-name": "xcp-volume-2cb7798f-dfbc-45f1-b9c3-47c6a0b07856" ``` In this situation we use `xcp-volume-2154355c-2c55-469f-aac2-6c778d6a28b9` instead of `xcp-volume-2cb7798f-dfbc-45f1-b9c3-47c6a0b07856`. As a reminder, the `OLD_` prefix is ​​used by the GC internally and we don't want to expose these volumes. Therefore, it is necessary to use `grep` with slashes to match the exact XAPI/LINSTOR UUIDs of the volume. Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 5e53607 commit 3b66cbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/storage/linstor/test_linstor_sr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_diskless_kept(self, host, linstor_sr, vm_on_linstor_sr, storage_pool_na
186186
# "xcp/volume/{vdi_uuid}/volume-name": "{volume_name}"
187187
output = host.ssh([
188188
"linstor-kv-tool", "--dump-volumes", "-g", sr_group_name,
189-
"|", "grep", "volume-name", "|", "grep", vdi_uuid
189+
"|", "grep", "volume-name", "|", "grep", f"/{vdi_uuid}/"
190190
])
191191
volume_name = output.split(': ')[1].split('"')[1]
192192

0 commit comments

Comments
 (0)