From 0e69ecdae6d9180c1f2e1f239d345bf202a7f802 Mon Sep 17 00:00:00 2001 From: Ricardo Maraschini Date: Tue, 22 Oct 2024 15:48:51 +0200 Subject: [PATCH] chore: simplify regex on e2e test (#1354) * chore: simplify regex on e2e test simplify the regex matching on the e2e test. * Update e2e/install_test.go Co-authored-by: Andrew Lavery --------- Co-authored-by: Andrew Lavery --- e2e/install_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/e2e/install_test.go b/e2e/install_test.go index f5f89667f..3b4fefd62 100644 --- a/e2e/install_test.go +++ b/e2e/install_test.go @@ -954,7 +954,7 @@ func TestSingleNodeAirgapUpgradeCustomCIDR(t *testing.T) { t.Logf("%s: installing embedded-cluster on node 0", time.Now().Format(time.RFC3339)) line = []string{"single-node-airgap-install.sh"} - line = append(line, "--cidr", "192.168.0.0/16") + line = append(line, "--cidr", "172.16.0.0/15") if _, _, err := tc.RunCommandOnNode(0, line); err != nil { t.Fatalf("fail to install embedded-cluster on node %s: %v", tc.Nodes[0], err) } @@ -1002,12 +1002,11 @@ func TestSingleNodeAirgapUpgradeCustomCIDR(t *testing.T) { // ensure that the cluster is using the right IP ranges. t.Logf("%s: checking service and pod IP addresses", time.Now().Format(time.RFC3339)) - // we have used --cidr 192.168.0.0/16 during install time so pods are - // expected to be in the 192.168.0.0/17 range while services are in the - // 192.168.128.0/17 range. i.e. pods are in 192.168.0-127.* while - // services in 192.168.128-254.*. - podregex := `192\.168\.\([0-9]\|[1-9][0-9]\|12[0-7]\|1[0-1][0-9]\)\.` - svcregex := `192\.168\.\(12[8-9]\|1[3-9][0-9]\|[2-5][0-9][0-9]\)\.` + // we have used --cidr 172.16.0.0/15 during install time so pods are + // expected to be in the 172.16.0.0/16 range while services are in the + // 172.17.0.0/16 range. + podregex := `172\.16\.[0-9]\+\.[0-9]\+` + svcregex := `172\.17\.[0-9]\+\.[0-9]\+` if stdout, stderr, err := tc.RunCommandOnNode(0, []string{"check-cidr-ranges.sh", podregex, svcregex}); err != nil { t.Log(stdout)