aboutsummaryrefslogtreecommitdiffstats
path: root/tests/accountd
diff options
context:
space:
mode:
Diffstat (limited to 'tests/accountd')
-rw-r--r--tests/accountd13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/accountd b/tests/accountd
index 2f3985f..4626c78 100644
--- a/tests/accountd
+++ b/tests/accountd
@@ -20,12 +20,17 @@ grepstderr -Fxq "Can't stat $SOCKET: No such file or directory (Is lacme-account
#######################################################################
+# missing configuration at default location
+! runuser -u lacme-account -- lacme-accountd --debug 2>"$STDERR" || fail
+grepstderr -Fxq "Ignoring missing configuration file at default location /home/lacme-account/.config/lacme/lacme-accountd.conf"
+grepstderr -Fxq "Error: 'privkey' is not specified"
+
install -olacme-account -glacme-account -Ddm0700 ~lacme-account/.config/lacme
mv -t ~lacme-account/.config/lacme /etc/lacme/account.key
chown lacme-account: ~lacme-account/.config/lacme/account.key
cat >~lacme-account/.config/lacme/lacme-accountd.conf <<-EOF
- privkey = file:/home/lacme-account/.config/lacme/account.key
+ privkey = file:%E/lacme/account.key
EOF
# non-existent parent directory
@@ -33,9 +38,13 @@ EOF
grepstderr -Fxq "stat(/nonexistent): No such file or directory"
# word-writable parent directory
-! runuser -u lacme-account -- lacme-accountd --socket="/tmp/S.lacme" account 2>"$STDERR" || fail
+! runuser -u lacme-account -- lacme-accountd --socket="%T/S.lacme" account 2>"$STDERR" || fail
grepstderr -Fxq "Error: insecure permissions on /tmp"
+# unset XDG_RUNTIME_DIR
+! runuser -u lacme-account -- lacme-accountd 2>"$STDERR" || fail
+grepstderr "Error: undefined expansion %t in \"%t/S.lacme\""
+
# non-existent $XDG_RUNTIME_DIR
! runuser -u lacme-account -- env XDG_RUNTIME_DIR="/nonexistent" lacme-accountd 2>"$STDERR" || fail
grepstderr -Fxq "stat(/nonexistent): No such file or directory"