Repository navigation
target spoke #85657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
target spoke #85657
Changes from all commits
b13791d
fe6d1b5
4720e4d
0c89c00
9f8e63a
2244270
b4a2da7
ba9aa55
24af2b8
b7b04ef
b573dfb
06b9635
6a1ba86
032e9a5
00e8da8
18aad2f
96c740d
788a507
7ea464c
2299f86
ebf14d0
8149fd4
d6d2803
c75f30e
6d4fc96
66fb8be
adce142
6c56c6f
3cdb9a5
49f3bed
f6a6dca
d443cf2
5d88ed7
136055b
689e769
45dcd33
1e66317
2b8c65e
529e1a3
132f5a6
bb08823
9652e6b
9647453
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,8 +16,8 @@ resources: | |||||||||||||||||||||||||||||||||||||||
| limits: | ||||||||||||||||||||||||||||||||||||||||
| memory: 4Gi | ||||||||||||||||||||||||||||||||||||||||
| requests: | ||||||||||||||||||||||||||||||||||||||||
| cpu: 100m | ||||||||||||||||||||||||||||||||||||||||
| memory: 200Mi | ||||||||||||||||||||||||||||||||||||||||
| cpu: 200m | ||||||||||||||||||||||||||||||||||||||||
| memory: 300Mi | ||||||||||||||||||||||||||||||||||||||||
| tests: | ||||||||||||||||||||||||||||||||||||||||
| - as: cnf-ran-ibi-tests | ||||||||||||||||||||||||||||||||||||||||
| capabilities: | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -27,7 +27,10 @@ tests: | |||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||
| CLUSTER_NAME: kni-qe-127 | ||||||||||||||||||||||||||||||||||||||||
| DISABLE_INSIGHTS: "true" | ||||||||||||||||||||||||||||||||||||||||
| GITLAB_REPO_URL: https://gitlab.cee.redhat.com/telcov10n/ztp-site-configs-ci.git | ||||||||||||||||||||||||||||||||||||||||
| ECO_CI_CD_FORK_BRANCH: report-portal-cnfran-reporting | ||||||||||||||||||||||||||||||||||||||||
| ECO_CI_CD_FORK_REPO: https://github.com/klaskosk/eco-ci-cd | ||||||||||||||||||||||||||||||||||||||||
| ECO_CI_CD_FORK_REVISION: d20ff2835b5657191ef93448915bbc06b82f3aa1 | ||||||||||||||||||||||||||||||||||||||||
| GITLAB_REPO_URL: https://gitlab.cee.redhat.com/tmamyshe/ztp-site-configs-ci.git | ||||||||||||||||||||||||||||||||||||||||
| HUB_OPERATORS: | | ||||||||||||||||||||||||||||||||||||||||
| [ | ||||||||||||||||||||||||||||||||||||||||
| {"name":"local-storage-operator","catalog":"redhat-operators","nsname":"openshift-local-storage","channel":"stable","og_name":"local-operator-group","subscription_name":"local-storage-operator","deploy_default_config":false,"ns_annotations":{"workload.openshift.io/allowed":"management"}}, | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -36,8 +39,40 @@ tests: | |||||||||||||||||||||||||||||||||||||||
| {"name":"multicluster-engine","catalog":"redhat-operators","nsname":"multicluster-engine","channel":"stable-2.10","og_name":"multicluster-engine","subscription_name":"multicluster-engine","deploy_default_config":true,"og_spec":{}}, | ||||||||||||||||||||||||||||||||||||||||
| {"name":"topology-aware-lifecycle-manager","catalog":"topology-aware-lifecycle-manager-fbc","og_name":"global-operators","nsname":"openshift-operators","fbc_iib_repo":"latest","channel":"stable","deploy_default_config":false,"ocp_operator_mirror_fbc_image_base":"quay.io/redhat-user-workloads/telco-5g-tenant/topology-aware-lifecycle-manager-fbc-4-20"} | ||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||
| IBI_IBBF_ENABLED: "true" | ||||||||||||||||||||||||||||||||||||||||
| IBI_IBBF_ORIGINAL_BMC_HOST: 10.6.134.24 | ||||||||||||||||||||||||||||||||||||||||
| IBI_IBBF_REPLACEMENT_BMC_HOST: 10.6.134.23 | ||||||||||||||||||||||||||||||||||||||||
| IBI_IBBF_REPLACEMENT_POLICY_PATH: 4.20/ibi-target/policygentemplate/ztp-test/ibbf-test | ||||||||||||||||||||||||||||||||||||||||
| IBI_IBBF_TARGET_IP: 2620:52:9:1684:ca4b:d6ff:fea2:da72 | ||||||||||||||||||||||||||||||||||||||||
| IBI_MIRROR_SEED_DEPENDENCIES: "true" | ||||||||||||||||||||||||||||||||||||||||
| IBI_REPLACEMENT_HOST: helix81.telcoqe.eng.rdu2.dc.redhat.com | ||||||||||||||||||||||||||||||||||||||||
| IBI_REPLACEMENT_IP: 2620:52:9:1684:aa3c:a5ff:fe36:363a | ||||||||||||||||||||||||||||||||||||||||
| IBI_REPLACEMENT_MAC: a8:3c:a5:36:36:3a | ||||||||||||||||||||||||||||||||||||||||
| IBI_REPLACEMENT_PREINSTALL_ENABLED: "true" | ||||||||||||||||||||||||||||||||||||||||
| JUNIT_INVENTORY_PREFIX: target- | ||||||||||||||||||||||||||||||||||||||||
| JUNIT_REPORT_DIR_FILE: ibi-deploymenttypes-report-dir | ||||||||||||||||||||||||||||||||||||||||
| JUNIT_REQUIRED_RESULT_FILES: ibi-deploymenttypes-exit-code ibi-ibbf-exit-code | ||||||||||||||||||||||||||||||||||||||||
| MULTISTAGE_PARAM_OVERRIDE_RELEASE_AGE_MAX_DAYS: "30" | ||||||||||||||||||||||||||||||||||||||||
| SEED_SPOKE_CLUSTER: ibi-seed | ||||||||||||||||||||||||||||||||||||||||
| SPOKE_CLUSTER: '[''ibi-seed'']' | ||||||||||||||||||||||||||||||||||||||||
| SPOKE_OPERATORS: | | ||||||||||||||||||||||||||||||||||||||||
| [ | ||||||||||||||||||||||||||||||||||||||||
| {"name":"sriov-fec","catalog":"certified-operators","nsname":"vran-acceleration-operators","channel":"stable"}, | ||||||||||||||||||||||||||||||||||||||||
| {"name":"ptp-operator","catalog":"redhat-operators-ptp-art","fbc_iib_repo":"ose-ptp-rhel9-operator","nsname":"openshift-ptp","channel":"stable","ns_labels":{"workload.openshift.io/allowed":"management","name":"openshift-ptp"}}, | ||||||||||||||||||||||||||||||||||||||||
| {"name":"sriov-network-operator","catalog":"redhat-operators-sriov-art","fbc_iib_repo":"ose-sriov-network-rhel9-operator","nsname":"openshift-sriov-network-operator","channel":"stable","og_name":"sriov-network-operators","subscription_name":"sriov-network-operator-subscription"}, | ||||||||||||||||||||||||||||||||||||||||
| {"name":"cluster-logging","catalog":"redhat-operators","catalog_version_override":"4.20","nsname":"openshift-logging","channel":"stable-6.2","og_name":"cluster-logging","subscription_name":"cluster-logging","og_spec":{"targetNamespaces":[]}}, | ||||||||||||||||||||||||||||||||||||||||
| {"name":"local-storage-operator","fbc_iib_repo":"ose-local-storage-rhel9-operator","catalog":"redhat-operators-storage-art","nsname":"openshift-local-storage","channel":"stable","og_name":"local-operator-group","subscription_name":"local-storage-operator","deploy_default_config":false,"ns_labels":{"workload.openshift.io/allowed":"management"}}, | ||||||||||||||||||||||||||||||||||||||||
| {"name":"lifecycle-agent","catalog":"lifecycle-agent-fbc","og_name":"global-operators","nsname":"openshift-operators","fbc_iib_repo":"latest","channel":"stable","deploy_default_config":false,"ocp_operator_mirror_fbc_image_base":"quay.io/redhat-user-workloads/telco-5g-tenant/lifecycle-agent-fbc-4-20"}, | ||||||||||||||||||||||||||||||||||||||||
| {"name":"redhat-oadp-operator","catalog":"oadp-fbc","fbc_iib_repo":"oadp-1.5__v4.20__oadp-rhel9-operator","art_fbc":false,"ocp_operator_mirror_fbc_image_base":"quay.io/redhat-user-workloads/ocp-art-tenant/art-fbc","nsname":"openshift-adp","channel":"stable","og_name":"openshift-adp","subscription_name":"redhat-oadp-operator","deploy_default_config":false,"og_spec":{"targetNamespaces":["openshift-adp"]}} | ||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+58
to
+67
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '30,48p' ci-operator/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibi-4.20.yaml
sed -n '1,40p' ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi-target-mirror-spoke-operators/telcov10n-functional-cnf-ran-ibi-target-mirror-spoke-operators-ref.yaml
rg -n 'SPOKE_OPERATORS|oadp|lifecycle-agent' ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi-target-* ci-operator/config/openshift-kni/eco-ci-cdRepository: openshift/release Length of output: 26848 🏁 Script executed: #!/bin/bash
set -o pipefail
printf '%s\n' '--- workflow references ---'
rg -n -C 4 'telcov10n-functional-cnf-ran-ibi|ibi-target-mirror-spoke-operators|redhat-oadp-operator|oadp|backup|restore' \
ci-operator/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibi-4.20.yaml \
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi \
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi-target-* \
ci-operator/step-registry/telcov10n/functional/cnf-ran 2>/dev/null | head -n 500
printf '%s\n' '--- IBI files ---'
fd -t f . ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi-target-* 2>/dev/null
printf '%s\n' '--- workflow declaration and config steps ---'
rg -n -C 8 '^tests:|^ - ref:|^ - chain:|^ - workflow:|^ - as:|workflow: telcov10n-functional-cnf-ran-ibi' \
ci-operator/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibi-4.20.yaml \
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi 2>/dev/null | head -n 500Repository: openshift/release Length of output: 42003 🏁 Script executed: #!/bin/bash
set -o pipefail
printf '%s\n' '--- IBI workflow ---'
cat -n ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi/telcov10n-functional-cnf-ran-ibi-workflow.yaml
printf '%s\n' '--- target spoke deployment files ---'
fd -t f . ci-operator/step-registry/telcov10n/functional/cnf-ran | rg 'ibu-target-deploy-spoke-sno|target-deploy-spoke-sno|ibi.*deploy|clusterinstance|seedimage'
printf '%s\n' '--- target deployment and IBI OADP/operator references ---'
rg -n -C 5 -i 'redhat-oadp-operator|oadp|SPOKE_OPERATORS|operators|clusterinstance|seedimage' \
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno \
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi \
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi-target-* 2>/dev/null | head -n 700Repository: openshift/release Length of output: 37025 🏁 Script executed: #!/bin/bash
set -o pipefail
printf '%s\n' '--- seed mirror and seed spoke files ---'
fd -t f . ci-operator/step-registry/telcov10n/functional/cnf-ran | rg 'mirror-spoke-operators|deploy-spoke-sno-seed|hub-config'
printf '%s\n' '--- seed operator configuration and OADP references ---'
rg -n -C 6 -i 'SPOKE_OPERATORS|redhat-oadp-operator|oadp|lifecycle-agent|seedimage|seed image' \
ci-operator/step-registry/telcov10n/functional/cnf-ran/mirror-spoke-operators \
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-deploy-spoke-sno-seed \
ci-operator/step-registry/telcov10n/functional/cnf-ran/hub-config \
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibi \
ci-operator/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibi-4.20.yaml 2>/dev/null | head -n 700Repository: openshift/release Length of output: 19193 Include The workflow uses this override for the seed mirror step. The mirror command passes only the listed operators with Suggested fix {"name":"lifecycle-agent","catalog":"lifecycle-agent-fbc","og_name":"global-operators","nsname":"openshift-operators","fbc_iib_repo":"latest","channel":"stable","deploy_default_config":false,"ocp_operator_mirror_fbc_image_base":"quay.io/redhat-user-workloads/telco-5g-tenant/lifecycle-agent-fbc-4-20"},
+ {"name":"redhat-oadp-operator","catalog":"oadp-fbc","fbc_iib_repo":"oadp-1.5__v4.20__oadp-rhel9-operator","art_fbc":true,"ocp_operator_mirror_fbc_image_base":"quay.io/redhat-user-workloads/ocp-art-tenant/art-fbc","nsname":"openshift-adp","channel":"stable-1.5","og_name":"openshift-adp","subscription_name":"redhat-oadp-operator","deploy_default_config":false,"og_spec":{"targetNamespaces":[]}}
]📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| TARGET_CLUSTER_NAME: kni-qe-128 | ||||||||||||||||||||||||||||||||||||||||
| TARGET_REGISTRY_HOST: bastion.kni-qe-128.telcov10n.eng.rdu2.dc.redhat.com | ||||||||||||||||||||||||||||||||||||||||
| TARGET_SPOKE_CLUSTER: '[''ibi-target'']' | ||||||||||||||||||||||||||||||||||||||||
| TARGET_SPOKE_VERSION: "4.20" | ||||||||||||||||||||||||||||||||||||||||
| VERSION: "4.20" | ||||||||||||||||||||||||||||||||||||||||
| workflow: telcov10n-functional-cnf-ran-ibi | ||||||||||||||||||||||||||||||||||||||||
| ZTP_GIT_BRANCH: ibi | ||||||||||||||||||||||||||||||||||||||||
| ZTP_GIT_REPO: https://gitlab.cee.redhat.com/tmamyshe/ztp-site-configs-ci.git | ||||||||||||||||||||||||||||||||||||||||
| workflow: telcov10n-functional-cnf-ran-ibi-workflow | ||||||||||||||||||||||||||||||||||||||||
| zz_generated_metadata: | ||||||||||||||||||||||||||||||||||||||||
| branch: main | ||||||||||||||||||||||||||||||||||||||||
| org: openshift-kni | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Inherit approvers from ../OWNERS. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,237 @@ | ||
| #!/bin/bash | ||
| set +x | ||
| set -euo pipefail | ||
| umask 077 | ||
|
|
||
| TEMP_DIR= | ||
| SSH_READY=false | ||
| REPORTS_COLLECTED=false | ||
| RUN_RC=1 | ||
| TEST_RESULT=1 | ||
|
|
||
| record_result() { | ||
| printf '%s\n' "$1" > "${RESULT_FILE}" | ||
| } | ||
|
|
||
| finish() { | ||
| local result=$1 copy_rc=0 save_rc=0 | ||
| trap - EXIT | ||
| set +e | ||
|
|
||
| if [[ "${SSH_READY}" == true && "${REPORTS_COLLECTED}" == false ]]; then | ||
| collect_reports | ||
| copy_rc=$? | ||
| if (( result == 0 )); then | ||
| result=${copy_rc} | ||
| fi | ||
| fi | ||
|
|
||
| if (( result == 0 )); then | ||
| record_result "${TEST_RESULT}" | ||
| else | ||
| record_result "${result}" | ||
| fi | ||
| save_rc=$? | ||
| [[ -z "${TEMP_DIR}" ]] || rm -rf -- "${TEMP_DIR}" | ||
| if (( save_rc != 0 )); then | ||
| echo "Could not save the Deployment Types result." >&2 | ||
| exit "${save_rc}" | ||
| fi | ||
|
|
||
| echo "Deployment Types step status: ${result}; test result: ${TEST_RESULT}; report-copy status: ${copy_rc}." | ||
| if (( result == 0 )); then | ||
| echo "Tests completed; later stages may continue. Final verification will enforce the saved test result." | ||
| else | ||
| echo "Deployment Types setup, execution, or report collection failed; stopping the workflow." >&2 | ||
| fi | ||
| exit "${result}" | ||
| } | ||
|
|
||
| validate_inputs() { | ||
| : "${TARGET_CLUSTER_NAME:?TARGET_CLUSTER_NAME is required}" | ||
| : "${TARGET_SPOKE_CLUSTER:?TARGET_SPOKE_CLUSTER is required}" | ||
| TARGET_SPOKE_NAME=$(printf '%s' "${TARGET_SPOKE_CLUSTER}" | tr -d "[]'\" ") | ||
| [[ "${TARGET_CLUSTER_NAME}" =~ ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ ]] | ||
| [[ "${TARGET_SPOKE_NAME}" =~ ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ ]] | ||
| HUB_CONFIG_DIR="/home/telcov10n/project/generated/${TARGET_CLUSTER_NAME}" | ||
| } | ||
|
|
||
| restore_target_inventory() { | ||
| local name | ||
| INVENTORY_PATH=/eco-ci-cd/inventories/ocp-deployment | ||
| mkdir -p "${INVENTORY_PATH}/group_vars" "${INVENTORY_PATH}/host_vars" | ||
| for name in all bastions; do | ||
| cp "${SHARED_DIR}/target-${name}" "${INVENTORY_PATH}/group_vars/${name}" | ||
| done | ||
| cp "${SHARED_DIR}/target-bastion" "${INVENTORY_PATH}/host_vars/bastion" | ||
| } | ||
|
|
||
| create_work_directories() { | ||
| TEMP_DIR=$(mktemp -d /tmp/ibi-deploymenttypes.XXXXXX) | ||
| WORK_DIR="/tmp/eco_gotests_ibi_deploymenttypes/${TEMP_DIR##*/}" | ||
| # The preparation playbook deletes WORK_DIR, so keep the kubeconfig outside it. | ||
| SPOKE_KUBECONFIG="/tmp/${TEMP_DIR##*/}-kubeconfig" | ||
| REPORT_DIR="${ARTIFACT_DIR}/ibi-deploymenttypes" | ||
| mkdir -p "${REPORT_DIR}" | ||
| printf '%s\n' "${WORK_DIR}/report" > "${SHARED_DIR}/ibi-rp-ibi-dir" | ||
| printf '%s\n' "${WORK_DIR}/junit" > "${SHARED_DIR}/ibi-deploymenttypes-report-dir" | ||
| } | ||
|
|
||
| configure_ssh() { | ||
| cp /var/group_variables/common/all/ansible_ssh_private_key "${TEMP_DIR}/ssh-key" | ||
| chmod 600 "${TEMP_DIR}/ssh-key" | ||
| # Match hub deployment: read connection fields from the generated inventory. | ||
| if ! BASTION_IP=$(grep -oP '(?<=ansible_host: ).*' "${INVENTORY_PATH}/host_vars/bastion" | sed "s/'//g") || | ||
| ! BASTION_USER=$(grep -oP '(?<=ansible_user: ).*' "${INVENTORY_PATH}/group_vars/all" | sed "s/'//g"); then | ||
| echo "Could not read target bastion address and user from inventory." >&2 | ||
| return 1 | ||
| fi | ||
| if [[ ! "${BASTION_IP} ${BASTION_USER}" =~ ^[^[:space:]]+[[:blank:]][^[:space:]]+$ ]]; then | ||
| echo "Target bastion inventory must provide one address and one user." >&2 | ||
| return 1 | ||
| fi | ||
| SSH_OPTS=( | ||
| -i "${TEMP_DIR}/ssh-key" | ||
| -o BatchMode=yes | ||
| -o ConnectTimeout=30 | ||
| -o ServerAliveInterval=30 | ||
| -o ServerAliveCountMax=6 | ||
| -o StrictHostKeyChecking=no | ||
| -o UserKnownHostsFile=/dev/null | ||
| ) | ||
| SSH_READY=true | ||
| } | ||
|
|
||
| redact_bastion() { | ||
| local line | ||
| while IFS= read -r line || [[ -n "${line}" ]]; do | ||
| line="${line//${BASTION_USER}@${BASTION_IP}/<bastion>}" | ||
| line="${line//${BASTION_IP}/<bastion>}" | ||
| printf '%s\n' "${line}" | ||
| done | ||
| } | ||
|
|
||
| fetch_target_kubeconfig() { | ||
| ssh "${SSH_OPTS[@]}" "${BASTION_USER}@${BASTION_IP}" \ | ||
| "set -euo pipefail; umask 077 | ||
| oc --kubeconfig='${HUB_CONFIG_DIR}/auth/kubeconfig' -n '${TARGET_SPOKE_NAME}' \ | ||
| get secret '${TARGET_SPOKE_NAME}-admin-kubeconfig' \ | ||
| -o jsonpath='{.data.kubeconfig}' | base64 -d > '${SPOKE_KUBECONFIG}' | ||
| test -s '${SPOKE_KUBECONFIG}'" \ | ||
| 2>&1 | redact_bastion | ||
| } | ||
|
|
||
| prepare_launcher() { | ||
| cd /eco-ci-cd | ||
| ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook ./playbooks/deploy-run-eco-gotests.yaml \ | ||
| -i "${INVENTORY_PATH}/build-inventory.py" \ | ||
| --private-key "${TEMP_DIR}/ssh-key" \ | ||
| --extra-vars "kubeconfig=${SPOKE_KUBECONFIG}" \ | ||
| --extra-vars "hub_clusterconfigs_path=${HUB_CONFIG_DIR}" \ | ||
| --extra-vars "eco_gotest_dir=${WORK_DIR}" \ | ||
| --extra-vars '{ | ||
| "features": "deploymenttypes", | ||
| "labels": "!no-container", | ||
| "eco_gotests_tag": "latest", | ||
| "test_timeout": "3h", | ||
| "eco_worker_label": "", | ||
| "eco_cnf_core_net_switch_user": "", | ||
| "eco_cnf_core_net_switch_pass": "", | ||
| "eco_cnf_core_net_switch_ip": "", | ||
| "eco_cnf_core_net_mlb_addr_list": "", | ||
| "switch_lag_names": "", | ||
| "report_test_case_tag": "test_id", | ||
| "report_parameter_tag": "parameters", | ||
| "report_tc_prefix": "ibi", | ||
| "additional_test_env_variables": "-e ECO_CNF_RAN_SKIP_TLS_VERIFY=true -e ECO_CNF_RAN_ACM_OPERATOR_NAMESPACE=open-cluster-management -e ECO_TEST_TRACE=true -e ECO_VERBOSE_SCRIPT=true" | ||
| }' \ | ||
| 2>&1 | redact_bastion | tee "${REPORT_DIR}/setup.log" | ||
| } | ||
|
|
||
| run_tests() { | ||
| local -a status | ||
| set +e | ||
| ssh "${SSH_OPTS[@]}" "${BASTION_USER}@${BASTION_IP}" \ | ||
| "cd '${WORK_DIR}' && | ||
| sed -i 's/^podman run -it /podman run -i /' eco-gotests-run.sh && | ||
| exec ./eco-gotests-run.sh" \ | ||
| 2>&1 | redact_bastion | tee "${REPORT_DIR}/runner.log" | ||
| status=("${PIPESTATUS[@]}") | ||
| set -e | ||
| echo "Test execution status: ${status[0]}; log-write status: ${status[2]}." | ||
| RUN_RC=${status[0]} | ||
| (( status[1] == 0 )) || return "${status[1]}" | ||
| (( status[2] == 0 )) || return "${status[2]}" | ||
| # Exit 1 is provisional: only a completed JUnit failure may be deferred. | ||
| case "${RUN_RC}" in | ||
| 0|1) return 0 ;; | ||
| *) return "${RUN_RC}" ;; | ||
| esac | ||
| } | ||
|
|
||
| verify_test_result() { | ||
| python3 - "${REPORT_DIR}/report/deployment_suite_test_junit.xml" "${RUN_RC}" <<'PYTEST' | ||
| import sys | ||
| import xml.etree.ElementTree as ET | ||
|
|
||
| root = ET.parse(sys.argv[1]).getroot() | ||
| cases = list(root.iter("testcase")) | ||
| tests = [case for case in cases if case.get("name", "").startswith("[It] ")] | ||
| if root.tag not in ("testsuite", "testsuites") or not any(case.find("skipped") is None for case in tests): | ||
| sys.exit("Deployment Types did not execute any test cases.") | ||
| if (any(prop.get("name") == "SpecialSuiteFailureReason" and prop.get("value") for prop in root.iter("property")) or | ||
| any(case.find("error") is not None or | ||
| any(failure.get("type") == "aborted" for failure in case.findall("failure")) or | ||
| (case not in tests and case.find("failure") is not None) for case in cases)): | ||
| sys.exit("Deployment Types reported an execution or suite setup/teardown error.") | ||
| failed = any(case.find("failure") is not None for case in tests) | ||
| if int(sys.argv[2]) != 0 and not failed: | ||
| sys.exit("Deployment Types runner failed without a matching JUnit test failure.") | ||
| print(int(failed)) | ||
| PYTEST | ||
| } | ||
|
|
||
| collect_reports() { | ||
| local copy_rc=0 junit_rc=0 scp_host="${BASTION_IP}" | ||
| if [[ "${scp_host}" == *:* ]]; then scp_host="[${scp_host}]"; fi | ||
| scp -q -r "${SSH_OPTS[@]}" \ | ||
| "${BASTION_USER}@${scp_host}:${WORK_DIR}/report" "${REPORT_DIR}/" \ | ||
| 2>&1 | redact_bastion || copy_rc=$? | ||
|
|
||
| # Keep all artifacts, but give the verifier only the Ginkgo JUnit report. | ||
| ssh "${SSH_OPTS[@]}" "${BASTION_USER}@${BASTION_IP}" \ | ||
| "set -e | ||
| test -s '${WORK_DIR}/report/deployment_suite_test_junit.xml' | ||
| mkdir -p '${WORK_DIR}/junit' | ||
| cp '${WORK_DIR}/report/deployment_suite_test_junit.xml' \ | ||
| '${WORK_DIR}/junit/deploymenttypes.xml'" \ | ||
| 2>&1 | redact_bastion || junit_rc=$? | ||
|
|
||
| (( copy_rc == 0 )) || return "${copy_rc}" | ||
| return "${junit_rc}" | ||
| } | ||
|
|
||
| main() { | ||
| if [[ -f "${SHARED_DIR}/skip.txt" ]]; then | ||
| echo "Skipping IBI Deployment Types tests." | ||
| return 0 | ||
| fi | ||
|
|
||
| RESULT_FILE="${SHARED_DIR}/ibi-deploymenttypes-exit-code" | ||
| record_result 1 | ||
| trap 'finish "$?"' EXIT | ||
|
|
||
| cd /eco-ci-cd | ||
| validate_inputs | ||
| restore_target_inventory | ||
| create_work_directories | ||
| configure_ssh | ||
| fetch_target_kubeconfig | ||
| prepare_launcher | ||
| run_tests | ||
| collect_reports | ||
| REPORTS_COLLECTED=true | ||
| TEST_RESULT=$(verify_test_result) | ||
| } | ||
|
|
||
| main "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "path": "telcov10n/functional/cnf-ran/ibi-deploymenttypes/telcov10n-functional-cnf-ran-ibi-deploymenttypes-ref.yaml", | ||
| "owners": {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| ref: | ||
| as: telcov10n-functional-cnf-ran-ibi-deploymenttypes | ||
| from_image: | ||
| namespace: telcov10n-ci | ||
| name: eco-ci-cd | ||
| tag: eco-ci-cd | ||
| commands: telcov10n-functional-cnf-ran-ibi-deploymenttypes-commands.sh | ||
| timeout: 4h | ||
| grace_period: 5m | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 200Mi | ||
| env: | ||
| - name: TARGET_CLUSTER_NAME | ||
| default: "" | ||
| documentation: Target hub name used to locate its kubeconfig on the target bastion. | ||
| - name: TARGET_SPOKE_CLUSTER | ||
| default: "['ibi-target']" | ||
| documentation: Single target spoke name in the existing list format. | ||
| credentials: | ||
| - namespace: test-credentials | ||
| name: telcov10n-ansible-group-all | ||
| mount_path: /var/group_variables/common/all | ||
| documentation: |- | ||
| Restore target inventory, retrieve the target spoke kubeconfig, and prepare | ||
| deploymenttypes with the existing deploy-run-eco-gotests.yaml playbook. | ||
| Run the generated launcher without a TTY and collect console logs and reports. | ||
| Setup, execution, and report collection errors stop the workflow. | ||
| Require an executed test and a valid JUnit report before deferring test failures. | ||
| Save the test result in SHARED_DIR/ibi-deploymenttypes-exit-code and allow | ||
| later stages to continue after completed tests, including failed assertions. | ||
| Save the current run's JUnit-only directory in | ||
| SHARED_DIR/ibi-deploymenttypes-report-dir for the shared bastion verifier. | ||
| Use telcov10n-verify-junit-reports-bastion after reporting as the final step to check | ||
| both the recorded exit code and the JUnit report. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| approvers: | ||
| - ccardenosa | ||
| - eifrach | ||
| - kononovn | ||
| - mkochanowski | ||
| - rdiazcam | ||
| - rdiscala | ||
| - shaior | ||
| - timurmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Remove the trailing comma from
SPOKE_OPERATORS.The environment value is a JSON array. The comma after the final object makes the value invalid. The operator-mirroring step can fail when it parses this override.
Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents