diff --git a/test/e2e/dryrun.go b/test/e2e/dryrun.go index 4319f0af8f..c005e869c7 100644 --- a/test/e2e/dryrun.go +++ b/test/e2e/dryrun.go @@ -34,8 +34,6 @@ func loadExpectedClusterDetails(filepath string, clusterName string, rootDir str return "", err } out := string(data) - out = strings.ReplaceAll(out, "", clusterName) - out = strings.ReplaceAll(out, "", rootDir) return out, nil } @@ -49,15 +47,15 @@ func CaseDryrun(clusterName string, kwokctlPath string, rootDir string) *feature t.Fatal("Could not get expected cluster details:", err) } t.Log("EXPECTED CLUSTER:", expected) - os.Setenv("KWOK_RUNTIME","binary") cmd := exec.Command(kwokctlPath, "create", "cluster", "--name="+clusterName, "--dry-run", "--runtime=binary", "--kube-authorization=false", "--disable-qps-limits", "--quiet-pull", "--timeout=30m", "--wait=30m") - os.Unsetenv("KWOK_RUNTIME") var output []byte output, err = cmd.Output() if err != nil { t.Fatal("Could not get the output of the command:", err) } got := string(output) + got = strings.ReplaceAll(got, clusterName, "") + got = strings.ReplaceAll(got, rootDir, "") t.Log("GOT CLUSTER:", got) if !strings.EqualFold(strings.TrimSpace(got), strings.TrimSpace(expected)) { t.Fatalf("Expected %s but got %s", expected, got)