Skip to content

Commit 9581527

Browse files
ggordaniRedGuy GordaniVadim Rutkovsky
authored
Update nfd test script (#68006)
* Update nfd test script chnging cpu images and printing logs * Update ci-operator/step-registry/gather/must-gather/gather-must-gather-commands.sh Co-authored-by: Vadim Rutkovsky <vrutkovs@redhat.com> * Update nfd-tests-e2e-commands.sh * Update ci-operator/step-registry/gather/must-gather/gather-must-gather-commands.sh Co-authored-by: Vadim Rutkovsky <vrutkovs@redhat.com> --------- Co-authored-by: Guy Gordani <ggordani@ggordani-thinkpadp1gen3.raanaii.csb> Co-authored-by: Vadim Rutkovsky <vrutkovs@redhat.com>
1 parent db6c4ed commit 9581527

File tree

2 files changed

+17
-38
lines changed

2 files changed

+17
-38
lines changed

ci-operator/step-registry/gather/must-gather/gather-must-gather-commands.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,10 @@ MUST_GATHER_TIMEOUT=${MUST_GATHER_TIMEOUT:-"15m"}
268268
set -x # log the MG commands
269269
echo "Running must-gather..."
270270
mkdir -p ${ARTIFACT_DIR}/must-gather
271-
oc --insecure-skip-tls-verify adm must-gather $MUST_GATHER_IMAGE --timeout=$MUST_GATHER_TIMEOUT --dest-dir ${ARTIFACT_DIR}/must-gather ${EXTRA_MG_ARGS} > ${ARTIFACT_DIR}/must-gather/must-gather.log
271+
if [ -n "$MUST_GATHER_IMAGE" ]; then
272+
EXTRA_MG_ARGS="${EXTRA_MG_ARGS} ${MUST_GATHER_IMAGE}"
273+
fi
274+
oc --insecure-skip-tls-verify adm must-gather --timeout="$MUST_GATHER_TIMEOUT" --dest-dir "${ARTIFACT_DIR}/must-gather" ${EXTRA_MG_ARGS} > "${ARTIFACT_DIR}/must-gather/must-gather.log"
272275
find "${ARTIFACT_DIR}/must-gather" -type f -path '*/cluster-scoped-resources/machineconfiguration.openshift.io/*' -exec sh -c 'echo "REDACTED" > "$1" && mv "$1" "$1.redacted"' _ {} \;
273276
[ -f "${ARTIFACT_DIR}/must-gather/event-filter.html" ] && cp "${ARTIFACT_DIR}/must-gather/event-filter.html" "${ARTIFACT_DIR}/event-filter.html"
274277
installCamgi

ci-operator/step-registry/nfd/tests-e2e/nfd-tests-e2e-commands.sh

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,12 @@ spec:
1818
restartPolicy: Never
1919
containers:
2020
- name: run-nfd
21-
image: quay.io/ocp-edge-qe/eco-gotests:latest
22-
command: [ "/bin/bash", "-c", "--" ]
23-
args: [ "scripts/test-runner.sh && sleep 500" ]
21+
image: quay.io/rh_ee_ggordani/nfd_test:latest
22+
command: [ "python3", "/app/nfd_test.py" ]
23+
args: [ ]
2424
env:
2525
- name: KUBECONFIG
2626
value: "/kubeconfig/kubeconfig"
27-
- name: ECO_TEST_FEATURES
28-
value: "nfd"
29-
- name: ECO_TEST_LABELS
30-
value: "NFD"
31-
- name: ECO_TEST_VERBOSE
32-
value: "true"
33-
- name: ECO_VERBOSE_LEVEL
34-
value: "100"
35-
- name: ECO_TC_PREFIX
36-
value: "OCP"
37-
- name: ECO_HWACCEL_NFD_SUBSCRIPTION_NAME
38-
value: "nfd"
39-
- name: ECO_HWACCEL_NFD_CATALOG_SOURCE
40-
value: "redhat-operators"
41-
- name: ECO_DUMP_FAILED_TESTS
42-
value: "true"
43-
- name: ECO_HWACCEL_NFD_CPU_FLAGS_HELPER_IMAGE
44-
value: quay.io/rh_ee_ggordani/cpuinfo:release-4.15
45-
- name: ECO_REPORTS_DUMP_DIR
46-
value: /home/testuser/reports
4727
imagePullPolicy: Always
4828
resources:
4929
limits:
@@ -74,19 +54,15 @@ echo "Check pod status"
7454
oc wait --for=condition=ContainersReady=true pod/testpod --timeout=300s
7555
oc get pod testpod
7656

77-
while : ; do
78-
oc exec testpod -- ls /home/testuser/reports > /tmp/Files
79-
if ! grep -q 'nfd_suite_test_junit.xml' /tmp/Files ; then
80-
echo
81-
echo "Waiting for test results..."
82-
sleep 30
83-
else
84-
echo
85-
echo "Test results found."
86-
break
87-
fi
88-
done
57+
echo "Waiting for pod to complete..."
58+
oc wait --for=condition=PodReadyCondition=false pod/testpod --timeout=1800s || true
59+
oc wait --for=jsonpath='{.status.phase}'=Succeeded pod/testpod --timeout=300s
60+
echo "Pod completed, checking final status and logs..."
61+
oc get pod testpod
62+
oc logs testpod
8963

9064
echo "Retrieve test results..."
91-
oc exec testpod -- cat /home/testuser/reports/nfd_suite_test_junit.xml > ${ARTIFACT_DIR}/junit_nfd_suite_test.xml
92-
oc exec testpod -- cat /home/testuser/reports/report_testrun.xml > ${ARTIFACT_DIR}/junit_report_testrun.xml
65+
oc cp testpod:/home/testuser/reports/nfd_suite_test_junit.xml ${ARTIFACT_DIR}/junit_nfd_suite_test.xml || \
66+
echo "Warning: Could not copy nfd_suite_test_junit.xml"
67+
oc cp testpod:/home/testuser/reports/report_testrun.xml ${ARTIFACT_DIR}/junit_report_testrun.xml || \
68+
echo "Warning: Could not copy report_testrun.xml"

0 commit comments

Comments
 (0)