Regression/bz2081583-missing-strncmp-intercept-for-ld-so: Add test

This commit is contained in:
Jesus Checa Hidalgo 2022-05-24 16:27:55 +02:00
commit fb10ef9633
3 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,8 @@
#include <iconv.h>
int main(void)
{
iconv_t fd = iconv_open("UTF-8", "EUC-JP");
iconv_close(fd);
return 0;
}

View file

@ -0,0 +1,24 @@
summary: Test strncmp intercept for ld.so
contact: Jesus Checa Hidalgo <jchecahi@redhat.com>
component:
- valgrind
test: ./runtest.sh
framework: beakerlib
require:
- gcc
link:
- verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2086540
- verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2081583
duration: 5m
tier: 1
tag:
- CI-Tier-1
adjust:
- enabled: false
when: distro < rhel-9
continue: false
- test: scl enable $COLLECTIONS -- ./runtest.sh
when: collection is defined
- require+:
- valgrind
when: collection is not defined

View file

@ -0,0 +1,29 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "cp iconv_test.c $tmp/"
rlRun "pushd $tmp"
rlRun "set -o pipefail"
rlPhaseEnd
rlPhaseStartTest
rlRun "gcc -o iconv_test iconv_test.c"
rlRun "valgrind --log-file=valgrind.out ./iconv_test"
rlAssertNotGrep "Invalid read of size" valgrind.out
rlAssertNotGrep "strncmp" valgrind.out
# Ensure valgrind finished clean
if ! rlAssertGrep "ERROR SUMMARY: 0 errors from 0 contexts" valgrind.out;
then
rlLog "`cat valgrind.out`"
fi
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd