Skip to content

Commit

Permalink
test: Fix KubeProxyFree tests for Network unreachable case
Browse files Browse the repository at this point in the history
Depending on your network, it is possible that a router answers with
Network unreachable for TEST-NET-1 IP addresses before the 2 seconds
timeout triggers. This case makes all KubeProxyFree tests using such IP
addresses fail with the following error:

    kubectl exec -n external-ips-test app3-59d6d685d4-kt8jb -c curl -- curl --connect-timeout 2 -v 192.0.2.233:30002
    Expected
      <string>: None?
      *   Trying 192.0.2.233:30002...
      * TCP_NODELAY set
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
      Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      * connect to 192.0.2.233 port 30002 failed: Network unreachable
      * Failed to connect to 192.0.2.233 port 30002: Network unreachable
      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      * Closing connection 0
      curl: (7) Failed to connect to 192.0.2.233 port 30002: Network unreachable
      command terminated with exit code 7
    to equal
      <string>: No route to host / connection timed out

Signed-off-by: Paul Chaignon <paul@cilium.io>
  • Loading branch information
pchaigno authored and borkmann committed Mar 27, 2020
1 parent f1a580b commit 3da4cfe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/k8sT/external_ips.go
Expand Up @@ -206,6 +206,7 @@ var _ = Describe("K8sKubeProxyFreeMatrix tests", func() {
case bytes.Contains(b, []byte("Connection refused")):
got = "connection refused"
case bytes.Contains(b, []byte("No route to host")),
bytes.Contains(b, []byte("Network unreachable")),
bytes.Contains(b, []byte("Host is unreachable")),
bytes.Contains(b, []byte("Connection timed out")):
got = "No route to host / connection timed out"
Expand Down

0 comments on commit 3da4cfe

Please sign in to comment.