diff --git a/test/test_suite.sh b/test/test_suite.sh index c78dadb3..b3e3a05e 100644 --- a/test/test_suite.sh +++ b/test/test_suite.sh @@ -36,7 +36,7 @@ load 'libs/bats-support/load' echo "output: ${lines[@]}" [[ ${lines[0]} == "Connection to 127.0.0.1 4711 port [tcp/*] succeeded!" ]] [[ ${lines[1]} =~ "0 4 192.168.2.208" ]] - [[ ${lines[2]} == "1 2 127.0.0.1 localhost" ]] + [[ ${lines[2]} =~ "1 2 127.0.0.1"]] [[ ${lines[3]} =~ "2 1 10.8.0.2" ]] [[ ${lines[4]} == "---EOM---" ]] } @@ -106,8 +106,8 @@ load 'libs/bats-support/load' run bash -c 'echo ">getallqueries" | nc -v 127.0.0.1 4711' echo "output: ${lines[@]}" [[ ${lines[0]} == "Connection to 127.0.0.1 4711 port [tcp/*] succeeded!" ]] - [[ ${lines[1]} =~ "IPv6 raspberrypi localhost 3" ]] - [[ ${lines[2]} =~ "IPv4 checkip.dyndns.org localhost 2" ]] + [[ ${lines[1]} =~ "IPv6 raspberrypi" ]] + [[ ${lines[2]} =~ "IPv4 checkip.dyndns.org" ]] [[ ${lines[3]} =~ "IPv4 example.com" ]] [[ ${lines[4]} =~ "IPv4 play.google.com" ]] [[ ${lines[5]} =~ "IPv6 play.google.com" ]] @@ -134,19 +134,19 @@ load 'libs/bats-support/load' } @test "Get all queries (client filtered)" { - run bash -c 'echo ">getallqueries-client localhost" | nc -v 127.0.0.1 4711' + run bash -c 'echo ">getallqueries-client 127.0.0.1" | nc -v 127.0.0.1 4711' echo "output: ${lines[@]}" [[ ${lines[0]} == "Connection to 127.0.0.1 4711 port [tcp/*] succeeded!" ]] - [[ ${lines[1]} =~ "IPv6 raspberrypi localhost 3" ]] - [[ ${lines[2]} =~ "IPv4 checkip.dyndns.org localhost 2" ]] + [[ ${lines[1]} =~ "IPv6 raspberrypi" ]] + [[ ${lines[2]} =~ "IPv4 checkip.dyndns.org" ]] [[ ${lines[3]} == "---EOM---" ]] } @test "Get all queries (client + number filtered)" { - run bash -c 'echo ">getallqueries-client localhost (6)" | nc -v 127.0.0.1 4711' + run bash -c 'echo ">getallqueries-client 127.0.0.1 (6)" | nc -v 127.0.0.1 4711' echo "output: ${lines[@]}" [[ ${lines[0]} == "Connection to 127.0.0.1 4711 port [tcp/*] succeeded!" ]] - [[ ${lines[1]} =~ "IPv4 checkip.dyndns.org localhost 2" ]] + [[ ${lines[1]} =~ "IPv4 checkip.dyndns.org" ]] [[ ${lines[2]} == "---EOM---" ]] }