diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2016-12-13 12:34:09 +0100 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2016-12-13 14:03:13 +0100 |
commit | a6f72863adda77b3b6c7b08b0c85f41c6ba2a6d1 (patch) | |
tree | 1d15a7eebe561c2e44d732d3c13acfc8b7e39359 /test | |
parent | core: machine_id_setup overwrites broken machine-id (diff) | |
download | systemd-a6f72863adda77b3b6c7b08b0c85f41c6ba2a6d1.tar.xz systemd-a6f72863adda77b3b6c7b08b0c85f41c6ba2a6d1.zip |
machine-id-setup: `--print --commit` respects the --root option
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-14-MACHINE-ID/test.sh | 11 |
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 |