On 7/6/22 13:26, Hanna Reitz wrote:
On 05.07.22 17:37, Vladimir Sementsov-Ogievskiy wrote:
strerror() represents ETIMEDOUT a bit different in Linux and macOS /
FreeBSD. Let's support the latter too.

Fixes: 9d05a87b77 ("iotests: copy-before-write: add cases for cbw-timeout 
option")
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>
---

As John and Thomas noted, the new iotests fails for FreeBSD and maxOS.
Here is a fix. Would be great if someone can test it.

I tried to push it by

   git push --force  -o ci.variable="QEMU_CI=1"

to my block branch, I get a blocked pipeline
https://gitlab.com/vsementsov/qemu/-/pipelines/580573238
but it doesn't have neither freebsd nor macos jobs.. How to get them?

  tests/qemu-iotests/tests/copy-before-write | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/tests/qemu-iotests/tests/copy-before-write 
b/tests/qemu-iotests/tests/copy-before-write
index 16efebbf8f..56937b9dff 100755
--- a/tests/qemu-iotests/tests/copy-before-write
+++ b/tests/qemu-iotests/tests/copy-before-write
@@ -192,6 +192,11 @@ read 1048576/1048576 bytes at offset 0
      def test_timeout_break_guest(self):
          log = self.do_cbw_timeout('break-guest-write')
+        # macOS and FreeBSD tend to represent ETIMEDOUT as
+        # "Operation timed out", when Linux prefer
+        # "Connection timed out"
+        log = log.replace('Operation timed out',
+                          'Connection timed out')

If we know for sure that it’s ETIMEDOUT, how about os.strerror(errno.ETIMEDOUT)?

I've checked this with make vm-build-freebsd, but it doesn't work:

--- 
/home/qemu/qemu-test.fxwm16/src/tests/qemu-iotests/tests/copy-before-write.out
+++ 
/usr/home/qemu/qemu-test.fxwm16/build/tests/qemu-iotests/scratch/copy-before-write.out.bad
@@ -1,5 +1,22 @@
-....
+..F.
+======================================================================
+FAIL: test_timeout_break_guest (__main__.TestCbwError)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+  File 
"/usr/home/qemu/qemu-test.fxwm16/src/tests/qemu-iotests/tests/copy-before-write",
 line 207, in test_timeout_break_guest
+    """)
+AssertionError: 'wrot[102 chars]led: Connection timed out\nread 
1048576/104857[73 chars]c)\n' != 'wrot[102 chars]led: Operation timed out\nread 
1048576/1048576[72 chars]c)\n'
+  wrote 524288/524288 bytes at offset 0
+  512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+- write failed: Connection timed out
+?               ^^^^ ^
++ write failed: Operation timed out
+?               ^^ ^^
+  read 1048576/1048576 bytes at offset 0
+  1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+
 ----------------------------------------------------------------------
 Ran 4 tests


Probably pythonic os.strerror doesn't correspond to what we have in C..

So, let's just go with my fix.

--
Best regards,
Vladimir

Reply via email to