X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=t%2Ft0004-server.sh;h=9e681107646e85e0fdcc3e12ec1ed13694376628;hb=d440a71683940a58747de6dc32643db452d9cf54;hp=7e8ea8205c71391ba44c06db1a013fbcb4f9442f;hpb=7e611b37e41f0ec7ec6d3173b7e88ed5b9b3a276;p=paraslash.git diff --git a/t/t0004-server.sh b/t/t0004-server.sh index 7e8ea820..9e681107 100755 --- a/t/t0004-server.sh +++ b/t/t0004-server.sh @@ -24,7 +24,8 @@ get_audio_file_paths ogg declare -a oggs=($result) declare -a oggs_base=(${oggs[@]##*/}) -declare -a commands=() cmdline=() required_objects=() good=() bad=() +declare -a commands=() cmdline=() required_objects=() good=() bad=() \ + expect_failure=() i=0 commands[$i]="help" cmdline[$i]="help -l" @@ -72,6 +73,15 @@ required_objects[$i]='ogg_afh' cmdline[$i]="ls -l=v ${oggs[@]}" good[$i]='^attributes_txt: 33' +let i++ +commands[$i]='addmood' +cmdline[$i]="addmood test-mood" + +let i++ +commands[$i]='empty-mood-parameter' +cmdline[$i]="select m/" +expect_failure[$i]='true' + let i++ commands[$i]="term" cmdline[$i]="term" @@ -83,7 +93,7 @@ test_require_executables "ssh-keygen" missing_executables="$result" if [[ -z "$missing_objects" && -z "$missing_executables" ]]; then - ssh-keygen -q -t rsa -b 2048 -N "" -f $privkey + ssh-keygen -q -t rsa -b 2048 -N "" -m PEM -f $privkey key_gen_result=$? read &>/dev/null < /dev/tcp/localhost/$port @@ -137,14 +147,19 @@ for ((i=0; i < ${#commands[@]}; i++)); do continue fi fi - test_expect_success "$command" " + if [[ -n "${expect_failure[$i]}" ]]; then + f=test_expect_failure + else + f=test_expect_success + fi + $f "$command" " $PARA_CLIENT \ --loglevel $loglevel \ --server-port $port \ --key-file $privkey \ --config-file /dev/null \ -- \ - ${cmdline[$i]} > $command.out && + ${cmdline[$i]} > $command.out < /dev/null && { [[ -z \"${good[$i]}\" ]] || grep \"${good[$i]}\"; } < $command.out && { [[ -z \"${bad[$i]}\" ]] || ! grep \"${bad[$i]}\"; } < $command.out "