summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2020-08-14 19:50:46 +0200
committerLuca Boccassi <bluca@debian.org>2020-08-20 14:58:02 +0200
commit9ece644435c13ab01ce322b5c243fc2def3f4ec6 (patch)
tree55a3f3607e31527e93114457a77af72caafb1729 /test
parentcore: use strv_split_colon_pairs when parsing RootImageOptions (diff)
downloadsystemd-9ece644435c13ab01ce322b5c243fc2def3f4ec6.tar.xz
systemd-9ece644435c13ab01ce322b5c243fc2def3f4ec6.zip
core: change RootImageOptions to use names instead of partition numbers
Follow the designations from the Discoverable Partitions Specification
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/testsuite-50.sh25
1 files changed, 15 insertions, 10 deletions
diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh
index bb3b20da3e..8a9cedf375 100755
--- a/test/units/testsuite-50.sh
+++ b/test/units/testsuite-50.sh
@@ -128,33 +128,38 @@ umount ${image_dir}/mount
systemd-run -t --property RootImage=${image}.gpt --property RootHash=${roothash} /usr/bin/cat /usr/lib/os-release | grep -q -F "MARKER=1"
-systemd-run -t --property RootImage=${image}.raw --property RootImageOptions="1:ro,noatime 2:ro,dev nosuid,dev" --property MountAPIVFS=yes mount | grep -F "squashfs" | grep -q -F "nosuid"
-systemd-run -t --property RootImage=${image}.gpt --property RootImageOptions="1:ro,noatime 1:ro,dev" --property MountAPIVFS=yes mount | grep -F "squashfs" | grep -q -F "noatime"
+systemd-run -t --property RootImage=${image}.raw --property RootImageOptions="root:nosuid,dev home:ro,dev ro,noatime" --property MountAPIVFS=yes mount | grep -F "squashfs" | grep -q -F "nosuid"
+systemd-run -t --property RootImage=${image}.gpt --property RootImageOptions="root:ro,noatime root:ro,dev" --property MountAPIVFS=yes mount | grep -F "squashfs" | grep -q -F "noatime"
+mkdir -p mkdir -p ${image_dir}/result
cat > /run/systemd/system/testservice-50a.service <<EOF
[Service]
Type=oneshot
-ExecStart=mount
+ExecStart=bash -c "mount > /run/result/a"
+BindPaths=${image_dir}/result:/run/result
+TemporaryFileSystem=/run
MountAPIVFS=yes
RootImage=${image}.raw
-RootImageOptions=1:ro,noatime,nosuid 2:ro,dev noatime,dev
+RootImageOptions=root:ro,noatime home:ro,dev relatime,dev
RootImageOptions=nosuid,dev
EOF
systemctl start testservice-50a.service
-journalctl -b -u testservice-50a.service | grep -F "squashfs" | grep -q -F "noatime"
-journalctl -b -u testservice-50a.service | grep -F "squashfs" | grep -q -F -v "nosuid"
+grep -F "squashfs" ${image_dir}/result/a | grep -q -F "noatime"
+grep -F "squashfs" ${image_dir}/result/a | grep -q -F -v "nosuid"
cat > /run/systemd/system/testservice-50b.service <<EOF
[Service]
Type=oneshot
-ExecStart=mount
+ExecStart=bash -c "mount > /run/result/b"
+BindPaths=${image_dir}/result:/run/result
+TemporaryFileSystem=/run
MountAPIVFS=yes
RootImage=${image}.gpt
-RootImageOptions=1:ro,noatime,nosuid 2:ro,dev nosuid,dev
-RootImageOptions=2:ro,dev nosuid,dev,%%foo
+RootImageOptions=root:ro,noatime,nosuid home:ro,dev nosuid,dev
+RootImageOptions=home:ro,dev nosuid,dev,%%foo
EOF
systemctl start testservice-50b.service
-journalctl -b -u testservice-50b.service | grep -F "squashfs" | grep -q -F "noatime"
+grep -F "squashfs" ${image_dir}/result/b | grep -q -F "noatime"
# Check that specifier escape is applied %%foo -> %foo
busctl get-property org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/testservice_2d50b_2eservice org.freedesktop.systemd1.Service RootImageOptions | grep -F "nosuid,dev,%foo"