3 # Tests for the STORE protocol command.
8 .
$AM_SRCDIR/import-common.sh
12 cat >$OUTDIR/config
<< EOF
17 passphrase_file=$WDIR/passphrase.key
19 passphrase_file=$WDIR/passphrase.key
25 cp -f data
/datafile data
/datafile.tmp || bail_out
"Could not copy data/datafile."
26 run_pwmc
"--inquire STORE --inquire-line 'a a' -S datafile.tmp" $DEVNULL <<EOF
30 run_pwmc
"datafile.tmp" >result
$DEVNULL <<EOF
35 test_result
$test_n $e store
"Element with same value as element name."
39 cp -f data
/datafile data
/datafile.tmp || bail_out
"Could not copy data/datafile."
40 run_pwmc
"--inquire STORE --inquire-line 'a ' -S datafile.tmp" $DEVNULL <<EOF
44 run_pwmc
"datafile.tmp" >result
$DEVNULL <<EOF
49 test_failure
$test_n $e 536870970 "Remove element content."
53 run_pwmc
"--inquire STORE --inquire-line 'a b a b value' -S datafile" $DEVNULL <<EOF
57 run_pwmc
"datafile" >result
$DEVNULL <<EOF
62 test_result
$test_n $e store
"Write element content."
66 run_pwmc
"-S datafile" $DEVNULL <<EOF
71 run_pwmc
"datafile" >result
$DEVNULL <<EOF
76 test_result
$test_n $e store
"ATTR: Set root target to root."
80 run_pwmc
"--inquire STORE --inquire-line 'b b a b value' -S datafile" $DEVNULL <<EOF
84 run_pwmc
"datafile" >result
$DEVNULL <<EOF
89 test_result
$test_n $e store
"Overwrite target content."
93 cp -f data
/datafile data
/datafile.tmp || bail_out
"Could not copy data/datafile."
94 run_pwmc
"-S datafile.tmp" $DEVNULL <<EOF
97 list_recurse datafile.tmp
98 test_result
$test_n $? store
"ATTR: Set target to recursion loop."
102 run_pwmc
"-S datafile.tmp" $DEVNULL <<EOF
103 ATTR SET _target a b a
105 test_failure
$test_n $?
536903743 "Fail to set target to parent element."
110 cp -f data
/datafile data
/datafile.tmp || bail_out
"Could not copy data/datafile.tmp."
111 run_pwmc
"-S datafile.tmp" $DEVNULL <<EOF
112 ATTR SET _target a a b
114 list_recurse datafile.tmp
115 test_result
$test_n $? store
"ATTR: Set target to child."
119 run_pwmc
"-S datafile" $DEVNULL <<EOF
120 ATTR SET _target a b b
123 if [ $e -eq 0 ]; then
124 run_pwmc
"--inquire STORE -S datafile" $DEVNULL <<EOF
129 test_failure
$test_n $e 536903743 "Fail to create element at element with recursion loop."
133 run_pwmc
"--inquire STORE -S datafile" $DEVNULL <<EOF
136 test_failure
$test_n $e 536903743 "Fail to create content at element with recursion loop."