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.
This commit is contained in:
David Rheinsberg 2020-05-07 08:16:40 +02:00 committed by Tom Gundersen
parent ad50259ace
commit 15e4d0d3a1

View file

@ -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: