mirror of https://github.com/status-im/consul.git
integ test: fix retry upstream test (#16246)
This commit is contained in:
parent
9bb0ecfc18
commit
5b7f36c2ce
|
@ -20,12 +20,7 @@ load helpers
|
|||
}
|
||||
|
||||
@test "s1 upstream should be able to connect to s2" {
|
||||
run retry_default curl -s -f -d hello localhost:5000
|
||||
|
||||
echo "OUTPUT: $output"
|
||||
|
||||
[ "$status" == 0 ]
|
||||
[ "$output" == "hello" ]
|
||||
retry_default assert_upstream_message 5000
|
||||
}
|
||||
|
||||
@test "s1 proxy should be sending metrics to statsd" {
|
||||
|
|
|
@ -20,9 +20,7 @@ load helpers
|
|||
}
|
||||
|
||||
@test "s1 upstream should be able to connect to s2" {
|
||||
run retry_default curl -s -f -d hello localhost:5000
|
||||
[ "$status" == 0 ]
|
||||
[ "$output" == "hello" ]
|
||||
retry_default assert_upstream_message 5000
|
||||
}
|
||||
|
||||
@test "s1 proxy should be sending metrics to statsd" {
|
||||
|
|
|
@ -28,9 +28,7 @@ load helpers
|
|||
}
|
||||
|
||||
@test "s1 upstream should be able to connect to s2" {
|
||||
run retry_default curl -s -f -d hello localhost:5000
|
||||
[ "$status" == "0" ]
|
||||
[ "$output" == "hello" ]
|
||||
retry_default assert_upstream_message 5000
|
||||
}
|
||||
|
||||
@test "s1 proxy should send trace spans to zipkin/jaeger" {
|
||||
|
|
|
@ -46,6 +46,25 @@ function retry_long {
|
|||
retry 30 1 "$@"
|
||||
}
|
||||
|
||||
# assert_upstream_message asserts both the returned code
|
||||
# and message from upstream service
|
||||
function assert_upstream_message {
|
||||
local HOSTPORT=$1
|
||||
run curl -s -d hello localhost:$HOSTPORT
|
||||
|
||||
if [ "$status" -ne 0 ]; then
|
||||
echo "Command failed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if (echo $output | grep 'hello'); then
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "expected message not found in $output"
|
||||
return 1
|
||||
}
|
||||
|
||||
function is_set {
|
||||
# Arguments:
|
||||
# $1 - string value to check its truthiness
|
||||
|
|
Loading…
Reference in New Issue