summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2016-12-13 11:34:09 +0000
committerEvgeny Vereshchagin <evvers@ya.ru>2016-12-13 13:03:13 +0000
commita6f72863adda77b3b6c7b08b0c85f41c6ba2a6d1 (patch)
tree1d15a7eebe561c2e44d732d3c13acfc8b7e39359 /test
parentfcb2427055bc2e1d8f009ebf3b4d8b1b2bb14faa (diff)
machine-id-setup: `--print --commit` respects the --root option
Diffstat (limited to 'test')
-rwxr-xr-xtest/TEST-14-MACHINE-ID/test.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/TEST-14-MACHINE-ID/test.sh b/test/TEST-14-MACHINE-ID/test.sh
index 1423bd891f..201d5281da 100755
--- a/test/TEST-14-MACHINE-ID/test.sh
+++ b/test/TEST-14-MACHINE-ID/test.sh
@@ -80,6 +80,17 @@ echo abc >>"$r/etc/machine-id"
id=$(systemd-machine-id-setup --print --root "$r")
echo $id >expected
check expected "$r/etc/machine-id"
+
+r="$(pwd)/transient-machine-id"
+setup_root "$r"
+touch "$r/etc/machine-id"
+mount -o remount,ro "$r"
+mount -t tmpfs tmpfs "$r/run"
+transient_id=$(systemd-machine-id-setup --print --root "$r")
+mount -o remount,rw "$r"
+commited_id=$(systemd-machine-id-setup --print --commit --root "$r")
+[[ "$transient_id" = "$commited_id" ]]
+check "$r/etc/machine-id" "$r/run/machine-id"
EOF
chmod +x $initdir/test-machine-id-setup.sh