[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v3 1/9] iotests: Make nbd-fault-injector flush
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH v3 1/9] iotests: Make nbd-fault-injector flush |
Date: |
Mon, 22 Oct 2018 14:52:59 +0100 |
When closing a connection, make the nbd-fault-injector flush the socket.
Without this, the output is a bit unreliable with Python 3.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Cleber Rosa <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
tests/qemu-iotests/083.out | 9 +++++++++
tests/qemu-iotests/nbd-fault-injector.py | 1 +
2 files changed, 10 insertions(+)
diff --git a/tests/qemu-iotests/083.out b/tests/qemu-iotests/083.out
index be6079d27e..f9af8bb691 100644
--- a/tests/qemu-iotests/083.out
+++ b/tests/qemu-iotests/083.out
@@ -41,6 +41,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/foo
=== Check disconnect after neg2 ===
+Unable to read from socket: Connection reset by peer
Connection closed
read failed: Input/output error
@@ -54,6 +55,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/foo
=== Check disconnect before request ===
+Unable to read from socket: Connection reset by peer
Connection closed
read failed: Input/output error
@@ -116,6 +118,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/
=== Check disconnect after neg-classic ===
+Unable to read from socket: Connection reset by peer
Connection closed
read failed: Input/output error
@@ -161,6 +164,8 @@ can't open device nbd+unix:///foo?socket=TEST_DIR/nbd.sock
=== Check disconnect after neg2 ===
+Unable to read from socket: Connection reset by peer
+Connection closed
read failed: Input/output error
=== Check disconnect 8 neg2 ===
@@ -173,6 +178,8 @@ can't open device nbd+unix:///foo?socket=TEST_DIR/nbd.sock
=== Check disconnect before request ===
+Unable to read from socket: Connection reset by peer
+Connection closed
read failed: Input/output error
=== Check disconnect after request ===
@@ -234,6 +241,8 @@ can't open device nbd+unix:///?socket=TEST_DIR/nbd.sock
=== Check disconnect after neg-classic ===
+Unable to read from socket: Connection reset by peer
+Connection closed
read failed: Input/output error
*** done
diff --git a/tests/qemu-iotests/nbd-fault-injector.py
b/tests/qemu-iotests/nbd-fault-injector.py
index f9193c0fae..439a090eb6 100755
--- a/tests/qemu-iotests/nbd-fault-injector.py
+++ b/tests/qemu-iotests/nbd-fault-injector.py
@@ -112,6 +112,7 @@ class FaultInjectionSocket(object):
if rule.match(event, io):
if rule.when == 0 or bufsize is None:
print('Closing connection on rule match %s' % rule.name)
+ self.sock.flush()
sys.exit(0)
if rule.when != -1:
return rule.when
--
2.17.1
- [Qemu-block] [PATCH v3 0/9] iotests: Make them work for both Python 2 and 3, Max Reitz, 2018/10/22
- [Qemu-block] [PATCH v3 1/9] iotests: Make nbd-fault-injector flush,
Max Reitz <=
- [Qemu-block] [PATCH v3 2/9] iotests: Flush in iotests.py's QemuIoInteractive, Max Reitz, 2018/10/22
- [Qemu-block] [PATCH v3 3/9] iotests: Use Python byte strings where appropriate, Max Reitz, 2018/10/22
- [Qemu-block] [PATCH v3 4/9] iotests: Use // for Python integer division, Max Reitz, 2018/10/22
- [Qemu-block] [PATCH v3 5/9] iotests: Different iterator behavior in Python 3, Max Reitz, 2018/10/22
- [Qemu-block] [PATCH v3 7/9] iotests: 'new' module replacement in 169, Max Reitz, 2018/10/22
- [Qemu-block] [PATCH v3 6/9] iotests: Explicitly bequeath FDs in Python, Max Reitz, 2018/10/22
- [Qemu-block] [PATCH v3 8/9] iotests: Modify imports for Python 3, Max Reitz, 2018/10/22
- [Qemu-block] [PATCH v3 9/9] iotests: Unify log outputs between Python 2 and 3, Max Reitz, 2018/10/22
- Re: [Qemu-block] [PATCH v3 0/9] iotests: Make them work for both Python 2 and 3, Eduardo Habkost, 2018/10/26