From 8854e36839aaa9f648df8fa10f914b0781d84222 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Sat, 25 Jul 2020 13:02:21 -0400 Subject: [PATCH] t/run-fio-tests: catch modprobe exceptions Catch exceptions that occur when running modprobe in case the build environment has it disabled (e.g., AWS CodeBuild). --- t/run-fio-tests.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/t/run-fio-tests.py b/t/run-fio-tests.py index c116bf5a..7e4120f4 100755 --- a/t/run-fio-tests.py +++ b/t/run-fio-tests.py @@ -485,11 +485,14 @@ class Requirements(object): Requirements._root = (os.geteuid() == 0) if Requirements._zbd and Requirements._root: - subprocess.run(["modprobe", "null_blk"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - if os.path.exists("/sys/module/null_blk/parameters/zoned"): - Requirements._zoned_nullb = True + try: + subprocess.run(["modprobe", "null_blk"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + if os.path.exists("/sys/module/null_blk/parameters/zoned"): + Requirements._zoned_nullb = True + except Exception: + pass if platform.system() == "Windows": utest_exe = "unittest.exe" -- 2.25.1