|
|
|
@ -1,6 +1,9 @@
|
|
|
|
|
# !/bin/sh
|
|
|
|
|
|
|
|
|
|
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_PASSWORD="password"
|
|
|
|
|
export PLUGIN_JSERVER="server.invalid"
|
|
|
|
@ -18,7 +21,7 @@ tearDown() {
|
|
|
|
|
|
|
|
|
|
testAllOk() {
|
|
|
|
|
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
|
|
|
|
assertEquals 1 $?
|
|
|
|
|
assertEquals $EXPECTED_RETURN_CODE $?
|
|
|
|
|
assertTrue "[ -z "$stdout" ]"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -36,7 +39,7 @@ testUsernameSecretSet() {
|
|
|
|
|
export SENDXMPP_USERNAME="secretusername"
|
|
|
|
|
|
|
|
|
|
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
|
|
|
|
assertEquals 1 $?
|
|
|
|
|
assertEquals $EXPECTED_RETURN_CODE $?
|
|
|
|
|
assertTrue "[ -z "$stdout" ]"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -54,7 +57,7 @@ testPasswordSecretSet() {
|
|
|
|
|
export SENDXMPP_PASSWORD="secretpassword"
|
|
|
|
|
|
|
|
|
|
stdout=$( ../sendxmpp.sh 2> /dev/null )
|
|
|
|
|
assertEquals 1 $?
|
|
|
|
|
assertEquals $EXPECTED_RETURN_CODE $?
|
|
|
|
|
assertTrue "[ -z "$stdout" ]"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|