summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-10-24 10:01:14 +0200
committerLennart Poettering <lennart@poettering.net>2024-10-29 11:00:13 +0100
commit5ada96c842641a074d3f3095ffa83a39dcda2767 (patch)
tree06a00e22c52be059d29cebc76570a1d23618a647
parentsysusers.d: lock all system users defined by us (diff)
downloadsystemd-5ada96c842641a074d3f3095ffa83a39dcda2767.tar.xz
systemd-5ada96c842641a074d3f3095ffa83a39dcda2767.zip
test: test new 'u' sysusers.d lines
-rwxr-xr-xtest/units/TEST-74-AUX-UTILS.sysusers.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/units/TEST-74-AUX-UTILS.sysusers.sh b/test/units/TEST-74-AUX-UTILS.sysusers.sh
index dcd29938b5..2a06e85bfd 100755
--- a/test/units/TEST-74-AUX-UTILS.sysusers.sh
+++ b/test/units/TEST-74-AUX-UTILS.sysusers.sh
@@ -6,6 +6,17 @@ set -o pipefail
# shellcheck source=test/units/util.sh
. "$(dirname "$0")"/util.sh
+systemd-sysusers - <<EOF
+u unlockedtestuser - "An unlocked system user" / /bin/bash
+u! lockedtestuser - "A locked system user" / /bin/bash
+EOF
+
+userdbctl -j user unlockedtestuser
+userdbctl -j user lockedtestuser
+
+assert_eq "$(userdbctl -j user unlockedtestuser | jq .locked)" "null"
+assert_eq "$(userdbctl -j user lockedtestuser | jq .locked)" "true"
+
at_exit() {
set +e
userdel -r foobarbaz