libabigail/tests/runtestabidb1.sh.in

51 lines
1.4 KiB
Bash
Raw Permalink Normal View History

#! /bin/bash
abidb: Introduce a tool to manage the ABI of a Linux distribution This patch introduces a new tool named abidb. It manages a Git repository of the Application Binary Interfaces of a set of shared libraries. Those ABIs are stored in the Git repository in the form of ABIXML files. The tool then supports the verification of the ABI compatibility of a given binary against the stored ABIs of shared libraries. * configure.ac: Condition building abidb on the presence of python and the required modules. * doc/manuals/Makefile.am: Add the abidb.rst documentation to source distribution. Distribute the abidb.1 manpage file as well. * doc/manuals/abidb.rst: New documentation file. * doc/manuals/conf.py: Configure the generation of the abidb.1 manage from the abidb.rst file above. * doc/manuals/libabigail-tools.rst: Add a reference to the new abidb tool. * tests/Makefile.am: Register runabidb1.sh and runabidb2.sh as tests for abidb. Register runabidb1.sh.in and runabidb2.sh.in as input files for autoconf generated runabidb1.sh and runabidb2.sh. * tests/data/Makefile.am: Add abidb2client.c, abidb2so.c and abidb2soBAD.c to source distribution. * tests/data/abidb2client.c: New source file for test input binaries. * tests/data/abidb2so.c: Likewise. * tests/data/abidb2soBAD.c: Likewise. * tests/runtestabidb1.sh.in: New test script input for autoconf generation. * tests/runtestabidb2.sh.in: Likewise. * tools/Makefile.am: Add the new abidb tool to the set of tools. * tools/abidb: The New Tool, ladies and gentlemen! Signed-off-by: Frank Ch. Eigler <fche@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-05 15:42:44 +00:00
# Run an abidb test based on the binaries right here
# test prereqs
type git 2>/dev/null || (echo "need git" ; exit 77)
type ldd 2>/dev/null || (echo "need ldd" ; exit 77)
type eu-readelf 2>/dev/null || (echo "need eu-readelf" ; exit 77)
type debuginfod-find 2>/dev/null || (echo "need debuginfod-find" ; exit 77)
toolssrcdir=@abs_top_srcdir@/tools
toolsdir=@abs_top_builddir@/tools
PATH=$toolsdir:$PATH
export PATH
type $toolsdir/abidw && ABIDW=$toolsdir/abidw
type $toolsdir/abidiff && ABIDIFF=$toolsdir/abidiff
type $toolssrcdir/abidb && ABIDB=$toolssrcdir/abidb
datadir=@abs_top_srcdir@/tests/data
set -x
set -e
gitdir=$(mktemp -d --tmpdir abidb-XXXXXXXX)
function clean_env
{
rm -rf "$gitdir"
}
trap "clean_env" EXIT
git init $gitdir
cd $gitdir
git config user.email "john@tester.doe.com"
git config user.name "John Tester Doe"
abidb: Introduce a tool to manage the ABI of a Linux distribution This patch introduces a new tool named abidb. It manages a Git repository of the Application Binary Interfaces of a set of shared libraries. Those ABIs are stored in the Git repository in the form of ABIXML files. The tool then supports the verification of the ABI compatibility of a given binary against the stored ABIs of shared libraries. * configure.ac: Condition building abidb on the presence of python and the required modules. * doc/manuals/Makefile.am: Add the abidb.rst documentation to source distribution. Distribute the abidb.1 manpage file as well. * doc/manuals/abidb.rst: New documentation file. * doc/manuals/conf.py: Configure the generation of the abidb.1 manage from the abidb.rst file above. * doc/manuals/libabigail-tools.rst: Add a reference to the new abidb tool. * tests/Makefile.am: Register runabidb1.sh and runabidb2.sh as tests for abidb. Register runabidb1.sh.in and runabidb2.sh.in as input files for autoconf generated runabidb1.sh and runabidb2.sh. * tests/data/Makefile.am: Add abidb2client.c, abidb2so.c and abidb2soBAD.c to source distribution. * tests/data/abidb2client.c: New source file for test input binaries. * tests/data/abidb2so.c: Likewise. * tests/data/abidb2soBAD.c: Likewise. * tests/runtestabidb1.sh.in: New test script input for autoconf generation. * tests/runtestabidb2.sh.in: Likewise. * tools/Makefile.am: Add the new abidb tool to the set of tools. * tools/abidb: The New Tool, ladies and gentlemen! Signed-off-by: Frank Ch. Eigler <fche@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2023-12-05 15:42:44 +00:00
# Run a quick test against the local distribution, presumed via debuginfod
unset DEBUGINFOD_VERBOSE DEBUGINFOD_PROGRESS
for targetbin in /bin/sh /bin/ls /bin/make
do
debuginfod-find debuginfo "$targetbin" || continue # skip if debuginfo not available or file does not exist
for solib in `ldd "$targetbin" | grep -F '=>' | awk '{print $3}'`;
do
$ABIDB --loglevel=debug --git $gitdir --submit "$solib"
done
$ABIDB --loglevel=debug --git $gitdir --check "$targetbin"
done
# How many shared libraries did we collect?
(cd $gitdir; git ls-files)