Add coverage for RHEL-69758

This commit is contained in:
Miloš Prchlík 2025-01-29 12:25:49 +01:00
commit 542e13fc39
2 changed files with 47 additions and 0 deletions

View file

@ -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

View file

@ -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