From 542e13fc390ee8c8144b83bd97a3dcd16d57c1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Prchl=C3=ADk?= Date: Wed, 29 Jan 2025 12:25:49 +0100 Subject: [PATCH] Add coverage for RHEL-69758 --- .../main.fmf | 20 ++++++++++++++ .../test.sh | 27 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/bugs/Static-linking-results-in-misleading-error-message/main.fmf create mode 100755 tests/bugs/Static-linking-results-in-misleading-error-message/test.sh diff --git a/tests/bugs/Static-linking-results-in-misleading-error-message/main.fmf b/tests/bugs/Static-linking-results-in-misleading-error-message/main.fmf new file mode 100644 index 0000000..9a3c2d6 --- /dev/null +++ b/tests/bugs/Static-linking-results-in-misleading-error-message/main.fmf @@ -0,0 +1,20 @@ +summary: Static linking results in misleading error message + +description: |+ + This: + + /usr/bin/ld: cannot find -lc + + becomes this: + + /usr/bin/ld: cannot find -lc + /usr/bin/ld: have you installed the static version of the c library ? + +duration: 5m + +link: + - verifies: https://issues.redhat.com/browse/RHEL-69758 + +adjust+: + - when: distro < rhel-9.6 + enabled: false diff --git a/tests/bugs/Static-linking-results-in-misleading-error-message/test.sh b/tests/bugs/Static-linking-results-in-misleading-error-message/test.sh new file mode 100755 index 0000000..81b79a2 --- /dev/null +++ b/tests/bugs/Static-linking-results-in-misleading-error-message/test.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# source the test script helpers +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +. "$TMT_TREE/tests/lib.sh" || exit 1 + +rlJournalStart + rlPhaseStartSetup + buTestHeader + buEnterTmpDir + + rlRun "echo 'int main(int argc, char **argv) { return 1; }' > main.c" + rlPhaseEnd + + rlPhaseStartTest + rlRun -s "gcc -static -lfoo" 1 + + rlAssertGrep "cannot find -lfoo" "$rlRun_LOG" + rlAssertGrep "have you installed the static version of the foo library ?" "$rlRun_LOG" + rlPhaseEnd + + rlPhaseStartCleanup + buExitTmpDir + rlPhaseEnd +rlJournalPrintText +rlJournalEnd