hwdb: fix screen rotation for EXO Wings 2in1 w1125 (#36283)
[systemd.io.git] / test / units / TEST-74-AUX-UTILS.sysusers.sh
blob2a06e85bfd464e3c4f71bd30656285d27e75db84
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -eux
4 set -o pipefail
6 # shellcheck source=test/units/util.sh
7 . "$(dirname "$0")"/util.sh
9 systemd-sysusers - <<EOF
10 u unlockedtestuser - "An unlocked system user" / /bin/bash
11 u! lockedtestuser - "A locked system user" / /bin/bash
12 EOF
14 userdbctl -j user unlockedtestuser
15 userdbctl -j user lockedtestuser
17 assert_eq "$(userdbctl -j user unlockedtestuser | jq .locked)" "null"
18 assert_eq "$(userdbctl -j user lockedtestuser | jq .locked)" "true"
20 at_exit() {
21 set +e
22 userdel -r foobarbaz
23 umount /run/systemd/userdb/
26 # Check that we indeed run under root to make the rest of the test work
27 [[ "$(id -u)" -eq 0 ]]
29 trap at_exit EXIT
31 # Ensure that a non-responsive NSS socket doesn't make sysusers fail
32 mount -t tmpfs tmpfs /run/systemd/userdb/
33 touch /run/systemd/userdb/io.systemd.DynamicUser
34 echo 'u foobarbaz' | SYSTEMD_LOG_LEVEL=debug systemd-sysusers -
35 grep -q foobarbaz /etc/passwd