3 # Tests for the IMPORT protocol command.
8 .
$AM_SRCDIR/import-common.sh
12 cat >$OUTDIR/config
<< EOF
17 passphrase_file=$WDIR/passphrase.key
19 mv -f data
/list data
/import || bail_out
"Could not move data/list."
24 run_pwmc
"--inquire IMPORT import" $DEVNULL <<EOF
25 <element _name="import">import value</invalid>
27 test_failure
$test_n $?
536871001 "Invalid syntax."
31 run_pwmc
"--inquire IMPORT import -S" $DEVNULL <<EOF
32 <element _name="import">import value</element>
36 run_pwmc
"import" >result
$DEVNULL <<EOF
41 test_result
$test_n $e import
"Import to root."
45 run_pwmc
"--inquire IMPORT import -S" $DEVNULL <<EOF
46 <element _name="import">new import value</element>
50 run_pwmc
"import" >result
$DEVNULL <<EOF
55 test_result
$test_n $e import
"Import to root with overwrite."
59 run_pwmc
"--inquire 'IMPORT --root=import' import -S" $DEVNULL <<EOF
60 <element _name="child">child import value</element>
64 run_pwmc
"import" >result
$DEVNULL <<EOF
69 test_result
$test_n $e import
"Import to child."
73 run_pwmc
"--inquire 'IMPORT --root=import' import -S" $DEVNULL <<EOF
74 <element _name="child">new child import value</element>
78 run_pwmc
"import" >result
$DEVNULL <<EOF
83 test_result
$test_n $e import
"Import to child with overwrite."
87 run_pwmc
"--inquire 'IMPORT --root=import\troot' import -S" $DEVNULL <<EOF
88 <element _name="a">A value<element _name="b">A B value</element></element>
89 <element _name="b">B value</element>
93 run_pwmc
"import" >result
$DEVNULL <<EOF
98 test_result
$test_n $e import
"Import siblings."
102 run_pwmc
"--inquire 'IMPORT --root=import\troot' import -S" $DEVNULL <<EOF
103 <element _name="a">A value<element _name="b"/></element>
104 <element _name="b">B value</element>
107 if [ $e -eq 0 ]; then
108 run_pwmc
"import" >result
$DEVNULL <<EOF
113 test_result
$test_n $e import
"Import siblings with overwrite."
116 # FIXME what is this supposed to do?
118 run_pwmc
"import" >result
$DEVNULL <<EOF
121 test_failure
$test_n $?
536870970 "Fail to import siblings."