Fixup tests for with and without gpg-agent use.
[pwmd.git] / tests / realpath.test
blobdce468feb58aae0702e9959915bb9d32b9f43840
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 echo "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 echo "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 echo "Test 3. Path with no targets."
38 echo -ne 'REALPATH a\tb\t!c' | pwmc $PWMC_ARGS realpath > result
39 cmp realpath.result3 result
40 rm -f result
42 echo
43 echo "Test 4. No target element (fail)."
44 set +o errexit
45 echo -ne 'REALPATH bad-target' | pwmc $PWMC_ARGS realpath
46 if [ ${PIPESTATUS[1]} == 0 ]; then
47 echo "The previous command should have failed. Stopping."
48 exit 1
51 set -e
52 test_success