From 6d39db96d23ebe0d4361d108fa202091aa9cbfc1 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 22 Oct 2018 14:52:59 +0100 Subject: iotests: Make nbd-fault-injector flush 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 Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Reviewed-by: Eric Blake Message-Id: <20181022135307.14398-2-mreitz@redhat.com> Signed-off-by: Eduardo Habkost --- tests/qemu-iotests/nbd-fault-injector.py | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/qemu-iotests/nbd-fault-injector.py') diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/nbd-fault-injector.py index f9193c0..439a090 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 -- cgit v1.1