diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2020-07-31 15:06:15 +0100 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2020-08-20 14:45:40 +0100 |
commit | 427353f6689e236d6b35ce3ab2dacab7d61a0c77 (patch) | |
tree | 528c33f7b9ccad2e9c68dc5c129d50973e859772 /test/units | |
parent | 9ece644435c13ab01ce322b5c243fc2def3f4ec6 (diff) | |
download | systemd-427353f6689e236d6b35ce3ab2dacab7d61a0c77.tar.gz |
core: add mount options support for MountImages
Follow the same model established for RootImage and RootImageOptions,
and allow to either append a single list of options or tuples of
partition_number:options.
Diffstat (limited to 'test/units')
-rwxr-xr-x | test/units/testsuite-50.sh | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/test/units/testsuite-50.sh b/test/units/testsuite-50.sh index 8a9cedf375..376d4c9e23 100755 --- a/test/units/testsuite-50.sh +++ b/test/units/testsuite-50.sh @@ -164,25 +164,33 @@ 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" -# Now do some checks with MountImages, both by itself and in combination with RootImage, and as single FS or GPT image +# Now do some checks with MountImages, both by itself, with options and in combination with RootImage, and as single FS or GPT image systemd-run -t --property MountImages="${image}.gpt:/run/img1 ${image}.raw:/run/img2" /usr/bin/cat /run/img1/usr/lib/os-release | grep -q -F "MARKER=1" systemd-run -t --property MountImages="${image}.gpt:/run/img1 ${image}.raw:/run/img2" /usr/bin/cat /run/img2/usr/lib/os-release | grep -q -F "MARKER=1" +systemd-run -t --property MountImages="${image}.gpt:/run/img1 ${image}.raw:/run/img2:nosuid,dev" --property MountAPIVFS=yes mount | grep -F "squashfs" | grep -q -F "nosuid" +systemd-run -t --property MountImages="${image}.gpt:/run/img1:root:nosuid ${image}.raw:/run/img2:home:suid" --property MountAPIVFS=yes mount | grep -F "squashfs" | grep -q -F "nosuid" systemd-run -t --property MountImages="${image}.raw:/run/img2\:3" /usr/bin/cat /run/img2:3/usr/lib/os-release | grep -q -F "MARKER=1" +systemd-run -t --property MountImages="${image}.raw:/run/img2\:3:nosuid" --property MountAPIVFS=yes mount | grep -F "squashfs" | grep -q -F "nosuid" systemd-run -t --property TemporaryFileSystem=/run --property RootImage=${image}.raw --property MountImages="${image}.gpt:/run/img1 ${image}.raw:/run/img2" /usr/bin/cat /usr/lib/os-release | grep -q -F "MARKER=1" systemd-run -t --property TemporaryFileSystem=/run --property RootImage=${image}.raw --property MountImages="${image}.gpt:/run/img1 ${image}.raw:/run/img2" /usr/bin/cat /run/img1/usr/lib/os-release | grep -q -F "MARKER=1" systemd-run -t --property TemporaryFileSystem=/run --property RootImage=${image}.gpt --property RootHash=${roothash} --property MountImages="${image}.gpt:/run/img1 ${image}.raw:/run/img2" /usr/bin/cat /run/img2/usr/lib/os-release | grep -q -F "MARKER=1" -cat >/run/systemd/system/testservice-50.service <<EOF +cat >/run/systemd/system/testservice-50c.service <<EOF [Service] +MountAPIVFS=yes TemporaryFileSystem=/run RootImage=${image}.raw -MountImages=${image}.gpt:/run/img1 -MountImages=${image}.raw:/run/img2\:3 -ExecStart=/usr/bin/cat /run/img1/usr/lib/os-release -ExecStart=/usr/bin/cat /run/img2:3/usr/lib/os-release +MountImages=${image}.gpt:/run/img1:root:noatime:home:relatime +MountImages=${image}.raw:/run/img2\:3:nosuid +ExecStart=bash -c "cat /run/img1/usr/lib/os-release > /run/result/c" +ExecStart=bash -c "cat /run/img2:3/usr/lib/os-release >> /run/result/c" +ExecStart=bash -c "mount >> /run/result/c" +BindPaths=${image_dir}/result:/run/result Type=oneshot EOF -systemctl start testservice-50.service -journalctl -b -u testservice-50.service | grep -q -F "MARKER=1" +systemctl start testservice-50c.service +grep -q -F "MARKER=1" ${image_dir}/result/c +grep -F "squashfs" ${image_dir}/result/c | grep -q -F "noatime" +grep -F "squashfs" ${image_dir}/result/c | grep -q -F -v "nosuid" echo OK > /testok |