Fix a few 'gcc -fanalyzer' warnings.
[pwmd.git] / tests / rename.test
blob8da1a96ca558d1d33d89256979481c572000465e
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 invoking_user=$USER
17 [rename]
18 passphrase_file=$WDIR/passphrase.key
19 EOF
20 mv -f data/list data/rename || bail_out "Could not move data/list."
21 launch_pwmd rename
24 test_1() {
25 run_pwmc "-S rename" $DEVNULL <<EOF
26 RENAME d e e
27 EOF
28 test_failure $test_n $? 536903715 "Fail to rename to self."
31 test_2() {
32 run_pwmc "-S rename" $DEVNULL <<EOF
33 RENAME b a
34 EOF
35 list_recurse rename
36 test_result $test_n $? rename "Rename to self target."
39 test_3() {
40 run_pwmc "-S rename" $DEVNULL <<EOF
41 RENAME a b
42 EOF
43 list_recurse rename
44 test_result $test_n $? rename "Rename."
47 run_tests $@