Update Debian package info.
[pwmd.git] / tests / rename.test
blob855634a0bdeecb89ec6335822d389497e535a2bc
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 (fail)."
32 set +o errexit
33 echo -ne 'RENAME b a' | pwmc $PWMC_ARGS -S rename
34 if [ ${PIPESTATUS[1]} == 0 ]; then
35 echo "The previous command should have failed. Stopping."
36 exit 1
39 set -e
41 echo
42 echo "Test 3. Rename to self target."
43 echo -ne 'RENAME !b a' | pwmc $PWMC_ARGS -S rename
44 echo -ne 'LIST --all --with-target' | pwmc $PWMC_ARGS rename > result
45 cmp rename.result3 result
46 rm -f result
48 echo
49 echo "Test 4. Rename."
50 echo -ne 'RENAME !a b' | pwmc $PWMC_ARGS -S rename
51 echo -ne 'LIST --all --with-target' | pwmc $PWMC_ARGS rename > result
52 cmp rename.result4 result
53 rm -f result
55 test_success