From e5c8500beabafda73f03d31c733548a59d766b09 Mon Sep 17 00:00:00 2001 From: Michal Kolar Date: Fri, 6 Dec 2024 12:07:38 +0000 Subject: [PATCH] update tests/testsuite Sync the test case with Fedora Rawhide. Resolves: RHEL-69755 --- tests/testsuite/Makefile | 8 +++--- tests/testsuite/dynamic_linking-dg.patch | 29 -------------------- tests/testsuite/dynamic_linking.patch | 29 -------------------- tests/testsuite/main.fmf | 33 ++++++++++++++++++++++ tests/testsuite/runtest.sh | 35 +++++++++++------------- 5 files changed, 53 insertions(+), 81 deletions(-) delete mode 100644 tests/testsuite/dynamic_linking-dg.patch delete mode 100644 tests/testsuite/dynamic_linking.patch create mode 100644 tests/testsuite/main.fmf diff --git a/tests/testsuite/Makefile b/tests/testsuite/Makefile index f729bae..59c8522 100644 --- a/tests/testsuite/Makefile +++ b/tests/testsuite/Makefile @@ -6,7 +6,7 @@ # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # -# Copyright (c) 2010 Red Hat, Inc. +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -28,7 +28,7 @@ export TESTVERSION=1.0 BUILT_FILES= -FILES=$(METADATA) runtest.sh Makefile PURPOSE dynamic_linking.patch dynamic_linking-dg.patch +FILES=$(METADATA) runtest.sh Makefile PURPOSE .PHONY: all install download clean @@ -51,9 +51,9 @@ $(METADATA): Makefile @echo "Path: $(TEST_DIR)" >> $(METADATA) @echo "Description: Runs upstream testsuite" >> $(METADATA) @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 19m" >> $(METADATA) + @echo "TestTime: 35m" >> $(METADATA) @echo "RunFor: libffi" >> $(METADATA) - @echo "Requires: libffi libffi-devel gcc dejagnu rpm-build gcc-c++ texinfo strace" >> $(METADATA) + @echo "Requires: libffi libffi-devel libtool gcc dejagnu rpm-build gcc-c++ texinfo strace" >> $(METADATA) @echo "Priority: Normal" >> $(METADATA) @echo "License: GPLv3" >> $(METADATA) @echo "Confidential: no" >> $(METADATA) diff --git a/tests/testsuite/dynamic_linking-dg.patch b/tests/testsuite/dynamic_linking-dg.patch deleted file mode 100644 index fb10ae3..0000000 --- a/tests/testsuite/dynamic_linking-dg.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- testsuite/lib/libffi-dg.exp 2008-02-14 19:45:33.000000000 -0500 -+++ testsuite/lib/libffi-dg.exp 2015-02-13 13:32:08.422053435 -0500 -@@ -110,7 +110,7 @@ - } - verbose "gccdir $gccdir" - -- set ld_library_path "." -+ set ld_library_path "" - append ld_library_path ":${gccdir}" - - set compiler "${gccdir}/xgcc" -@@ -127,16 +127,13 @@ - } - } - } -- # add the library path for libffi. -- append ld_library_path ":${blddirffi}/.libs" -- - verbose "ld_library_path: $ld_library_path" - - # Point to the Libffi headers in libffi. - set libffi_include "${blddirffi}/include" - verbose "libffi_include $libffi_include" - -- set libffi_dir "${blddirffi}/.libs" -+ set libffi_dir "/usr/LIBRARY_DIR" - verbose "libffi_dir $libffi_dir" - if { $libffi_dir != "" } { - set libffi_dir [file dirname ${libffi_dir}] diff --git a/tests/testsuite/dynamic_linking.patch b/tests/testsuite/dynamic_linking.patch deleted file mode 100644 index 65de4d7..0000000 --- a/tests/testsuite/dynamic_linking.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- testsuite/lib/libffi.exp 2013-03-16 07:19:39.000000000 -0400 -+++ testsuite/lib/libffi.exp 2014-10-22 11:10:42.449143642 -0400 -@@ -118,7 +118,7 @@ - } - verbose "gccdir $gccdir" - -- set ld_library_path "." -+ set ld_library_path "" - append ld_library_path ":${gccdir}" - - set compiler "${gccdir}/xgcc" -@@ -142,16 +142,13 @@ - - } - -- # add the library path for libffi. -- append ld_library_path ":${blddirffi}/.libs" -- - verbose "ld_library_path: $ld_library_path" - - # Point to the Libffi headers in libffi. - set libffi_include "${blddirffi}/include" - verbose "libffi_include $libffi_include" - -- set libffi_dir "${blddirffi}/.libs" -+ set libffi_dir "/usr/LIBRARY_DIR" - verbose "libffi_dir $libffi_dir" - if { $libffi_dir != "" } { - set libffi_dir [file dirname ${libffi_dir}] diff --git a/tests/testsuite/main.fmf b/tests/testsuite/main.fmf new file mode 100644 index 0000000..360ae2b --- /dev/null +++ b/tests/testsuite/main.fmf @@ -0,0 +1,33 @@ +summary: Runs upstream testsuite +description: '' +enabled: true +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1031159 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=839210 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1006261 +tag: + - CI-Tier-1 + - RHEL6 + - Tier1 + - rhel-buildroot +tier: '1' +contact: mcermak@redhat.com +component: + - libffi +test: ./runtest.sh +framework: beakerlib +require: + - libffi + - libffi-devel + - libtool + - gcc + - dejagnu + - rpm-build + - gcc-c++ + - texinfo + - strace +duration: 35m +extra-nitrate: TC#0063644 +extra-summary: /tools/libffi/Sanity/testsuite +extra-task: /tools/libffi/Sanity/testsuite +id: 2d3a499f-1f59-40f0-a76c-1c73569d0512 diff --git a/tests/testsuite/runtest.sh b/tests/testsuite/runtest.sh index 92c2f0f..19a7f8c 100755 --- a/tests/testsuite/runtest.sh +++ b/tests/testsuite/runtest.sh @@ -8,7 +8,7 @@ # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # -# Copyright (c) 2010 Red Hat, Inc. +# Copyright (c) 2010 Red Hat, Inc. All rights reserved. # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -26,7 +26,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include rhts environment -. /usr/lib/beakerlib/beakerlib.sh +. /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGES=(libffi libffi-devel gcc dejagnu rpm-build gcc-c++) @@ -40,33 +40,30 @@ rlJournalStart done; rlRun "TmpDir=`mktemp -d`" 0 "Creating tmp directory" - rlRun "cp *.patch $TmpDir/" rlRun "pushd $TmpDir" rlFetchSrcForInstalled libffi rlRun "rpm -ivh libffi*.src.rpm" rlRun "popd" rlRun "specfile=$(rpm --eval='%_specdir')/libffi.spec" - rlRun "rpmbuild -bp $specfile" + rlRun "rpmbuild -bp --undefine specpartsdir $specfile" rlRun "builddir=$(rpm --eval='%_builddir')" - rlRun "pushd $builddir/libffi-*/" + rlRun "pushd $(dirname `find $builddir -name configure`)" rlRun "./configure" - rlRUn "make" + rlRun "make" rlPhaseEnd rlPhaseStartTest "Run testsuite" - - # patching the testsuite to test the installed libraries instead of the built ones - if [ -e /usr/lib64/libffi.so ]; then - export LD_LIBRARY_PATH=/usr/lib64 - perl -i -pe 's/LIBRARY_DIR/lib64/' $TmpDir/dynamic_linking.patch - perl -i -pe 's/LIBRARY_DIR/lib64/' $TmpDir/dynamic_linking-dg.patch - else - export LD_LIBRARY_PATH=/usr/lib - perl -i -pe 's/LIBRARY_DIR/lib/' $TmpDir/dynamic_linking.patch - perl -i -pe 's/LIBRARY_DIR/lib/' $TmpDir/dynamic_linking-dg.patch - fi - test -e testsuite/lib/libffi.exp && rlRun "patch testsuite/lib/libffi.exp < $TmpDir/dynamic_linking.patch" - test -e testsuite/lib/libffi-dg.exp && rlRun "patch testsuite/lib/libffi-dg.exp < $TmpDir/dynamic_linking-dg.patch" + set -xe + # Patch the testsuite to run with the installed libffi libraries, not + # with the ones built from the rpm. + # Do not add the current dir or the build dir to ld_library_path + sed -i 's/set ld_library_path "."/set ld_library_path ""/' testsuite/lib/libffi*.exp + sed -i '/append ld_library_path.*blddirffi/d' testsuite/lib/libffi*.exp + # Set ld_library_path to the system libdir (typically /usr/lib or /usr/lib64) + export MYLIBDIR=$(rpm --eval '%{_libdir}') + sed -i 's;set libffi_dir.*"[^"]*";set libffi_dir "'"${MYLIBDIR}"'";' testsuite/lib/libffi*.exp + fgrep -e 'set ld_library_path' -e 'set libffi_dir' testsuite/lib/libffi.exp + set +xe rlLog "Checking whether we test really the installed libraries." strace -F -e open,openat,stat -o strace.log -- make check LIBFFI_SO_CALLS=`cat strace.log | grep libffi.so | grep -v ENOENT | grep -v 'usr/lib' | grep -v '\"\/lib' | grep -v 'unfinished' | wc -l`