Skip to content

Commit ecabd0c

Browse files
committed
tests/test-coreos.sh: Refactor minor script issues
no test logic is changed. Signed-off-by: Ram Lavi <ralavi@redhat.com>
1 parent 83679f1 commit ecabd0c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/test-coreos.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,21 @@ expect_tests_to_succeed() {
128128
run_tests() {
129129
local latest_image=$1
130130
local test_output=$2
131-
./bin/kola run -b rhcos --qemu-image "${latest_image}" "${TESTS_LIST[@]}" >"${test_output}"
131+
132+
# Capture both stdout & stderr so we keep the _kola_temp path.
133+
# Non-zero exit is fine – we parse results later.
134+
./bin/kola run \
135+
-b rhcos --platform qemu \
136+
--qemu-image "${latest_image}" \
137+
"${TESTS_LIST[@]}" 2>&1 | tee "${test_output}"
132138
}
133139

134140
run_test_suite() {
135141
local latest_image=$1
136142

137143
make mantle >/dev/null
138144
test_output=${TMP_COREOS_ASSEMBLER_PATH}/tests_output
139-
run_tests ${latest_image} ${test_output} || true
145+
run_tests "${latest_image}" "${test_output}" || true
140146

141147
scratch_dir=$(grep -o '_kola_temp[^"]*' "${test_output}" | head -n1)
142148
generate_junit_from_tap_file "${scratch_dir}"
@@ -148,7 +154,9 @@ run_test_suite() {
148154

149155
teardown() {
150156
echo "Copying test artifacts to ${ARTIFACTS}"
151-
cp -r ${TMP_COREOS_ASSEMBLER_PATH}/_kola_temp/* ${ARTIFACTS} || true
157+
shopt -s nullglob
158+
cp -r "${TMP_COREOS_ASSEMBLER_PATH}"/_kola_temp/* "${ARTIFACTS}" 2>/dev/null || true
159+
shopt -u nullglob
152160
}
153161

154162
copy_segment_interfaces_systemd_units_contents() {

0 commit comments

Comments
 (0)