e2e: simplify check_adjacency helper
This commit simplifies the check_adjacency helper to us the curl_pod helper rather than a re-written version of it. It also simplifies the curl_pod helper slightly to avoid the need for an additional shell. Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
This commit is contained in:
parent
f81d19e692
commit
f251ddda98
@ -143,7 +143,7 @@ delete_cluster () {
|
||||
}
|
||||
|
||||
curl_pod() {
|
||||
_kubectl get pods -l app.kubernetes.io/name=curl -o name | xargs -I{} "$KUBECTL_BINARY" --kubeconfig="$KUBECONFIG" exec {} -- /bin/sh -c "curl $*"
|
||||
_kubectl get pods -l app.kubernetes.io/name=curl -o name | xargs -I{} "$KUBECTL_BINARY" --kubeconfig="$KUBECONFIG" exec {} -- /usr/bin/curl "$@"
|
||||
}
|
||||
|
||||
check_ping() {
|
||||
@ -174,7 +174,7 @@ check_ping() {
|
||||
}
|
||||
|
||||
check_adjacent() {
|
||||
_kubectl get pods -l app.kubernetes.io/name=curl -o name | xargs -I{} "$KUBECTL_BINARY" --kubeconfig="$KUBECONFIG" exec {} -- /bin/sh -c 'curl -m 1 -s adjacency:8080/?format=fancy'
|
||||
curl_pod adjacency:8080/?format=fancy
|
||||
[ "$(curl_pod -m 1 -s adjacency:8080/?format=json | jq '.[].latencies[].ok' | grep -c true)" -eq $(($1*$1)) ]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user