pwmd-dump: Fix compile time warning.
[pwmd.git] / tests / realpath.test
bloba8df3ea6007b190430d988ac8b7c24f2a0d11073
1 #!/bin/bash
2 source common.sh
3 source import-common.sh
5 do_import list
7 cat > config << EOF
8 [global]
9 log_level=9
10 #enable_logging=true
11 [realpath]
12 passphrase_file=`pwd`/list.key
13 EOF
15 set -e
16 mv -f data/list data/realpath
17 launch_pwmd realpath
19 begin_test
20 test_header "Test 1. Recursion loop (fail)."
21 set +o errexit
22 echo -ne 'REALPATH target-loop-a' | pwmc $PWMC_ARGS realpath
23 if [ ${PIPESTATUS[1]} == 0 ]; then
24 echo "The previous command should have failed. Stopping."
25 exit 1
28 set -e
30 echo
31 test_header "Test 2. Path with targets."
32 echo -ne 'REALPATH b\tb\tc\td' | pwmc $PWMC_ARGS realpath > result
33 cmp realpath.result2 result
34 rm -f result
36 echo
37 test_header "Test 3. No target element (fail)."
38 set +o errexit
39 echo -ne 'REALPATH bad-target' | pwmc $PWMC_ARGS realpath
40 if [ ${PIPESTATUS[1]} == 0 ]; then
41 echo "The previous command should have failed. Stopping."
42 exit 1
45 set -e
46 test_success