From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129781 invoked by alias); 6 Dec 2019 21:17:59 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 129756 invoked by uid 89); 6 Dec 2019 21:17:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_BADIPHTTP,KAM_LOTSOFHASH autolearn=ham version=3.3.1 spammy=Packaging, nil, sk:symlink, bzip2 X-Spam-Status: No, score=-15.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_BADIPHTTP,KAM_LOTSOFHASH autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Dec 2019 21:17:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575667073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gFo+aeRZAdUnYeTqF+kbK+njdgVBD/EXl7ZPPpO5AaM=; b=GMWwAisDDvGb7UyvjkSf6mS49SMRKwbwX0dKJid2tjPpXrts86xuhxlH/HmCmOP3Ad4yZT rStFMO09wXOCTXEMNNGaEBYiygnvVwGNGh8TXhWMsjJ7EKQ1TKD7lvW019E8yqquAbFgqa NzHz0FJ7/C93F0iPPSvlflawVgUEc0g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-22-hJqL5T8APSO2vuPZXOg9iQ-1; Fri, 06 Dec 2019 16:17:52 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 439F51005512 for ; Fri, 6 Dec 2019 21:17:51 +0000 (UTC) Received: from redhat.com (ovpn-116-64.phx2.redhat.com [10.3.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0DC1B19C70 for ; Fri, 6 Dec 2019 21:17:51 +0000 (UTC) Received: from fche by redhat.com with local (Exim 4.92) (envelope-from ) id 1idKyz-0006Di-QT for elfutils-devel@sourceware.org; Fri, 06 Dec 2019 16:17:49 -0500 Date: Fri, 06 Dec 2019 21:17:00 -0000 From: "Frank Ch. Eigler" To: elfutils-devel@sourceware.org Subject: Re: RFCv2: debuginfod debian archive support Message-ID: <20191206211749.GA23895@redhat.com> References: <20191202225401.GF4136@redhat.com> MIME-Version: 1.0 In-Reply-To: <20191202225401.GF4136@redhat.com> User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: hJqL5T8APSO2vuPZXOg9iQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00240.txt.bz2 Hi - Presenting testing for the debuginfod .deb/.ddeb support patch, after finding a good debian-packaging tutorial, and generating a workable basic set of test deb's on a Ubuntu box. This patch is also on the elfutils.git fche/debuginfod-deb branch. In the absence of objections, I plan to merge this next week. commit 1d9ff81da0f5e1c7383b255c15529402035ad5bf Author: Frank Ch. Eigler Date: Fri Dec 6 16:08:50 2019 -0500 debuginfod: deb support, tests =20=20=20=20 Using a synthetic .deb/.ddeb from a Ubuntu 18 machine, extend the debuginfod testsuite with some .deb processing, if the dpkg-deb binary is installed. =20=20=20=20 Signed-off-by: Frank Ch. Eigler diff --git a/config/ChangeLog b/config/ChangeLog index d71fb39..9b2a408 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2019-12-06 Frank Ch. Eigler + + * elfutils.spec.in (debuginfod): Add BuildRequire dpkg + for deb testing. (Available on Fedora & EPEL, not base RHEL.) + 2019-11-28 Mark Wielaard =20 * elfutils.spec.in (debuginfod): Add an explicit Requires diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in index 1cdca21..faeb7f8 100644 --- a/config/elfutils.spec.in +++ b/config/elfutils.spec.in @@ -35,6 +35,9 @@ BuildRequires: pkgconfig(libarchive) >=3D 3.1.2 BuildRequires: bzip2 # For the run-debuginfod-find.sh test case in %check for /usr/sbin/ss BuildRequires: iproute +%if 0%{?fedora} >=3D 20 +BuildRequires: dpkg +%endif BuildRequires: curl =20 %define _gnu %{nil} diff --git a/tests/ChangeLog b/tests/ChangeLog index 8fcb161..ba3a10e 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,10 @@ +2019-12-06 Frank Ch. Eigler + + * debuginfod-debs/*: New test files, based on + https://wiki.debian.org/Packaging/Intro. + * run-debuginfod-find.sh: Test deb file processing (if dpkg + installed). + 2019-12-02 Frank Ch. Eigler =20 * run-debuginfod-find.sh: Adjust to "rpm"->"archive" in metrics. diff --git a/tests/debuginfod-debs/hithere-dbgsym_1.0-1_amd64.ddeb b/tests/= debuginfod-debs/hithere-dbgsym_1.0-1_amd64.ddeb new file mode 100644 index 0000000..f9879eb Binary files /dev/null and b/tests/debuginfod-debs/hithere-dbgsym_1.0-1_amd= 64.ddeb differ diff --git a/tests/debuginfod-debs/hithere_1.0-1.debian.tar.xz b/tests/debu= ginfod-debs/hithere_1.0-1.debian.tar.xz new file mode 100644 index 0000000..9f0ce68 Binary files /dev/null and b/tests/debuginfod-debs/hithere_1.0-1.debian.tar= .xz differ diff --git a/tests/debuginfod-debs/hithere_1.0-1.dsc b/tests/debuginfod-deb= s/hithere_1.0-1.dsc new file mode 100644 index 0000000..d5f72b9 --- /dev/null +++ b/tests/debuginfod-debs/hithere_1.0-1.dsc @@ -0,0 +1,19 @@ +Format: 3.0 (quilt) +Source: hithere +Binary: hithere +Architecture: any +Version: 1.0-1 +Maintainer: Lars Wirzenius +Standards-Version: 3.9.2 +Build-Depends: debhelper (>=3D 9) +Package-List: + hithere deb misc optional arch=3Dany +Checksums-Sha1: + 2dcd65497a12a3ea03223f52186447bd5733dce9 617 hithere_1.0.orig.tar.gz + 0b71331ef1c714c5bac67878551864b7356c56ce 764 hithere_1.0-1.debian.tar.xz +Checksums-Sha256: + 63062b582a712f169f37a5f52a41aa3ca9a405aafb8aa837bc906fa413b62cdb 617 hith= ere_1.0.orig.tar.gz + 9afa907e360e626639ccb86b86e799429bea27149034aec5d5c7e500971d651e 764 hith= ere_1.0-1.debian.tar.xz +Files: + 5b2830fa1fcd44ce489774771625526e 617 hithere_1.0.orig.tar.gz + 70106164d9397c70c2c1a4594e9897e4 764 hithere_1.0-1.debian.tar.xz diff --git a/tests/debuginfod-debs/hithere_1.0-1_amd64.deb b/tests/debuginf= od-debs/hithere_1.0-1_amd64.deb new file mode 100644 index 0000000..11d1e95 Binary files /dev/null and b/tests/debuginfod-debs/hithere_1.0-1_amd64.deb = differ diff --git a/tests/debuginfod-debs/hithere_1.0.orig.tar.gz b/tests/debuginf= od-debs/hithere_1.0.orig.tar.gz new file mode 100644 index 0000000..23abea7 Binary files /dev/null and b/tests/debuginfod-debs/hithere_1.0.orig.tar.gz = differ diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh index c2926a0..cd31e30 100755 --- a/tests/run-debuginfod-find.sh +++ b/tests/run-debuginfod-find.sh @@ -18,6 +18,10 @@ =20 . $srcdir/test-subr.sh # includes set -e =20 +# for test case debugging, uncomment: +# set -x +# VERBOSE=3D-vvvv + DB=3D${PWD}/.debuginfod_tmp.sqlite tempfiles $DB export DEBUGINFOD_CACHE_PATH=3D${PWD}/.client_cache @@ -30,7 +34,7 @@ cleanup() if [ $PID1 -ne 0 ]; then kill $PID1; wait $PID1; fi if [ $PID2 -ne 0 ]; then kill $PID2; wait $PID2; fi =20 - rm -rf F R L ${PWD}/.client_cache* + rm -rf F R D L ${PWD}/.client_cache* exit_cleanup } =20 @@ -52,8 +56,8 @@ done # So we gather the LD_LIBRARY_PATH with this cunning trick: ldpath=3D`testrun sh -c 'echo $LD_LIBRARY_PATH'` =20 -mkdir F R L -# not tempfiles F R L - they are directories which we clean up manually +mkdir F R L D +# not tempfiles F R L D - they are directories which we clean up manually ln -s ${abs_builddir}/dwfllines L/foo # any program not used elsewhere i= n this test =20 wait_ready() @@ -82,7 +86,7 @@ wait_ready() fi } =20 -env LD_LIBRARY_PATH=3D$ldpath DEBUGINFOD_URLS=3D ${abs_builddir}/../debugi= nfod/debuginfod -F -R -d $DB -p $PORT1 -t0 -g0 R F L & +env LD_LIBRARY_PATH=3D$ldpath DEBUGINFOD_URLS=3D ${abs_builddir}/../debugi= nfod/debuginfod $VERBOSE -F -R -d $DB -p $PORT1 -t0 -g0 R F L & PID1=3D$! # Server must become ready wait_ready $PORT1 'ready' 1 @@ -158,7 +162,7 @@ cmp $filename F/prog2 filename=3D`testrun ${abs_top_builddir}/debuginfod/debuginfod-find source = $BUILDID2 ${PWD}/prog2.c` cmp $filename ${PWD}/prog2.c =20 -cp -rp ${abs_srcdir}/debuginfod-rpms R +cp -rvp ${abs_srcdir}/debuginfod-rpms R kill -USR1 $PID1 # All rpms need to be in the index rpms=3D$(find R -name \*rpm | wc -l) @@ -177,7 +181,7 @@ for i in $newrpms; do mkdir $subdir; cd $subdir; ls -lah ../$i - rpm2cpio ../$i | cpio -id; + rpm2cpio ../$i | cpio -ivd; cd ..; done sourcefiles=3D$(find -name \*\\.debug \ @@ -205,10 +209,12 @@ rpm_test() { buildid=3D`env LD_LIBRARY_PATH=3D$ldpath ${abs_builddir}/../src/readel= f \ -a $filename | grep 'Build ID' | cut -d ' ' -f 7` test $__BUILDID =3D $buildid -=20=20=20=20 - filename=3D`testrun ${abs_top_builddir}/debuginfod/debuginfod-find sou= rce $__BUILDID $__SOURCEPATH` - hash=3D`cat $filename | sha1sum | awk '{print $1}'` - test $__SOURCESHA1 =3D $hash + + if test "x$__SOURCEPATH" !=3D "x"; then + filename=3D`testrun ${abs_top_builddir}/debuginfod/debuginfod-find= source $__BUILDID $__SOURCEPATH` + hash=3D`cat $filename | sha1sum | awk '{print $1}'` + test $__SOURCESHA1 =3D $hash + fi } =20 =20 @@ -257,13 +263,26 @@ export DEBUGINFOD_CACHE_PATH=3D${PWD}/.client_cache2 mkdir -p $DEBUGINFOD_CACHE_PATH # NB: inherits the DEBUGINFOD_URLS to the first server # NB: run in -L symlink-following mode for the L subdir -env LD_LIBRARY_PATH=3D$ldpath ${abs_builddir}/../debuginfod/debuginfod -F = -d ${DB}_2 -p $PORT2 -L L & +env LD_LIBRARY_PATH=3D$ldpath ${abs_builddir}/../debuginfod/debuginfod $VE= RBOSE -F -U -d ${DB}_2 -p $PORT2 -L L D & PID2=3D$! tempfiles ${DB}_2 wait_ready $PORT2 'ready' 1 =20 # have clients contact the new server export DEBUGINFOD_URLS=3Dhttp://127.0.0.1:$PORT2 + +if type dpkg-deb 2>/dev/null; then + # copy in the deb files + cp -rvp ${abs_srcdir}/debuginfod-debs/*deb D + kill -USR1 $PID2 + # All debs need to be in the index + debs=3D$(find D -name \*deb | wc -l) + wait_ready $PORT2 'scanned_total{source=3D"archive"}' `expr $debs` + + # ubuntu + rpm_test f17a29b5a25bd4960531d82aa6b07c8abe84fa66 "" "" +fi + rm -rf $DEBUGINFOD_CACHE_PATH testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID =20