debian-forge/test/mod
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
..
__init__.py test: '{. -> ./mod}/test_util_selinux.py' 2020-04-24 15:50:44 +02:00
test_api.py pipeline,api: write metadata directly 2022-12-09 12:03:40 +01:00
test_buildroot.py test: this test requires to be able to bindmount 2023-03-20 16:32:47 +01:00
test_fmt_v1.py objectstore: direct path i/o for Object 2022-11-21 17:26:53 +01:00
test_fmt_v2.py osbuild: auto-detect best available runner 2022-10-11 12:49:16 +02:00
test_host.py host: add support for emitting signals 2022-02-22 10:38:43 +01:00
test_loop.py osbuild: ensure loop.Loop() has the required device node 2023-11-24 16:05:52 +01:00
test_meta.py tests: remove custom tempdir_fixture 2023-11-22 12:46:19 +01:00
test_monitor.py osbuild: auto-detect best available runner 2022-10-11 12:49:16 +02:00
test_objectstore.py tests: remove custom tmpdir() fixtures and use tmp_path 2023-11-23 13:09:25 +01:00
test_osbuild.py test/osbuild: use proper object in stage run test 2022-12-09 12:03:40 +01:00
test_testutil_imports.py osbuild: add new testutil.imports module to help test stages 2023-11-07 15:12:08 +01:00
test_util_checksum.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
test_util_ctx.py util/ctx: extract suppress_oserror() 2020-05-11 18:05:12 +02:00
test_util_fscache.py util: tweak _calculate_size() to _calculate_space() 2023-11-22 10:28:08 +01:00
test_util_fscache_coherency.py test/fscache-coherency: add coherency tests 2022-12-20 16:56:32 +01:00
test_util_jsoncomm.py util/jsoncomm: add send_and_recv helper 2021-06-09 18:37:47 +01:00
test_util_linux.py linux: add Libc accessor with renameat2(2) 2022-12-06 09:48:38 +01:00
test_util_lorax.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
test_util_lvm2.py autopep8: Update with changes to make autopep8 -a -a -a happy 2023-08-10 13:04:14 +02:00
test_util_osrelease.py test: make TestBase inherit unittest.TestCase 2020-06-05 09:27:40 +02:00
test_util_ostree.py Test: some tests depending on rpm-ostree were not checking its presence 2023-04-28 22:02:35 +02:00
test_util_parsing.py util: add helper to parse size strings 2022-12-09 12:03:40 +01:00
test_util_path.py util/path: new clamp mtime function 2022-12-15 13:10:35 +00:00
test_util_pe32p.py util: add module to parse PE32+ files 2022-11-14 20:10:59 +01:00
test_util_rhsm.py global: fix PEP-8 formatting 2022-08-05 09:41:05 +02:00
test_util_rmrf.py test: convert to shared helpers 2020-05-13 14:26:05 +02:00
test_util_selinux.py util/selinux: add setfilecon method 2022-03-18 20:36:10 +01:00
test_util_udev.py devices: add custom udev rule inhibitor mechanism 2021-12-09 00:44:21 +00:00