Merge branch 'debian'
[hcoop/debian/courier-authlib.git] / debian / tests / pam
CommitLineData
463a5c94
MW
1#!/bin/sh
2
3# autopkgtest check: test two local users via PAM authentication.
4# Author: Markus Wanner <markus@bluegap.ch>
5
6set -eu
7
8. debian/tests/common.sh
9
10export LANG=C
11unset LANGUAGE LC_ALL LC_CTYPE
12
13test_enumeration() {
14 ENUM_OUTPUT="$AUTOPKGTEST_ARTIFACTS/authenumerate.out"
15
16 # test authenumerate
17 (
18 authenumerate_as_courier > $ENUM_OUTPUT 2> $AUTOPKGTEST_ARTIFACTS/authenumerate.err
19 )
20 echo $? > $AUTOPKGTEST_ARTIFACTS/authenumerate.exitcode
21
22 # the three test users should appear in the output of authenumerate
23 echo -n "checking for alice: "
24 grep "alice" $ENUM_OUTPUT > /dev/null && echo "ok" || echo "FAILED"
25 echo -n "checking for bob: "
26 grep "bob" $ENUM_OUTPUT > /dev/null && echo "ok" || echo "FAILED"
27 echo -n "checking for carol: "
28 grep "carol" $ENUM_OUTPUT > /dev/null && echo "ok" || echo "FAILED"
29}
30
31# Actual tests start here
32
33backup_config_files
34create_test_users
35
36start_authdaemon
37
38echo "== check enumeration..."
39test_enumeration
40
41echo "== test completed"