Compare by string instead of number

This commit is contained in:
Nicolas Chan 2021-03-17 18:17:43 -07:00
parent 56096d05ca
commit 930e0b0b3b
2 changed files with 7 additions and 3 deletions

View file

@ -159,7 +159,7 @@ rcon-command () {
RESPONSE=$(read-response "$IN_PIPE")
RESPONSE_REQUEST_ID=$(response-request-id "$RESPONSE")
if [ "$RESPONSE_REQUEST_ID" -eq -1 ] || [ "$RESPONSE_REQUEST_ID" -eq 4294967295 ]; then
if [[ "$RESPONSE_REQUEST_ID" == "-1" ]] || [[ "$RESPONSE_REQUEST_ID" == "4294967295" ]]; then
log-warning "RCON connection failed: Wrong RCON password" 1>&2
return 1
fi

View file

@ -16,10 +16,14 @@ setUp () {
echo "file3" > "$TEST_TMP/server/world/file3.txt"
screen -dmS "$SCREEN_TMP" bash
sleep 0.1
while ! screen -S "$SCREEN_TMP" -Q "select" . &>/dev/null; do
sleep 0.1
done
screen -S "$SCREEN_TMP" -X stuff "cat > $TEST_TMP/screen-output\n"
tmux new-session -d -s "$SCREEN_TMP"
sleep 0.1
while ! tmux has-session -t "$SCREEN_TMP" 2>/dev/null; do
sleep 0.1
done
tmux send-keys -t "$SCREEN_TMP" "cat > $TEST_TMP/tmux-output" ENTER
python test/mock_rcon.py "$RCON_PORT" "$RCON_PASSWORD" > "$TEST_TMP/rcon-output" &
echo "$!" > "$TEST_TMP/rcon-pid"