3 source import-common.sh
12 passphrase_file=`pwd`/passphrase.key
15 mv -f data
/list data
/move
19 echo "Test 1. Move src to src (fail)."
21 echo -ne 'MOVE a a' | pwmc
$PWMC_ARGS move
22 if [ ${PIPESTATUS[1]} == 0 ]; then
23 echo "The previous command should have failed. Stopping."
30 echo "Test 2. Move non-existant (fail)."
32 echo -ne 'MOVE non-existant a' | pwmc
$PWMC_ARGS move
33 if [ ${PIPESTATUS[1]} == 0 ]; then
34 echo "The previous command should have failed. Stopping."
41 echo "Test 3. Move child with target to root of same node."
42 echo -ne 'MOVE a\tb\tc ' | pwmc
$PWMC_ARGS move
45 echo "Test 4. Move child to sibling child with target."
46 echo -ne 'MOVE a\tc a\tb\tc\td\te' | pwmc
$PWMC_ARGS -S move
47 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS move
> result
48 cmp move.result4 result
52 echo "Test 5. Move child with target to parent sibling."
53 echo -ne 'MOVE a\tb\tc\td\te\tc a' | pwmc
$PWMC_ARGS -S move
54 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS move
> result
55 cmp move.result5 result
59 echo "Test 6. Overwrite existing tree."
60 echo -ne 'MOVE a\tb\tc\td ' | pwmc
$PWMC_ARGS -S move
61 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS move
> result
62 cmp move.result6 result
66 echo "Test 7. Show child elements whose target contains an error."
67 echo -ne 'MOVE d c\te' | pwmc
$PWMC_ARGS -S move
68 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS move
> result
69 cmp move.result7 result
73 echo "Test 8. Move child whos target value is a parent."
74 echo -ne 'MOVE x z' | pwmc
$PWMC_ARGS -S move
75 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS move
> result
76 cmp move.result8 result
80 echo "Test 9. Move child whos target value is a parent."
81 echo -ne 'MOVE z\tx\ty z' | pwmc
$PWMC_ARGS -S move
82 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS move
> result
83 cmp move.result9 result
87 echo "Test 10. Move to non-existant path (create)."
88 echo -ne 'MOVE a\tc c\tf' | pwmc
$PWMC_ARGS -S move
89 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS move
> result
90 cmp move.result10 result