3 source import-common.sh
12 passphrase_file=`pwd`/passphrase.key
16 mv -f data
/list data
/copy
20 echo "Test 1. Copy element to self (fail)."
22 echo -ne 'COPY a a' | pwmc
$PWMC_ARGS -S copy
23 if [ ${PIPESTATUS[1]} == 0 ]; then
24 echo "The previous command should have failed. Stopping."
31 echo "Test 2. Copy element to new root."
32 echo -ne 'COPY a new' | pwmc
$PWMC_ARGS -S copy
33 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS copy
> result
34 cmp copy.result2 result
38 echo "Test 3. Copy element to new child."
39 echo -ne 'COPY new a\tnew' | pwmc
$PWMC_ARGS -S copy
40 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS copy
> result
41 cmp copy.result3 result
45 echo "Test 4. Copy element to root and overwrite."
46 echo -ne 'COPY new a' | pwmc
$PWMC_ARGS -S copy
47 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS copy
> result
48 cmp copy.result4 result
52 echo "Test 5. Copy element to child and overwrite."
53 echo -ne 'COPY new a\tb' | pwmc
$PWMC_ARGS -S copy
54 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS copy
> result
55 cmp copy.result5 result
59 echo "Test 6. Copy element to target."
60 echo -ne 'COPY new b' | pwmc
$PWMC_ARGS -S copy
61 echo -ne 'LIST --recurse' | pwmc
$PWMC_ARGS copy
> result
62 cmp copy.result6 result