From a6f72863adda77b3b6c7b08b0c85f41c6ba2a6d1 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Tue, 13 Dec 2016 11:34:09 +0000 Subject: machine-id-setup: `--print --commit` respects the --root option --- test/TEST-14-MACHINE-ID/test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') 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 -- cgit v1.2.3-54-g00ecf