diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2022-12-12 16:27:02 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2022-12-12 16:27:02 +0000 |
commit | 12e2cbae8a0bf190c8e7d98de6c08aff57d2ae4f (patch) | |
tree | fad5218a0d5759c621db575ee318dfd836ccbbc8 /test/unit | |
parent | 648e91a623d3822e8ab4780b452da211ea3ba257 (diff) | |
download | unit-12e2cbae8a0bf190c8e7d98de6c08aff57d2ae4f.tar.gz unit-12e2cbae8a0bf190c8e7d98de6c08aff57d2ae4f.tar.bz2 |
Tests: stop execution if can't unmount any filesystem.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/utils.py | 11 |
1 files changed, 9 insertions, 2 deletions
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 |