debian-forge/test
Michael Vogt 158acaac78 osbuild: ensure loop.Loop() has the required device node
When loop.Loop() is called and a new loop device must be allocated
there is no gurantee that the correct device node is available on
the system. In containers /dev is often just a tmpfs with static
device nodes. So when /dev/loopN is not available when the
container is created the device node will be missing even if
`get_unbound()` create a new loop device for us.

This commit ensures that the device node is available. It creates
it unconditionally and ignores any EEXIST errors to ensure there
is no TOCTOU issue.

Note that the test could have passed a `Loop(dir_fd=open(tmpdir))`
instead of creating/patching loop.DEV_PATH but it seems slightly
nicer to test the flow without a custom dir_path as this is what
the real code that creates a loop device is also using.
2023-11-24 16:05:52 +01:00
..
cases tests: add metal output to fedora-coreos-container manifest 2023-11-14 23:58:08 +01:00
data test: fix broken oscap remediation tests 2023-11-24 14:28:34 +00:00
mod osbuild: ensure loop.Loop() has the required device node 2023-11-24 16:05:52 +01:00
run tests: remove custom tmpdir() fixtures and use tmp_path 2023-11-23 13:09:25 +01:00
.gitignore introduce testing script 2019-07-09 10:29:48 +02:00
__init__.py osbuild: add description() methods 2019-08-07 10:01:17 +02:00
conftest.py Test: add ability to skip tests for unsupported file-systems 2023-04-21 17:13:10 +02:00
initrd.py autopep8: Update with changes to make autopep8 -a -a -a happy 2023-08-10 13:04:14 +02:00
test.py test,tools: use sys.executable instead of hardcoding python3 2023-11-14 20:34:50 +01:00