[Piuparts-devel] Bug#700849: add more advanced usage tips to README

Andreas Beckmann anbe at debian.org
Thu Feb 21 19:10:59 UTC 2013


On 2013-02-21 19:47, Ivo De Decker wrote:

> Having a script that just takes a package as argument and runs a number of
> 'standard' piuparts tests (install test, upgrade test, etc) would be nice.

Here is the script I used recently to do install and upgrade tests
for packages I NMUed (targetting wheezy via sid, or t-p-u, or s-p-u)
But I always copied it, adjusted LOCAL and logprefix and set FROM/VIA/TO
as appropriate ... (setting only FROM or TO switches from distupgrade to
install+purge and install-upgrade-purge test)

I don't know how to do this with a script that only takes a package as
argument. You don't really want to test single packages. You probably
want to test all packages from a .changes file. And each of these you want
to test individually. And they usually have versioned dependencies on each
other. Passing individial .debs or .changes to piuparts is not really
helpful for this case (by default passing a .changes would install all
.debs it lists with dpkg and ignoring dependency ordering). Therefore
I implemented --testdebs-repo and --distupgrade-to-testdebs.

Oh, and it uses several options not yet in the public GIT, just drop them.

Andreas


MIRROR=<SET THIS>
TARBALLDIR=../../basetgz

LOCAL=/tmp/000
#URL=http://
SUBDIR=.
logprefix=xx000

#FROM=lenny
FROM=squeeze

#VIA=squeeze
#VIA=squeeze-backports
#VIA=wheezy

#TO=squeeze
TO=wheezy
#TO=sid

#NO_UPGRADE_TEST=--no-upgrade-test
#WARN_ON_LEFTOVERS_AFTER_PURGE=--warn-on-leftovers-after-purge

### END OF CONFIGURABLE PART

DISTRO=${FROM:-$TO}

if [ -n "$LOCAL" ]; then
        URL=file://$LOCAL
        GET_PACKAGES="cat $LOCAL/Packages"
else
        GET_PACKAGES="wget $URL/$SUBDIR/Packages -O -"
fi

DEBS=$($GET_PACKAGES | perl -ne '$p = $1 if /^Package: (.*)/; print "$p=$1\n" if /^Version: (.*)/;')

for p in $DEBS
do
        v=${p#*=}
        p=${p%=*}
        l=${logprefix}${FROM:+-$FROM}${VIA:+-$VIA}${TO:+-$TO}_$p
        test ! -f $l.log || continue
        rm -f $l.log $l.faillog
        sudo nice \
                env PYTHONPATH=/org/piuparts.debian.org/lib/python2.6/dist-packages:/org/piuparts.debian.org/lib/python2.7/dist-packages \
                ~/bin/piuparts \
                --skip-logrotatefiles-test \
                --scriptsdir /etc/piuparts/scripts \
                --warn-on-others \
                --allow-database \
                ${MIRROR:+--mirror $MIRROR} \
                --tmpdir /tmp/piupartss \
                -b ${TARBALLDIR:-.}/$DISTRO.tar.gz \
                ${FROM:+-d $FROM} \
                ${VIA:+-d $VIA} \
                ${TO:+-d $TO} \
                --log-file $l.log \
                ${LOCAL:+--bindmount $LOCAL} \
                --testdebs-repo "deb $URL $SUBDIR/" \
                --do-not-verify-signatures \
                --distupgrade-to-testdebs \
                --dpkg-noforce-unsafe-io \
                $NO_UPGRADE_TEST \
                $WARN_ON_LEFTOVERS_AFTER_PURGE \
                --apt $p=$v
        test $? = 0 || mv $l.log $l.faillog
done



More information about the Piuparts-devel mailing list