]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-65: check cat-config operation in chroot
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 5 Dec 2022 12:52:28 +0000 (13:52 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 7 Dec 2022 11:38:10 +0000 (12:38 +0100)
This verifies the fix in 2075b6dd394e09a0f203b9cc7e3253908397f933.

test/test-functions
test/units/testsuite-65.sh

index a87b7b966d1a5064ac11d4876b3f4da0e3534560..9aa9c37a9e532ad9608aa4845465d75186b2f11a 100644 (file)
@@ -158,6 +158,7 @@ BASICTOOLS=(
     cat
     chmod
     chown
+    chroot
     cmp
     cryptsetup
     cut
index 1f34308b44cdc41a1398c9fddfbca929ef22f0bd..ebe1f57b52f181e2005fc336af7b4b2f59f74056 100755 (executable)
@@ -139,6 +139,16 @@ systemd-analyze cat-config systemd/system.conf systemd/journald.conf >/dev/null
 systemd-analyze cat-config systemd/system.conf foo/bar systemd/journald.conf >/dev/null
 systemd-analyze cat-config foo/bar
 
+if [[ ! -v ASAN_OPTIONS ]]; then
+    # check that systemd-analyze cat-config paths work in a chroot
+    mkdir -p /tmp/root
+    mount --bind / /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}
+fi
+
+# verify
 mkdir -p /tmp/img/usr/lib/systemd/system/
 mkdir -p /tmp/img/opt/