]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: Create analyze chroot with --rbind
authorRichard Maw <richard.maw@codethink.co.uk>
Mon, 27 Nov 2023 17:48:24 +0000 (17:48 +0000)
committerRichard Maw <richard.maw@codethink.co.uk>
Wed, 13 Dec 2023 13:35:04 +0000 (13:35 +0000)
The systemd-analyze integration test also tests chroots.
It builds its chroot by bind-mounting /,
but since /usr might be a separate mountpoint
it should create the chroot with --rbind.

test/units/testsuite-65.sh

index 6c819dfe4a4eebd94389dc6b6e7ac4964a0efcec..641573465109fe5ecd5c0ff55d2280a064e8bac9 100755 (executable)
@@ -179,7 +179,7 @@ systemd-analyze security --json=short | jq
 if [[ ! -v ASAN_OPTIONS ]]; then
     # check that systemd-analyze cat-config paths work in a chroot
     mkdir -p /tmp/root
-    mount --bind / /tmp/root
+    mount --rbind / /tmp/root
     systemd-analyze cat-config systemd/system-preset >/tmp/out1
     chroot /tmp/root systemd-analyze cat-config systemd/system-preset >/tmp/out2
     diff /tmp/out{1,2}