From 12e2cbae8a0bf190c8e7d98de6c08aff57d2ae4f Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Mon, 12 Dec 2022 16:27:02 +0000 Subject: Tests: stop execution if can't unmount any filesystem. --- test/unit/utils.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test/unit/utils.py') diff --git a/test/unit/utils.py b/test/unit/utils.py index f9e9d08a..d6590b97 100644 --- a/test/unit/utils.py +++ b/test/unit/utils.py @@ -72,12 +72,19 @@ def waitforsocket(port): pytest.fail('Can\'t connect to the 127.0.0.1:' + str(port)) -def findmnt(): +def check_findmnt(): try: - out = subprocess.check_output( + return subprocess.check_output( ['findmnt', '--raw'], stderr=subprocess.STDOUT ).decode() except FileNotFoundError: + return False + + +def findmnt(): + out = check_findmnt() + + if not out: pytest.skip('requires findmnt') return out -- cgit