ISCACHED: don't handle unopened gpg-agent cache status.
[pwmd.git] / tests / rename.test
blob124f9da12d876859d0a10374e926bdfd31b86dc3
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 [rename]
12 passphrase_file=`pwd`/list.key
13 EOF
15 set -e
16 mv -f data/list data/rename
17 launch_pwmd rename
19 begin_test
20 echo "Test 1. Rename to self (fail)."
21 set +o errexit
22 echo -ne 'RENAME d\te e' | pwmc $PWMC_ARGS -S rename
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. Rename to self target."
32 echo -ne 'RENAME b a' | pwmc $PWMC_ARGS -S rename
33 echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS rename > result
34 cmp rename.result2 result
35 rm -f result
37 echo
38 echo "Test 3. Rename."
39 echo -ne 'RENAME a b' | pwmc $PWMC_ARGS -S rename
40 echo -ne 'LIST --recurse' | pwmc $PWMC_ARGS rename > result
41 cmp rename.result3 result
42 rm -f result
44 test_success