diff --git a/agent/05_agent_configure.sh b/agent/05_agent_configure.sh index 56db3be28..66cf15853 100755 --- a/agent/05_agent_configure.sh +++ b/agent/05_agent_configure.sh @@ -46,7 +46,8 @@ function add_dns_entry { fi # Add entries to etc/hosts for SNO IPV6 to sucessfully run the openshift conformance tests - if [[ $NUM_MASTERS == 1 && $IP_STACK == "v6" ]]; then + # Temp change added to also check v4 in case of SNO for OVE + if [[ $NUM_MASTERS == 1 ]] && [[ $IP_STACK == "v4" || $IP_STACK == "v6" ]]; then AGENT_NODE0_IPSV6=${ip} echo "${ip} console-openshift-console.apps.${CLUSTER_DOMAIN}" | sudo tee -a /etc/hosts echo "${ip} oauth-openshift.apps.${CLUSTER_DOMAIN}" | sudo tee -a /etc/hosts @@ -682,7 +683,9 @@ if [[ "${AGENT_E2E_TEST_BOOT_MODE}" != "ISO_NO_REGISTRY" ]] ; then else # For ISO_NO_REGISTRY mode with workers, add api-int to libvirt DNS # Workers need to resolve api-int during bootstrap before joining the cluster + if [[ "${NUM_MASTERS}" > "1" ]]; then add_dns_entry "${API_VIPS%${VIPS_SEPARATOR}*}" "api-int" + fi fi enable_isolated_baremetal_network diff --git a/agent/isobuilder/ui_driven_cluster_installation/main.go b/agent/isobuilder/ui_driven_cluster_installation/main.go index 0b73e938e..d661fbb8d 100644 --- a/agent/isobuilder/ui_driven_cluster_installation/main.go +++ b/agent/isobuilder/ui_driven_cluster_installation/main.go @@ -203,24 +203,25 @@ func main() { // Wait for page to load and check if cluster creation completed in time logrus.Info("Waiting for operators page to load...") - time.Sleep(3 * time.Second) + wait(5 * time.Second) + reload(page) // Check if we got an error page because cluster wasn't created in time errorMsg, _ := page.Timeout(2*time.Second).ElementR("div", "Cluster details not found") if errorMsg != nil { logrus.Info("Cluster not ready yet, waiting and reloading...") - // Wait longer for cluster creation to complete - time.Sleep(5 * time.Second) - // Reload the page - page.MustReload() - page.MustWaitLoad() - logrus.Info("Page reloaded, continuing...") + wait(5 * time.Second) + reload(page) } - logrus.Info("Select virtualization bundle") - err = virtualizationBundle(page, filepath.Join(screenshotPath, "02-operators.png")) - if err != nil { - log.Fatalf("failed to select virtualization bundle: %v", err) + if getControlPlaneCount() > 1 { + logrus.Info("Select virtualization bundle") + err = virtualizationBundle(page, filepath.Join(screenshotPath, "02-operators.png")) + if err != nil { + log.Fatalf("failed to select virtualization bundle: %v", err) + } + } else { + logrus.Info("Skip selecting virtualization bundle for SNO...") } next(page) @@ -271,7 +272,7 @@ func main() { stepNum++ // Wait for page to load - time.Sleep(3 * time.Second) + wait(5 * time.Second) // Check if we're on Custom manifests page (4.22+) or Review page (< 4.22) customManifestsHeading, _ := page.Timeout(2*time.Second).ElementR("h2", "Custom manifests") @@ -362,7 +363,7 @@ func clusterDetails(page *rod.Page, path string) error { // Clear template content and enter pull secret pullSecretField.MustSelectAllText() pullSecretField.MustInput("") - time.Sleep(500 * time.Millisecond) + wait(500 * time.Millisecond) pullSecretField.MustInput(`{"auths":{"":{"auth":"dXNlcjpwYXNz"}}}`) } else { @@ -380,7 +381,7 @@ func clusterDetails(page *rod.Page, path string) error { } // Allow UI enough time to complete the background API call to create the cluster - time.Sleep(10 * time.Second) + wait(10 * time.Second) page.MustElement("button[name='next']").MustWaitEnabled() err = saveFullPageScreenshot(page, timestampedPath(path, "end")) @@ -475,7 +476,7 @@ func virtualizationBundle(page *rod.Page, path string) error { checkbox.MustScrollIntoView() checkbox.MustClick() // Allow UI enough time to complete the background API call - time.Sleep(2 * time.Second) + wait(5 * time.Second) page.MustElement("button[name='next']").MustWaitEnabled() err = saveFullPageScreenshot(page, timestampedPath(path, "end")) @@ -505,6 +506,7 @@ func verifyStorage(page *rod.Page, path string) error { if err != nil { return err } + page.MustElement("button[name='next']").MustWaitEnabled() err = saveFullPageScreenshot(page, timestampedPath(path, "end")) if err != nil { @@ -522,8 +524,15 @@ func networkingDetails(page *rod.Page, path string) error { apiVip := apiVips ingressVip := ingressVips - if ipStack == "v4v6" { + if ipStack == "v4" { + page.MustElement("#form-radio-stackType-singleStack-field") + logrus.Info("Selected IPV4 networking stack") + if getControlPlaneCount() == 1 { + logrus.Infof("Using default single-stack IPv4 networking (IP_STACK=%s) for SNO", ipStack) + } + } else if ipStack == "v4v6" { dualStackRadio := page.MustElement("#form-radio-stackType-dualStack-field") + logrus.Info("Selected dualstack networking stack") dualStackRadio.MustClick() err = saveFullPageScreenshot(page, timestampedPath(path, "after-dualstack")) if err != nil { @@ -531,26 +540,26 @@ func networkingDetails(page *rod.Page, path string) error { } apiVip = strings.Split(apiVips, ",")[0] ingressVip = strings.Split(ingressVips, ",")[0] - } else { - logrus.Infof("Using default single-stack IPv4 networking (IP_STACK=%s)", ipStack) } - apiVipField := page.MustElement("#form-input-apiVips-0-ip-field") - apiVipField.MustWaitVisible() - apiVipField.MustInput(apiVip) + if getControlPlaneCount() > 1 { + apiVipField := page.MustElement("#form-input-apiVips-0-ip-field") + apiVipField.MustWaitVisible() + apiVipField.MustInput(apiVip) - err = saveFullPageScreenshot(page, timestampedPath(path, "after-apivip")) - if err != nil { - return err - } + err = saveFullPageScreenshot(page, timestampedPath(path, "after-apivip")) + if err != nil { + return err + } - ingressVipField := page.MustElement("#form-input-ingressVips-0-ip-field") - ingressVipField.MustWaitVisible() - ingressVipField.MustInput(ingressVip) + ingressVipField := page.MustElement("#form-input-ingressVips-0-ip-field") + ingressVipField.MustWaitVisible() + ingressVipField.MustInput(ingressVip) - err = saveFullPageScreenshot(page, timestampedPath(path, "after-ingressvip")) - if err != nil { - return err + err = saveFullPageScreenshot(page, timestampedPath(path, "after-ingressvip")) + if err != nil { + return err + } } page.MustElement("#form-input-sshPublicKey-field").MustInput(sshPublicKey) @@ -586,7 +595,7 @@ func downloadCredentials(page *rod.Page, client *resty.Client, path string) erro } page.MustElement("#credentials-download-agreement").MustClick() - time.Sleep(5 * time.Second) + wait(5 * time.Second) page.MustElementR("button", "Download credentials").MustWaitEnabled().MustClick() @@ -645,7 +654,7 @@ func waitForClusterConsoleLink(page *rod.Page, path string) error { return err } i++ - time.Sleep(5 * time.Minute) + wait(5 * time.Minute) } return nil @@ -718,7 +727,7 @@ func saveCredentials(client *resty.Client, url, filename string) error { logrus.Infof("%s download attempts %d/%d", filename, i+1, downloadAttempts) resp, err := client.R().Get(fileURL) if err != nil || resp.StatusCode() != http.StatusOK { - time.Sleep(10 * time.Second) + wait(10 * time.Second) continue } if resp.StatusCode() == http.StatusOK { @@ -814,3 +823,14 @@ func runDownloadLogs() { logrus.Info("Download-logs mode complete") } + +func wait(timeToWait time.Duration){ + logrus.Infof("Waiting for %s ...", timeToWait) + time.Sleep(timeToWait) +} + +func reload(page *rod.Page){ + page.MustReload() + page.MustWaitLoad() + logrus.Info("Page reloaded, continuing...") +} \ No newline at end of file