Keep "gpg_homedir" and list file settings across SIGHUP.
[libpwmd.git] / tests / list.test
blobd5f3c4efe7faa9373f5de5fd510c1ae2959f29de
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 [list]
12 passphrase_file=`pwd`/passphrase.key
13 EOF
15 launch_pwmd list
17 begin_test
18 echo "Test 1. List root elements."
19 echo -ne 'LIST' | pwmc $PWMC_ARGS list > result
20 cmp list.result1 result
21 rm -f result
23 echo
24 echo "Test 2. List all elements."
25 echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS list > result
26 cmp list.result2 result
27 rm -f result
29 echo
30 echo "Test 3. List single path, verbose with targets."
31 echo -ne 'LIST --recurse a\tb' | pwmc $PWMC_ARGS list > result
32 cmp list.result3 result
33 rm -f result
35 echo
36 echo "Test 4. List single root path (no target)."
37 echo -ne 'LIST --recurse z' | pwmc $PWMC_ARGS list > result
38 cmp list.result4 result
39 rm -f result
41 echo
42 echo "Test 5. List element with target attribute error."
43 echo -ne 'LIST --recurse target-loop-a' | pwmc $PWMC_ARGS list > result
44 cmp list.result5 result
45 rm -f result
47 echo
48 echo "Test 6. Recursion loop flags."
49 echo -ne 'ATTR SET target c\td a' | pwmc $PWMC_ARGS -S list
50 echo -ne 'ATTR SET target a\tb\tc c\td\tb' | pwmc $PWMC_ARGS -S list
51 echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS list > result
52 cmp list.result6 result
53 rm -f result
54 echo
56 echo
57 echo "Test 7. Recursion loop flags: no child of target."
58 echo -ne 'ATTR SET target a\tb\tc c\td' | pwmc $PWMC_ARGS -S list
59 echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS list > result
60 cmp list.result7 result
61 rm -f result
63 echo
64 echo "Test 8. Recursion loop flags: target not a target."
65 echo -ne 'ATTR SET target a\tb\tc c' | pwmc $PWMC_ARGS -S list
66 echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS list > result
67 cmp list.result8 result
68 rm -f result
70 test_success