handle missing sendxmpp binary
This commit is contained in:
parent
958b842e54
commit
8b4c186024
@ -1,6 +1,9 @@
|
|||||||
# !/bin/sh
|
# !/bin/sh
|
||||||
|
|
||||||
setUp() {
|
setUp() {
|
||||||
|
# if sendxmpp is present command will fail with err code 1 because of invalid domain
|
||||||
|
# otherwise it will ultimatly fail with return code 127 aka command not found
|
||||||
|
command -v sendxmpp > /dev/null && export EXPECTED_RETURN_CODE=1 || export EXPECTED_RETURN_CODE=127
|
||||||
export PLUGIN_USERNAME="username"
|
export PLUGIN_USERNAME="username"
|
||||||
export PLUGIN_PASSWORD="password"
|
export PLUGIN_PASSWORD="password"
|
||||||
export PLUGIN_JSERVER="server.invalid"
|
export PLUGIN_JSERVER="server.invalid"
|
||||||
@ -18,7 +21,7 @@ tearDown() {
|
|||||||
|
|
||||||
testAllOk() {
|
testAllOk() {
|
||||||
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
||||||
assertEquals 1 $?
|
assertEquals $EXPECTED_RETURN_CODE $?
|
||||||
assertTrue "[ -z "$stdout" ]"
|
assertTrue "[ -z "$stdout" ]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +39,7 @@ testUsernameSecretSet() {
|
|||||||
export SENDXMPP_USERNAME="secretusername"
|
export SENDXMPP_USERNAME="secretusername"
|
||||||
|
|
||||||
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
||||||
assertEquals 1 $?
|
assertEquals $EXPECTED_RETURN_CODE $?
|
||||||
assertTrue "[ -z "$stdout" ]"
|
assertTrue "[ -z "$stdout" ]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +57,7 @@ testPasswordSecretSet() {
|
|||||||
export SENDXMPP_PASSWORD="secretpassword"
|
export SENDXMPP_PASSWORD="secretpassword"
|
||||||
|
|
||||||
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
||||||
assertEquals 1 $?
|
assertEquals $EXPECTED_RETURN_CODE $?
|
||||||
assertTrue "[ -z "$stdout" ]"
|
assertTrue "[ -z "$stdout" ]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user