2021-06-17 09:48:35 +00:00
#!/usr/bin/env bash
# shellcheck disable=SC1091
. lib.sh
setup_suite( ) {
# shellcheck disable=SC2016
2021-07-05 11:07:37 +00:00
_kubectl patch ds -n kube-system kilo -p '{"spec": {"template":{"spec":{"containers":[{"name":"kilo","args":["--hostname=$(NODE_NAME)","--create-interface=false","--kubeconfig=/etc/kubernetes/kubeconfig","--mesh-granularity=location"]}]}}}}'
2021-06-17 09:48:35 +00:00
block_until_ready_by_name kube-system kilo-userspace
2021-07-05 11:07:37 +00:00
_kubectl wait pod -l app.kubernetes.io/name= adjacency --for= condition = Ready --timeout 3m
2021-06-17 09:48:35 +00:00
}
test_location_mesh_connectivity( ) {
assert "retry 30 5 '' check_ping" "should be able to ping all Pods"
2021-07-05 11:09:51 +00:00
assert "retry 10 5 'the adjacency matrix is not complete yet' check_adjacent 3" "adjacency should return the right number of successful pings"
2021-06-17 09:48:35 +00:00
echo "sleep for 30s (one reconciliation period) and try again..."
sleep 30
2021-07-05 11:09:51 +00:00
assert "retry 10 5 'the adjacency matrix is not complete yet' check_adjacent 3" "adjacency should return the right number of successful pings after reconciling"
2021-06-17 09:48:35 +00:00
}
test_location_mesh_peer( ) {
2022-01-30 16:38:45 +00:00
check_peer wg99 e2e 10.5.0.1/32 location
2021-06-17 09:48:35 +00:00
}
2021-06-18 10:10:23 +00:00
test_mesh_granularity_auto_detect( ) {
2021-07-05 11:07:37 +00:00
assert_equals " $( _kgctl graph) " " $( _kgctl graph --mesh-granularity location) "
2021-06-18 10:10:23 +00:00
}