From 15e4d0d3a18e873ff9079e827765e4d00cb65245 Mon Sep 17 00:00:00 2001 From: David Rheinsberg Date: Thu, 7 May 2020 08:16:40 +0200 Subject: [PATCH] test/assemblers: do not fail on modprobe failure This changes the `modprobe nbd` invocation to be non-fatal on failure, since it might very well fail on reasonable setups. `modprobe` fails if it cannot find a module in `/lib/modules`, even if it could reasonably well figure out whether a module is already loaded. The reason is that it needs the metadata from the module file to find the required modules parameters. If you have `nbd` already loaded but not mapped in `/lib/modules`, the current call will cause test failures, even though the test would run smoothly. Fix this by never requiring `modprobe nbd` to succeed, but instead rely on the tests failing if accessing `nbd` fails. --- test/test_assemblers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_assemblers.py b/test/test_assemblers.py index 3f6c75d9..c8db9075 100644 --- a/test/test_assemblers.py +++ b/test/test_assemblers.py @@ -14,7 +14,7 @@ class TestAssemblers(osbuildtest.TestCase): @classmethod def setUpClass(cls): super().setUpClass() - subprocess.run(["modprobe", "nbd"], check=True) + subprocess.run(["modprobe", "nbd"], check=False) def run_assembler(self, name, options): with open("test/pipelines/f30-base.json") as f: