3 source import-common.sh
12 passphrase_file=`pwd`/passphrase.key
14 passphrase_file=`pwd`/passphrase.key
20 test_header
"Test 1. Inquire syntax (fail)."
21 cp -f data
/datafile data
/datafile.tmp
23 cat <<EOF | pwmc $PWMC_ARGS --inquire 'BULK --inquire' datafile.tmp
24 (2:id 1:1 7:getinfo7:vrsion)
27 if [ ${PIPESTATUS[1]} == 0 ]; then
28 echo "The previous command should have failed. Stopping."
35 test_header
"Test 2. Command branching."
36 cp -f data
/datafile data
/datafile.tmp
37 cat <<EOF | pwmc $PWMC_ARGS --inquire 'BULK --inquire' datafile.tmp > result
38 (2:id 1:1 7:getinfo7:clients
40 (2:id1:2 4:list5:--all
44 (2:id1:4 7:getinfo7:clients)
45 2:id1:5 7:getinfo5:cache))
46 2:id1:6 9:getconfig12:client-state
51 cmp bulk.result2 result
55 test_header
"Test 3. Command branching (next rc)."
56 cp -f data
/datafile data
/datafile.tmp
57 cat <<EOF | pwmc $PWMC_ARGS --inquire 'BULK --inquire' datafile.tmp > result
58 (2:id 1:1 7:getinfo7:clients
60 (2:id1:2 4:list5:--all
66 (2:id1:5 7:getinfo14:--data clients))
67 2:id1:6 9:getconfig3:nop
70 2:id1:8 7:getinfo 3:nop)
73 cmp bulk.result3 result
77 test_header
"Test 4. Command branching (multiple rc's)."
78 cp -f data
/datafile data
/datafile.tmp
79 cat <<EOF | pwmc $PWMC_ARGS --inquire 'BULK --inquire' datafile.tmp > result
80 (2:id 1:1 7:getinfo7:clients
82 (2:id1:2 4:list5:--all
88 (2:id1:5 7:getinfo14:--data clients))
89 2:id1:6 9:getconfig3:nop
93 (2:id1:8 7:getinfo 3:nop))
96 cmp bulk.result4 result