From: Lucian Petrut Date: Thu, 17 Nov 2022 08:29:48 +0000 (+0200) Subject: qa: fix test_rbd_wnbd.py X-Git-Tag: v18.1.0~603^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5bab166663da3ab96f846566f743feeeaffeefaf;p=ceph.git qa: fix test_rbd_wnbd.py The rbd-wnbd Python test now fails as the wnbd driver changed the bus type from "virtual" to "SAS" in order to accommodate Microsoft Failover Cluster. SAS is considered a shared bus, so with the default SAN policy (offlineShared), the disks will be offline/read-only by default[1][2]. That being considered, we're updating the test to set the rw disk flag before attempting any write operations. [1] https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-partitionmanager-sanpolicy [2] https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/san Signed-off-by: Lucian Petrut --- diff --git a/qa/workunits/windows/test_rbd_wnbd.py b/qa/workunits/windows/test_rbd_wnbd.py index 0b9ae7c954c..b0cddc48b73 100644 --- a/qa/workunits/windows/test_rbd_wnbd.py +++ b/qa/workunits/windows/test_rbd_wnbd.py @@ -285,6 +285,13 @@ class RbdImage(object): def path(self): return f"\\\\.\\PhysicalDrive{self.disk_number}" + @Tracer.trace + def set_writable(self): + execute( + "powershell.exe", "-command", + "Set-Disk", "-Number", str(self.disk_number), + "-IsReadOnly", "$false") + @Tracer.trace def map(self, timeout: int = 60): LOG.info("Mapping image: %s", self.name) @@ -296,7 +303,9 @@ class RbdImage(object): self.disk_number = self.get_disk_number(timeout=timeout) elapsed = time.time() - tstart - self._wait_for_disk(timeout=timeout - elapsed, ) + self._wait_for_disk(timeout=timeout - elapsed) + + self.set_writable() @Tracer.trace def unmap(self):