location-mesh.sh 1.1 KB

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. # shellcheck disable=SC1091
  3. . lib.sh
  4. setup_suite() {
  5. # shellcheck disable=SC2016
  6. _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"]}]}}}}'
  7. block_until_ready_by_name kube-system kilo-userspace
  8. }
  9. test_location_mesh_connectivity() {
  10. assert "retry 30 5 '' check_ping" "should be able to ping all Pods"
  11. assert "retry 10 5 'the adjacency matrix is not complete yet' check_adjacent 3" "adjacency should return the right number of successful pings"
  12. echo "sleep for 30s (one reconciliation period) and try again..."
  13. sleep 30
  14. 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"
  15. }
  16. test_location_mesh_peer() {
  17. check_peer wg99 e2e 10.5.0.1/32 location
  18. }
  19. test_mesh_granularity_auto_detect() {
  20. assert_equals "$(_kgctl graph)" "$(_kgctl graph --mesh-granularity location)"
  21. }