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"
-good[$i]='help server ----'
+cmdline[$i]="help -l"
+good[$i]='help \{1,\}----'
let i++
commands[$i]="init"
let i++
commands[$i]="ls_ogg"
required_objects[$i]='ogg_afh'
-cmdline[$i]="ls -l=v ${oggs_base[@]}"
+cmdline[$i]="ls -l=v -b ${oggs_base[@]}"
good[$i]='^basename:'
let i++
let i++
commands[$i]="ls"
required_objects[$i]='ogg_afh'
-cmdline[$i]="ls -l=v -p ${oggs[@]}"
+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"
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
--user-list "$user_list" \
--http-port "$stream_port" \
--dccp-port "$stream_port"
+ (($? != 0)) && exit 1
fi
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
"