Skip to content

Commit

Permalink
connectivity: Fix iface derivation in encrypt tests
Browse files Browse the repository at this point in the history
This commit fixes two issues:

* grep's "-P" is not available on busybox.
* In the direct routing mode, "ip r g $DST_POD_IP from $SRC_POD_IP"
  fails with "RTNETLINK answers: Network unreachable".

Fixes: 998ef8a ("connectivity: Add encryption test")
Signed-off-by: Martynas Pumputis <[email protected]>
  • Loading branch information
brb authored and gandro committed Dec 20, 2022
1 parent d299bf5 commit 2fc0835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connectivity/tests/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func (s *podToPodEncryption) Run(ctx context.Context, t *check.Test) {
iface = "cilium_" + tunnelFeat.Mode // E.g. cilium_vxlan
} else {
cmd := []string{"/bin/sh", "-c",
fmt.Sprintf("ip -o r g %s from %s | grep -oP '(?<=dev )[^ ]+'",
server.Pod.Status.PodIP, client.Pod.Status.PodIP)}
fmt.Sprintf("ip -o r g %s | grep -oE 'dev [^ ]*' | cut -d' ' -f2",
server.Pod.Status.PodIP)}
t.Debugf("Running %s", strings.Join(cmd, " "))
dev, err := clientHost.K8sClient.ExecInPod(ctx, clientHost.Pod.Namespace,
clientHost.Pod.Name, "", cmd)
Expand Down

0 comments on commit 2fc0835

Please sign in to comment.