summaryrefslogtreecommitdiffstats
path: root/test/units/testsuite-74.id128.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
commit55944e5e40b1be2afc4855d8d2baf4b73d1876b5 (patch)
tree33f869f55a1b149e9b7c2b7e201867ca5dd52992 /test/units/testsuite-74.id128.sh
parentInitial commit. (diff)
downloadsystemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.tar.xz
systemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.zip
Adding upstream version 255.4.upstream/255.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/units/testsuite-74.id128.sh')
-rwxr-xr-xtest/units/testsuite-74.id128.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/units/testsuite-74.id128.sh b/test/units/testsuite-74.id128.sh
new file mode 100755
index 0000000..c1b80d6
--- /dev/null
+++ b/test/units/testsuite-74.id128.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: LGPL-2.1-or-later
+set -eux
+set -o pipefail
+
+# shellcheck source=test/units/util.sh
+. "$(dirname "$0")"/util.sh
+
+systemd-id128 --help
+systemd-id128 help
+systemd-id128 show
+systemd-id128 show --pretty | tail
+systemd-id128 show --value | tail
+systemd-id128 show 4f68bce3e8cd4db196e7fbcaf984b709 # root-x86-64
+systemd-id128 show --pretty 4f68bce3e8cd4db196e7fbcaf984b709
+systemd-id128 show root-x86-64
+systemd-id128 show --pretty root-x86-64
+[[ "$(systemd-id128 show 4f68bce3e8cd4db196e7fbcaf984b709)" = "$(systemd-id128 show root-x86-64)" ]]
+[[ "$(systemd-id128 show 4f68bce3-e8cd-4db1-96e7-fbcaf984b709)" = "$(systemd-id128 show root-x86-64)" ]]
+
+systemd-id128 show root-x86-64 --app-specific=4f68bce3e8cd4db196e7fbcaf984b709
+systemd-id128 show --pretty root-x86-64 --app-specific=4f68bce3e8cd4db196e7fbcaf984b709
+[[ "$(systemd-id128 show root-x86-64 --app-specific=4f68bce3e8cd4db196e7fbcaf984b709 -P)" = "8ee5535e7cb14c249e1d28b8dfbb939c" ]]
+
+[[ "$(systemd-id128 new | wc -c)" -eq 33 ]]
+systemd-id128 new -p
+systemd-id128 new -u
+systemd-id128 new -a 4f68bce3e8cd4db196e7fbcaf984b709
+
+systemd-id128 machine-id
+systemd-id128 machine-id --pretty
+systemd-id128 machine-id --uuid
+systemd-id128 machine-id --app-specific=4f68bce3e8cd4db196e7fbcaf984b709
+assert_eq "$(systemd-id128 machine-id)" "$(</etc/machine-id)"
+
+systemd-id128 boot-id
+systemd-id128 boot-id --pretty
+systemd-id128 boot-id --uuid
+systemd-id128 boot-id --app-specific=4f68bce3e8cd4db196e7fbcaf984b709
+assert_eq "$(systemd-id128 boot-id --uuid)" "$(</proc/sys/kernel/random/boot_id)"
+
+# shellcheck disable=SC2016
+systemd-run --wait --pipe bash -euxc '[[ $INVOCATION_ID == "$(systemd-id128 invocation-id)" ]]'
+
+(! systemd-id128)
+(! systemd-id128 new -a '')
+(! systemd-id128 new -a '0')
+(! systemd-id128 invocation-id -a 4f68bce3e8cd4db196e7fbcaf984b709)
+(! systemd-id128 show '')
+(! systemd-id128 show "$(set +x; printf '%0.s0' {0..64})")