@@ -12,6 +12,7 @@ source $SCRIPTDIR/validation.sh
12
12
source $SCRIPTDIR /release_info.sh
13
13
source $SCRIPTDIR /agent/common.sh
14
14
source $SCRIPTDIR /agent/iscsi_utils.sh
15
+ source $SCRIPTDIR /agent/e2e/agent-tui/utils.sh
15
16
16
17
early_deploy_validation
17
18
@@ -80,6 +81,15 @@ function create_config_image() {
80
81
cp -r ${config_image_dir} /auth ${asset_dir}
81
82
}
82
83
84
+ function create_agent_iso_no_registry() {
85
+ # Create agent ISO without registry a.k.a. OVE ISO
86
+ local asset_dir=${1}
87
+ pushd .
88
+ cd $OPENSHIFT_AGENT_INSTALER_UTILS_PATH /tools/iso_builder
89
+ ./hack/build-ove-image.sh --pull-secret-file " ${PULL_SECRET_FILE} " --release-image-url " ${OPENSHIFT_RELEASE_IMAGE} " --dir " ${asset_dir} "
90
+ popd
91
+ }
92
+
83
93
function set_device_config_image() {
84
94
85
95
for (( n= 0 ; n< ${2} ; n++ ))
@@ -152,6 +162,40 @@ function attach_appliance_diskimage() {
152
162
done
153
163
}
154
164
165
+ function attach_agent_iso_no_registry() {
166
+ set_file_acl
167
+
168
+ local base_dir=$SCRIPTDIR /$OCP_DIR
169
+ local iso_name=" agent-ove.$( uname -p) .iso"
170
+ local agent_iso_no_registry=$( find " $base_dir " -type f -name " $iso_name " 2> /dev/null | head -n 1)
171
+
172
+ for (( n= 0 ; n< ${2} ; n++ ))
173
+ do
174
+ name=${CLUSTER_NAME} _${1} _${n}
175
+ sudo virt-xml ${name} --add-device --disk " ${agent_iso_no_registry} " ,device=cdrom,target.dev=sdc
176
+ sudo virt-xml ${name} --edit target=sda --disk=" boot_order=1"
177
+ sudo virt-xml ${name} --edit target=sdc --disk=" boot_order=2" --start
178
+ echo " Waiting for 3 mins to arrive at agent-tui screen"
179
+ sleep 180
180
+ ./agent/e2e/agent-tui/test-no-registry-agent-tui.sh $name
181
+ echo " Finished configuring the rendezvousIP via agent-tui for $name "
182
+ done
183
+ }
184
+
185
+ function check_assisted_install_UI(){
186
+ local rendezvousIP=$( getRendezvousIP)
187
+ local url=" http://$rendezvousIP :3001"
188
+ while true ; do
189
+ if curl -s -o /dev/null -w " %{http_code}" " $url " | grep -q " ^200$" ; then
190
+ echo " Assisted install UI is up: $url "
191
+ break
192
+ else
193
+ echo " Assisted install UI not ready, retrying in 5 seconds..."
194
+ sleep 5
195
+ fi
196
+ done
197
+ }
198
+
155
199
function get_node0_ip() {
156
200
node0_name=$( printf ${MASTER_HOSTNAME_FORMAT} 0)
157
201
node0_ip=$( sudo virsh net-dumpxml ostestbm | xmllint --xpath " string(//dns[*]/host/hostname[. = '${node0_name} ']/../@ip)" -)
@@ -435,9 +479,11 @@ function put_operator_file() {
435
479
ssh " ${ssh_opts[@]} " " sudo cp /home/core/operators.yaml /etc/assisted/manifests/."
436
480
}
437
481
438
- asset_dir=" ${1:- ${OCP_DIR} } "
439
- config_image_dir=" ${1:- ${OCP_DIR} / configimage} "
440
- openshift_install=" $( realpath " ${OCP_DIR} /openshift-install" ) "
482
+ if [[ " ${AGENT_E2E_TEST_BOOT_MODE} " != " ISO_NO_REGISTRY" ]]; then
483
+ asset_dir=" ${1:- ${OCP_DIR} } "
484
+ config_image_dir=" ${1:- ${OCP_DIR} / configimage} "
485
+ openshift_install=" $( realpath " ${OCP_DIR} /openshift-install" ) "
486
+ fi
441
487
442
488
case " ${AGENT_E2E_TEST_BOOT_MODE} " in
443
489
" ISO" )
@@ -499,6 +545,23 @@ case "${AGENT_E2E_TEST_BOOT_MODE}" in
499
545
# (to avoid storage overconsumption on the CI machine)
500
546
sudo rm -f " ${OCP_DIR} /appliance.raw"
501
547
;;
548
+ " ISO_NO_REGISTRY" )
549
+ # Build an (OVE) image which does not need registry setup
550
+ # Run a script from agent-installer-utils which internally uses openshift-appliance
551
+ asset_dir=$SCRIPTDIR /$OCP_DIR /iso_builder
552
+ mkdir -p ${asset_dir}
553
+ create_agent_iso_no_registry ${asset_dir}
554
+
555
+ attach_agent_iso_no_registry master $NUM_MASTERS
556
+ attach_agent_iso_no_registry worker $NUM_WORKERS
557
+
558
+ # In case of SNO, wait for additional 3 minutes for the node
559
+ # to finish booting up and make sure UI is up
560
+ if [[ " ${NUM_MASTERS} " == " 1" ]]; then
561
+ sleep 180
562
+ fi
563
+ check_assisted_install_UI
564
+ ;;
502
565
esac
503
566
504
567
if [ ! -z " ${AGENT_TEST_CASES:- } " ]; then
@@ -528,17 +591,24 @@ if [[ ! -z $AGENT_OPERATORS ]]; then
528
591
put_operator_file
529
592
fi
530
593
531
- wait_for_cluster_ready
594
+ # Current goal is to only verify if the nodes are booted fine,
595
+ # TUI sets the rendezvous IP correctly and UI is accessible.
596
+ # The next goal is to simulate adding the cluster details via UI
597
+ # and complete the cluster installation.
598
+ if [[ " ${AGENT_E2E_TEST_BOOT_MODE} " != " ISO_NO_REGISTRY" ]]; then
599
+ wait_for_cluster_ready
600
+ fi
532
601
533
602
if [ ! -z " ${AGENT_DEPLOY_MCE} " ]; then
534
603
mce_complete_deployment
535
604
fi
536
605
537
606
# e2e test configuration
538
-
539
- # Configure storage for the image registry
540
- oc patch configs.imageregistry.operator.openshift.io \
541
- cluster --type merge --patch ' {"spec":{"storage":{"emptyDir":{}},"managementState":"Managed"}}'
607
+ if [[ " ${AGENT_E2E_TEST_BOOT_MODE} " != " ISO_NO_REGISTRY" ]]; then
608
+ # Configure storage for the image registry
609
+ oc patch configs.imageregistry.operator.openshift.io \
610
+ cluster --type merge --patch ' {"spec":{"storage":{"emptyDir":{}},"managementState":"Managed"}}'
611
+ fi
542
612
543
613
if [[ ! -z " ${ENABLE_LOCAL_REGISTRY} " ]]; then
544
614
# Configure tools image registry and cluster samples operator
0 commit comments