diff --git a/test/units/TEST-50-DISSECT.dissect.sh b/test/units/TEST-50-DISSECT.dissect.sh index 9a05899cabc..53ff198d166 100755 --- a/test/units/TEST-50-DISSECT.dissect.sh +++ b/test/units/TEST-50-DISSECT.dissect.sh @@ -9,12 +9,6 @@ set -o pipefail # shellcheck source=test/units/util.sh . "$(dirname "$0")"/util.sh -BIND_LOG_SOCKETS=( - --property BindReadOnlyPaths=/dev/log - --property BindReadOnlyPaths=/run/systemd/journal/socket - --property BindReadOnlyPaths=/run/systemd/journal/stdout -) - systemd-dissect --json=short "$MINIMAL_IMAGE.raw" | \ grep -q -F '{"rw":"ro","designator":"root","partition_uuid":null,"partition_label":null,"fstype":"squashfs","architecture":null,"verity":"external"' systemd-dissect "$MINIMAL_IMAGE.raw" | grep -q -F "MARKER=1" @@ -80,21 +74,19 @@ fi systemd-dissect --umount "$IMAGE_DIR/mount" systemd-dissect --umount "$IMAGE_DIR/mount2" -systemd-run -P -p RootImage="$MINIMAL_IMAGE.raw" "${BIND_LOG_SOCKETS[@]}" cat /usr/lib/os-release | grep -q -F "MARKER=1" +systemd-run -P -p RootImage="$MINIMAL_IMAGE.raw" cat /usr/lib/os-release | grep -q -F "MARKER=1" mv "$MINIMAL_IMAGE.verity" "$MINIMAL_IMAGE.fooverity" mv "$MINIMAL_IMAGE.roothash" "$MINIMAL_IMAGE.foohash" systemd-run -P \ -p RootImage="$MINIMAL_IMAGE.raw" \ -p RootHash="$MINIMAL_IMAGE.foohash" \ -p RootVerity="$MINIMAL_IMAGE.fooverity" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1" # Let's use the long option name just here as a test systemd-run -P \ --property RootImage="$MINIMAL_IMAGE.raw" \ --property RootHash="$MINIMAL_IMAGE_ROOTHASH" \ --property RootVerity="$MINIMAL_IMAGE.fooverity" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1" mv "$MINIMAL_IMAGE.fooverity" "$MINIMAL_IMAGE.verity" mv "$MINIMAL_IMAGE.foohash" "$MINIMAL_IMAGE.roothash" @@ -142,56 +134,48 @@ systemd-run --wait -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1" systemd-run --wait -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p RootImagePolicy='*' \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1" (! systemd-run --wait -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p RootImagePolicy='~' \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1") (! systemd-run --wait -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p RootImagePolicy='-' \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1") (! systemd-run --wait -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p RootImagePolicy='root=absent' \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1") systemd-run --wait -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p RootImagePolicy='root=verity' \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1" systemd-run --wait -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p RootImagePolicy='root=signed' \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1" (! systemd-run --wait -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p RootImagePolicy='root=encrypted' \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1") systemd-dissect --root-hash "$MINIMAL_IMAGE_ROOTHASH" --mount "$MINIMAL_IMAGE.gpt" "$IMAGE_DIR/mount" @@ -211,17 +195,14 @@ systemd-run -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p MountAPIVFS=yes \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1" systemd-run -P \ -p RootImage="$MINIMAL_IMAGE.raw" \ -p RootImageOptions="root:nosuid,dev home:ro,dev ro,noatime" \ - "${BIND_LOG_SOCKETS[@]}" \ mount | grep -F "squashfs" | grep -q -F "nosuid" systemd-run -P \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootImageOptions="root:ro,noatime root:ro,dev" \ - "${BIND_LOG_SOCKETS[@]}" \ mount | grep -F "squashfs" | grep -q -F "noatime" mkdir -p "$IMAGE_DIR/result" @@ -234,7 +215,6 @@ TemporaryFileSystem=/run RootImage=$MINIMAL_IMAGE.raw RootImageOptions=root:ro,noatime home:ro,dev relatime,dev RootImageOptions=nosuid,dev -BindReadOnlyPaths=/dev/log /run/systemd/journal/socket /run/systemd/journal/stdout EOF systemctl start testservice-50a.service grep -F "squashfs" "$IMAGE_DIR/result/a" | grep -q -F "noatime" @@ -251,7 +231,6 @@ RootImageOptions=root:ro,noatime,nosuid home:ro,dev nosuid,dev RootImageOptions=home:ro,dev nosuid,dev,%%foo # this is the default, but let's specify once to test the parser MountAPIVFS=yes -BindReadOnlyPaths=/dev/log /run/systemd/journal/socket /run/systemd/journal/stdout EOF systemctl start testservice-50b.service grep -F "squashfs" "$IMAGE_DIR/result/b" | grep -q -F "noatime" @@ -284,27 +263,23 @@ systemd-run -P \ -p TemporaryFileSystem=/run \ -p RootImage="$MINIMAL_IMAGE.raw" \ -p MountImages="$MINIMAL_IMAGE.gpt:/run/img1 $MINIMAL_IMAGE.raw:/run/img2" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/os-release | grep -q -F "MARKER=1" systemd-run -P \ -p TemporaryFileSystem=/run \ -p RootImage="$MINIMAL_IMAGE.raw" \ -p MountImages="$MINIMAL_IMAGE.gpt:/run/img1 $MINIMAL_IMAGE.raw:/run/img2" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /run/img1/usr/lib/os-release | grep -q -F "MARKER=1" systemd-run -P \ -p TemporaryFileSystem=/run \ -p RootImage="$MINIMAL_IMAGE.gpt" \ -p RootHash="$MINIMAL_IMAGE_ROOTHASH" \ -p MountImages="$MINIMAL_IMAGE.gpt:/run/img1 $MINIMAL_IMAGE.raw:/run/img2" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /run/img2/usr/lib/os-release | grep -q -F "MARKER=1" cat >/run/systemd/system/testservice-50c.service </run/result/c" @@ -352,42 +327,34 @@ systemctl is-active testservice-50d.service systemd-run -P \ --property ExtensionImages=/tmp/app0.raw \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /opt/script0.sh | grep -q -F "extension-release.app0" systemd-run -P \ --property ExtensionImages=/tmp/app0.raw \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/systemd/system/some_file | grep -q -F "MARKER=1" systemd-run -P \ --property ExtensionImages="/tmp/app0.raw /tmp/app1.raw" \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /opt/script0.sh | grep -q -F "extension-release.app0" systemd-run -P \ --property ExtensionImages="/tmp/app0.raw /tmp/app1.raw" \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/systemd/system/some_file | grep -q -F "MARKER=1" systemd-run -P \ --property ExtensionImages="/tmp/app0.raw /tmp/app1.raw" \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /opt/script1.sh | grep -q -F "extension-release.app2" systemd-run -P \ --property ExtensionImages="/tmp/app0.raw /tmp/app1.raw" \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/systemd/system/other_file | grep -q -F "MARKER=1" systemd-run -P \ --property ExtensionImages=/tmp/app-nodistro.raw \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/systemd/system/some_file | grep -q -F "MARKER=1" systemd-run -P \ --property ExtensionImages=/etc/service-scoped-test.raw \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /etc/systemd/system/some_file | grep -q -F "MARKER_CONFEXT_123" # Check that two identical verity images at different paths do not fail with -ELOOP from OverlayFS @@ -412,7 +379,6 @@ ln -fs /tmp/symlink-test/app-nodistro-v1.raw /tmp/symlink-test/app-nodistro.raw systemd-run -P \ --property ExtensionImages=/tmp/symlink-test/app-nodistro.raw \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/systemd/system/some_file | grep -q -F "MARKER=1" # Symlink check again but for confext @@ -422,20 +388,17 @@ ln -fs /etc/symlink-test/service-scoped-test-v1.raw /etc/symlink-test/service-sc systemd-run -P \ --property ExtensionImages=/etc/symlink-test/service-scoped-test.raw \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /etc/systemd/system/some_file | grep -q -F "MARKER_CONFEXT_123" # And again mixing sysext and confext systemd-run -P \ --property ExtensionImages=/tmp/symlink-test/app-nodistro.raw \ --property ExtensionImages=/etc/symlink-test/service-scoped-test.raw \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /etc/systemd/system/some_file | grep -q -F "MARKER_CONFEXT_123" systemd-run -P \ --property ExtensionImages=/tmp/symlink-test/app-nodistro.raw \ --property ExtensionImages=/etc/symlink-test/service-scoped-test.raw \ --property RootImage="$MINIMAL_IMAGE.raw" \ - "${BIND_LOG_SOCKETS[@]}" \ cat /usr/lib/systemd/system/some_file | grep -q -F "MARKER=1" cat >/run/systemd/system/testservice-50e.service </run/systemd/system/testservice-50f.service <