backport of commit 8c0b70c161 (#16337)

Co-authored-by: cskh <hui.kang@hashicorp.com>
pull/16343/head
hc-github-team-consul-core 2 years ago committed by GitHub
parent e2ec1f9718
commit 0a29abcdec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save