[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/11] iotests.py: qemu_nbd_popen: remove pid file after use
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH 08/11] iotests.py: qemu_nbd_popen: remove pid file after use |
Date: |
Wed, 18 Nov 2020 21:04:30 +0300 |
To note interfere with other qemu_nbd_popen() calls in same test.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
tests/qemu-iotests/iotests.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index bcd4fe5b6f..6df280a97e 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -291,7 +291,9 @@ def qemu_nbd_list_log(*args: str) -> str:
@contextmanager
def qemu_nbd_popen(*args):
'''Context manager running qemu-nbd within the context'''
- pid_file = file_path("pid")
+ pid_file = file_path("qemu_nbd_popen-nbd-pid-file")
+
+ assert not os.path.exists(pid_file)
cmd = list(qemu_nbd_args)
cmd.extend(('--persistent', '--pid-file', pid_file))
@@ -309,6 +311,8 @@ def qemu_nbd_popen(*args):
time.sleep(0.01)
yield
finally:
+ if os.path.exists(pid_file):
+ os.remove(pid_file)
log('Kill NBD server')
p.kill()
p.wait()
--
2.21.3
- [PATCH 00/11] mirror: cancel nbd reconnect, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 01/11] block: add new BlockDriver handler: bdrv_cancel_in_flight, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 02/11] block/nbd: implement .bdrv_cancel_in_flight, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 03/11] block/raw-format: implement .bdrv_cancel_in_flight handler, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 04/11] job: add .cancel handler for the driver, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 05/11] block/mirror: implement .cancel job handler, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 06/11] iotests/264: fix style, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 07/11] iotests/264: move to python unittest, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 09/11] iotests/264: add mirror-cancel test-case, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 08/11] iotests.py: qemu_nbd_popen: remove pid file after use,
Vladimir Sementsov-Ogievskiy <=
- [PATCH 11/11] iotests/264: add backup-cancel test-case, Vladimir Sementsov-Ogievskiy, 2020/11/18
- [PATCH 10/11] block/backup: implement .cancel job handler, Vladimir Sementsov-Ogievskiy, 2020/11/18
- Re: [PATCH 00/11] mirror: cancel nbd reconnect, Eric Blake, 2020/11/18