Reset save key id's at SAVE start.
[libpwmd.git] / tests / list.test
blob8239047d60d064c3b1934cb2ec79dae2a4f74707
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`/list.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 root elements, verbose."
25 echo -ne 'LIST --verbose' | pwmc $PWMC_ARGS list > result
26 cmp list.result2 result
27 rm -f result
29 echo
30 echo "Test 3. List root elements, verbose with targets."
31 echo -ne 'LIST --verbose --with-target' | pwmc $PWMC_ARGS list > result
32 cmp list.result3 result
33 rm -f result
35 echo
36 echo "Test 4. List all elements, verbose with targets."
37 echo -ne 'LIST --all --with-target' | pwmc $PWMC_ARGS list > result
38 cmp list.result4 result
39 rm -f result
41 echo
42 echo "Test 5. List single path, verbose with targets."
43 echo -ne 'LIST --all --with-target !a\t!b' | pwmc $PWMC_ARGS list \
44 > result
45 cmp list.result5 result
46 rm -f result
48 echo
49 echo "Test 6. List single root path, verbose with targets (without target)."
50 echo -ne 'LIST --all --with-target z' | pwmc $PWMC_ARGS list \
51 > result
52 cmp list.result6 result
53 rm -f result
55 echo
56 echo "Test 7. List element with target attribute error."
57 echo -ne 'LIST --all --with-target target-loop-a' | pwmc $PWMC_ARGS list \
58 > result
59 cmp list.result7 result
60 rm -f result
61 test_success