Skip to content

Commit f7d0c78

Browse files
AGENT-1207: automate OVE cluster installation
Automates OVE cluster installation using the Go-based library `go-rod` in headless mode. The workflow fills in cluster details, captures screenshots for each step, downloads credentials, and triggers the install action without requiring a visible browser. Verification steps include: - Confirming cluster installation completion - Running `oc get nodes`, `oc get clusterversion`, `oc get packagemanifests` and `oc wait clusterversion version --for=condition=Available=True --timeout=60m` - Ensuring the number of nodes matches values defined in dev-scripts
1 parent 808f79d commit f7d0c78

File tree

6 files changed

+399
-36
lines changed

6 files changed

+399
-36
lines changed

agent/01_agent_requirements.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ if [[ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISCSI" ]]; then
5555
fi
5656

5757
if [[ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISO_NO_REGISTRY" ]]; then
58-
sudo dnf -y install xorriso coreos-installer syslinux skopeo
58+
sudo dnf install -y epel-release
59+
sudo dnf -y install chromium skopeo
5960
fi

agent/06_agent_create_cluster.sh

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -646,41 +646,15 @@ case "${AGENT_E2E_TEST_BOOT_MODE}" in
646646

647647
check_assisted_install_UI
648648

649-
# Temporarily create a dummy kubeconfig and kubeadmin-password file for the CI
650-
auth_dir=$SCRIPTDIR/$OCP_DIR/auth
651-
mkdir -p $auth_dir
652-
cfg=$auth_dir/kubeconfig
653-
cat << EOF >> ${cfg}
654-
clusters:
655-
- cluster:
656-
certificate-authority-data: LS0tLS1CRUdJTiBGSUNBVLS0tLQo=
657-
server: https://api.test.redhat.com:6443
658-
name: test
659-
contexts:
660-
- context:
661-
cluster: test
662-
user: admin
663-
name: admin
664-
current-context: admin
665-
preferences: {}
666-
users:
667-
- name: admin
668-
user:
669-
client-certificate-data: LS0tLS1CRUdJTiBNBVEUtLS0tLQo=
670-
client-key-data: LS0tLS1CRUdJTiURSBVktLS0tLQo=
671-
EOF
672-
echo "dummy-kubeadmin-password" > $auth_dir/kubeadmin-password
649+
mkdir -p $OCP_DIR/auth
650+
rendezvousIP=$(getRendezvousIP)
651+
get_vips
652+
# Simulate user actions as done on the webUI and start cluster installation
653+
CLUSTER_NAME=$CLUSTER_NAME BASE_DOMAIN=$BASE_DOMAIN RENDEZVOUS_IP=$rendezvousIP OCP_DIR=$OCP_DIR INGRESS_VIP=$INGRESS_VIPS API_VIP=$API_VIPS go run agent/isobuilder/ui_driven_cluster_installation.go
654+
exit 0
673655
;;
674656
esac
675657

676-
if [[ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISO_NO_REGISTRY" ]]; then
677-
# Current goal is to only verify if the nodes are booted fine,
678-
# TUI sets the rendezvous IP correctly and UI is accessible.
679-
# The next goal is to simulate adding the cluster details via UI
680-
# and complete the cluster installation.
681-
exit 0
682-
fi
683-
684658
if [ ! -z "${AGENT_TEST_CASES:-}" ]; then
685659
run_agent_test_cases
686660
fi

agent/agent_post_install_validation.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
55

66
source $SCRIPTDIR/common.sh
77

8-
# Temp code skip the execution flow as cluster is not really installed
98
if [[ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISO_NO_REGISTRY" ]]; then
10-
exit 0
9+
oc wait clusterversion version --for=condition=Available=True --timeout=60m
10+
oc get csv -A
11+
oc get packagemanifests -n openshift-marketplace
1112
fi
1213

1314
installed_control_plane_nodes=$(oc get nodes --selector=node-role.kubernetes.io/master | grep -v AGE | wc -l)
@@ -18,3 +19,5 @@ if (( $NUM_MASTERS != $installed_control_plane_nodes )); then
1819
echo "Post install validation failed. Expected $NUM_MASTERS control plane nodes but found $installed_control_plane_nodes."
1920
exit 1
2021
fi
22+
23+
oc get clusterversion

0 commit comments

Comments
 (0)