tests: Fix to specify invoking_user.
[pwmd.git] / tests / realpath.test
blobc645959cb9f163613e12a6df8c0e312df28ccb94
1 #!/bin/sh
3 # Tests for the REALPATH protocol command.
5 MAX_TESTS=3
7 . $AM_SRCDIR/common.sh
8 . $AM_SRCDIR/import-common.sh
10 init_tests() {
11 do_import list
12 cat >$OUTDIR/config << EOF
13 [global]
14 log_level=9
15 #enable_logging=true
16 invoking_user=$USER
17 [realpath]
18 passphrase_file=$WDIR/list.key
19 EOF
20 mv -f data/list data/realpath || bail_out "Could not move data/list."
21 launch_pwmd realpath
24 test_1() {
25 run_pwmc "realpath" $DEVNULL <<EOF
26 REALPATH target-loop-a
27 EOF
28 test_failure $test_n $? 536903743 "Fail due to recursion loop."
31 test_2() {
32 run_pwmc "realpath" >result $DEVNULL <<EOF
33 REALPATH b b c d
34 EOF
35 test_result $test_n $? realpath "Path with targets."
38 test_3() {
39 run_pwmc "realpath" $DEVNULL <<EOF
40 REALPATH bad-target
41 EOF
42 test_failure $test_n $? 536871048 "Fail due to non-existing target element."
45 run_tests $@