diff --git a/test/functions.sh b/test/functions.sh index 790271e..10fe221 100755 --- a/test/functions.sh +++ b/test/functions.sh @@ -104,19 +104,7 @@ set_namespace() { # Get the resulting IP of the hostname only-in-cluster-test1.test1 from the first test cluster # get_ip 1 only-in-cluster-test1.test1 get_ip() { - PORT="" - if [ "$1" == "1" ] - then - PORT="1053" - elif [ "$1" == "2" ] - then - PORT="1054" - else - echo "Invalid cluster identifier $1" - return 1 - fi - - IP=$(dig +short "$2" @localhost -p $PORT +tcp || true) + IP=$(dig "$2" @127.0.0.1${1} +short +tcp || true) echo -n "$IP" } diff --git a/test/kind-config-test1.yaml b/test/kind-config-test1.yaml index 25a748c..93b92ad 100644 --- a/test/kind-config-test1.yaml +++ b/test/kind-config-test1.yaml @@ -4,12 +4,16 @@ containerdConfigPatches: - |- [plugins."io.containerd.grpc.v1.cri".registry] config_path = "/etc/containerd/certs.d" +networking: + ipFamily: ipv4 nodes: - role: control-plane extraPortMappings: - containerPort: 30001 - hostPort: 1053 + hostPort: 53 protocol: TCP + listenAddress: 127.0.0.11 - containerPort: 30001 - hostPort: 1053 - protocol: UDP \ No newline at end of file + hostPort: 53 + protocol: UDP + listenAddress: 127.0.0.11 diff --git a/test/kind-config-test2.yaml b/test/kind-config-test2.yaml index e632f32..028af4f 100644 --- a/test/kind-config-test2.yaml +++ b/test/kind-config-test2.yaml @@ -4,12 +4,16 @@ containerdConfigPatches: - |- [plugins."io.containerd.grpc.v1.cri".registry] config_path = "/etc/containerd/certs.d" +networking: + ipFamily: ipv4 nodes: - role: control-plane extraPortMappings: - containerPort: 30001 - hostPort: 1054 + hostPort: 53 protocol: TCP + listenAddress: 127.0.0.12 - containerPort: 30001 - hostPort: 1054 - protocol: UDP \ No newline at end of file + hostPort: 53 + protocol: UDP + listenAddress: 127.0.0.12 diff --git a/test/test.sh b/test/test.sh index 7c0ea91..8ae3f9e 100755 --- a/test/test.sh +++ b/test/test.sh @@ -109,13 +109,13 @@ kubectl get ns set +e echo_color "${G}Waiting for cluster 1 relay to start" -until dig mcingress.test1 @localhost -p 1053 +tcp +until dig mcingress.test1 @127.0.0.11 +tcp do sleep 1 done echo_color "${G}Waiting for cluster 2 relay to start" -until dig mcingress.test2 @localhost -p 1054 +tcp +until dig mcingress.test2 @127.0.0.12 +tcp do sleep 1 done