docs: Update to add LIST --sexp.
[pwmd.git] / tests / rename.test
blob1b2ef4ae10b44bffba377254fd54374ba4ba7a7c
1 #!/bin/sh
3 # Tests for the RENAME protocol command.
5 MAX_TESTS=3
7 . $AM_SRCDIR/common.sh
8 . $AM_SRCDIR/import-common.sh
10 init_tests() {
11 do_import list
12 cat >$OUTDIR/config << EOF
13 [global]
14 log_level=9
15 #enable_logging=true
16 [rename]
17 passphrase_file=$WDIR/passphrase.key
18 EOF
19 mv -f data/list data/rename || bail_out "Could not move data/list."
20 launch_pwmd rename
23 test_1() {
24 run_pwmc "-S rename" $DEVNULL <<EOF
25 RENAME d e e
26 EOF
27 test_failure $test_n $? 536903715 "Fail to rename to self."
30 test_2() {
31 run_pwmc "-S rename" $DEVNULL <<EOF
32 RENAME b a
33 EOF
34 list_recurse rename
35 test_result $test_n $? rename "Rename to self target."
38 test_3() {
39 run_pwmc "-S rename" $DEVNULL <<EOF
40 RENAME a b
41 EOF
42 list_recurse rename
43 test_result $test_n $? rename "Rename."
46 run_tests $@