3 # Tests for the STORE protocol command.
8 .
$AM_SRCDIR/import-common.sh
12 cat >$OUTDIR/config
<< EOF
18 passphrase_file=$WDIR/passphrase.key
20 passphrase_file=$WDIR/passphrase.key
26 cp -f data
/datafile data
/datafile.tmp || bail_out
"Could not copy data/datafile."
27 run_pwmc
"--inquire STORE --inquire-line 'a a' -S datafile.tmp" $DEVNULL <<EOF
31 run_pwmc
"datafile.tmp" >result
$DEVNULL <<EOF
36 test_result
$test_n $e store
"Element with same value as element name."
40 cp -f data
/datafile data
/datafile.tmp || bail_out
"Could not copy data/datafile."
41 run_pwmc
"--inquire STORE --inquire-line 'a ' -S datafile.tmp" $DEVNULL <<EOF
45 run_pwmc
"datafile.tmp" >result
$DEVNULL <<EOF
50 test_failure
$test_n $e 536870970 "Remove element content."
54 run_pwmc
"--inquire STORE --inquire-line 'a b a b value' -S datafile" $DEVNULL <<EOF
58 run_pwmc
"datafile" >result
$DEVNULL <<EOF
63 test_result
$test_n $e store
"Write element content."
67 run_pwmc
"-S datafile" $DEVNULL <<EOF
72 run_pwmc
"datafile" >result
$DEVNULL <<EOF
77 test_result
$test_n $e store
"ATTR: Set root target to root."
81 run_pwmc
"--inquire STORE --inquire-line 'b b a b value' -S datafile" $DEVNULL <<EOF
85 run_pwmc
"datafile" >result
$DEVNULL <<EOF
90 test_result
$test_n $e store
"Overwrite target content."
94 cp -f data
/datafile data
/datafile.tmp || bail_out
"Could not copy data/datafile."
95 run_pwmc
"-S datafile.tmp" $DEVNULL <<EOF
98 list_recurse datafile.tmp
99 test_result
$test_n $? store
"ATTR: Set target to recursion loop."
103 run_pwmc
"-S datafile.tmp" $DEVNULL <<EOF
104 ATTR SET _target a b a
106 test_failure
$test_n $?
536903743 "Fail to set target to parent element."
111 cp -f data
/datafile data
/datafile.tmp || bail_out
"Could not copy data/datafile.tmp."
112 run_pwmc
"-S datafile.tmp" $DEVNULL <<EOF
113 ATTR SET _target a a b
115 list_recurse datafile.tmp
116 test_result
$test_n $? store
"ATTR: Set target to child."
120 run_pwmc
"-S datafile" $DEVNULL <<EOF
121 ATTR SET _target a b b
124 if [ $e -eq 0 ]; then
125 run_pwmc
"--inquire STORE -S datafile" $DEVNULL <<EOF
130 test_failure
$test_n $e 536903743 "Fail to create element at element with recursion loop."
134 run_pwmc
"--inquire STORE -S datafile" $DEVNULL <<EOF
137 test_failure
$test_n $e 536903743 "Fail to create content at element with recursion loop."