summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Fu <vincentfu@gmail.com>2020-07-25 13:02:21 -0400
committerVincent Fu <vincentfu@gmail.com>2020-07-25 15:01:57 -0400
commit8854e36839aaa9f648df8fa10f914b0781d84222 (patch)
tree9bedfa4c2edb57296519ed599edd4c753890245c
parent1d458e5b8044d81b96cccfc82e3fd99cbb1eebf9 (diff)
downloadfio-8854e36839aaa9f648df8fa10f914b0781d84222.tar.gz
fio-8854e36839aaa9f648df8fa10f914b0781d84222.tar.bz2
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).
-rwxr-xr-xt/run-fio-tests.py13
1 files 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"