From: Vincent Fu Date: Sat, 25 Jul 2020 17:02:21 +0000 (-0400) Subject: t/run-fio-tests: catch modprobe exceptions X-Git-Tag: fio-3.22~23^2~3 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=8854e36839aaa9f648df8fa10f914b0781d84222;p=fio.git 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). --- 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"