diff --git a/tests/testsuite/interesting-cases.sh b/tests/testsuite/interesting-cases.sh new file mode 100644 index 0000000..1d89f70 --- /dev/null +++ b/tests/testsuite/interesting-cases.sh @@ -0,0 +1,102 @@ +#!/bin/bash + +function verify_test () { + local pattern="$1" + local log="$2" + local subject="$3" + local issue="$4" + + rlRun "grep -E '^PASS: $pattern' $log.tests" 0 "$subject ($issue)" +} + + +function verify_interesting_cases () { + local tool="$1" + local tool_label="$2" + local tool_log="$3" + + local arch="$(rlGetPrimaryArch)" + + rlPhaseStartTest "$tool_label / Verify interesting test cases" + # + # RHEL-10.0 + # + if rlIsRHEL ">=10"; then + if [ "$tool" = "ld" ]; then + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-align" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-data-pie" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-data-shared" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-got-pie" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-got-shared" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-text-pie" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-text-shared" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-discard-pie" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + [ "$arch" == "aarch64" ] && verify_test "ld-aarch64/relr-discard-shared" \ + "$tool_log" \ + "Please support DT_RELR/pack-relative-relocs in RHEL10 on aarch64" \ + "https://issues.redhat.com/browse/RHEL-31846" + + else + rlLogInfo "No tests for $tool and RHEL-10" + fi + + # + # RHEL-9.5.0 + # + elif rlIsRHEL ">=9.5" "<10"; then + if [ "$tool" = "binutils" ]; then + verify_test "Check if efi app format is recognized" \ + "$tool_log" \ + "\"Check if efi app format is recognized\" upstream test case fails for aarch64 binutils builds" \ + "https://issues.redhat.com/browse/RHEL-39953" + + elif [ "$tool" = "ld" ]; then + verify_test "ld-elf/pr27590a" \ + "$tool_log" \ + "Perf tools compilation '.gnu.debuglto_.debug_macro' referenced in section '.gnu.debuglto_.debug_macro' of X defined in discarded section '.gnu.debuglto_.debug_macro[wm4.0.c5f57b9d27e9e0df712a778cc74f572d]' of X" \ + "https://issues.redhat.com/browse/RHEL-43758" + + verify_test "ld-elf/pr27590b" \ + "$tool_log" \ + "Perf tools compilation '.gnu.debuglto_.debug_macro' referenced in section '.gnu.debuglto_.debug_macro' of X defined in discarded section '.gnu.debuglto_.debug_macro[wm4.0.c5f57b9d27e9e0df712a778cc74f572d]' of X" \ + "https://issues.redhat.com/browse/RHEL-43758" + + else + rlLogInfo "No tests for $tool and RHEL-9.5.0" + fi + fi + rlPhaseEnd +} diff --git a/tests/testsuite/test-with-cross.sh b/tests/testsuite/test-with-cross.sh index c0ffcb1..8f5ada8 100755 --- a/tests/testsuite/test-with-cross.sh +++ b/tests/testsuite/test-with-cross.sh @@ -31,6 +31,7 @@ . /usr/share/beakerlib/beakerlib.sh || exit 1 . "$TMT_TREE/tests/lib.sh" || exit 1 +. ./interesting-cases.sh || exit 1 rlJournalStart rlPhaseStartSetup @@ -102,20 +103,7 @@ rlJournalStart rlLogInfo "All tests:\n$(grep -E '^[A-Z]+:' "$tool_log.tests" | sort)" rlPhaseEnd - rlPhaseStartTest "$tool_label / Verify interesting test cases" - if rlIsRHEL ">=9.5"; then - if [ "$TOOL" = "binutils" ]; then - rlRun "grep -E '^PASS: Check if efi app format is recognized' $tool_log.tests" 0 \ - "\"Check if efi app format is recognized\" upstream test case fails for aarch64 binutils builds (https://issues.redhat.com/browse/RHEL-39953)" - - else - rlLogInfo "No tests for binutils and >=RHEL-9.5.0" - fi - - else - rlLogInfo "No tests for >=RHEL-9.5.0" - fi - rlPhaseEnd + verify_interesting_cases "$TOOL" "$tool_label" "$tool_log" done done diff --git a/tests/testsuite/test.sh b/tests/testsuite/test.sh index a144ed4..e4cd9ee 100755 --- a/tests/testsuite/test.sh +++ b/tests/testsuite/test.sh @@ -31,6 +31,7 @@ . /usr/share/beakerlib/beakerlib.sh || exit 1 . "$TMT_TREE/tests/lib.sh" || exit 1 +. ./interesting-cases.sh || exit 1 rlJournalStart rlPhaseStartSetup @@ -76,20 +77,7 @@ rlJournalStart rlLogInfo "All tests:\n$(grep -E '^[A-Z]+:' "$tool_log.tests" | sort)" rlPhaseEnd - rlPhaseStartTest "$tool_label / Verify interesting test cases" - if rlIsRHEL ">=9.5"; then - if [ "$TOOL" = "binutils" ]; then - rlRun "grep -E '^PASS: Check if efi app format is recognized' $tool_log.tests" \ - "\"Check if efi app format is recognized\" upstream test case fails for aarch64 binutils builds (https://issues.redhat.com/browse/RHEL-39953)" - - else - rlLogInfo "No tests for binutils and >=RHEL-9.5.0" - fi - - else - rlLogInfo "No tests for >=RHEL-9.5.0" - fi - rlPhaseEnd + verify_interesting_cases "$TOOL" "$tool_label" "$tool_log" done rlPhaseStartCleanup