From 1384504286b7923a85d6235ba6f8e2eb4766d967 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 7 Feb 2011 14:38:01 +0100 Subject: [PATCH] test changelogs locally instead of depending on an online service --- test/integration/framework | 3 ++ test/integration/test-changelog | 60 ++++++++++++++------------------- 2 files changed, 29 insertions(+), 34 deletions(-) rewrite test/integration/test-changelog (81%) diff --git a/test/integration/framework b/test/integration/framework index d91599f1..e1070907 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -272,6 +272,9 @@ Package: $NAME" > ${BUILDDIR}/debian/control for SRC in $SRCS; do echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist done + mkdir -p ${BUILDDIR}/../${NAME}_${VERSION} + cp ${BUILDDIR}/debian/changelog ${BUILDDIR}/../${NAME}_${VERSION}/ + cp ${BUILDDIR}/debian/changelog ${BUILDDIR}/../${NAME}_${VERSION}.changelog rm -rf "${BUILDDIR}" msgdone "info" } diff --git a/test/integration/test-changelog b/test/integration/test-changelog dissimilarity index 81% index 292df6e3..f0527935 100755 --- a/test/integration/test-changelog +++ b/test/integration/test-changelog @@ -1,34 +1,26 @@ -#!/bin/sh -set -e - -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework - -setupenvironment -configarchitecture "i386" - -# this will be valid until ubuntu lucid is EOL (04/2015) -pkgchangelogtest="Package: apt -Architecture: i386 -Version: 0.7.25.3ubuntu7 -Filename: pool/main/a/apt/apt_0.7.25.3ubuntu7_i386.deb -Section: admin -" -cat <<-EOF >aptarchive/Packages -$pkgchangelogtest -EOF - -setupaptarchive - -echo "Apt::Changelogs::Server \"http://changelogs.ubuntu.com/\";" >> ./aptconfig.conf -msgnmsg "apt-get changelog: " -aptget changelog apt -qq > downloaded-changelog -expected="apt (0.7.25.3ubuntu7) lucid; urgency=low" -got="$(head -n1 downloaded-changelog)" -if [ -s downloaded-changelog ] && [ "$got" = "$expected" ]; then - msgpass -else - msgfail - msgwarn "$got != $expected" -fi - +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +buildsimplenativepackage 'apt' 'all' '1.0' 'stable' + +setupaptarchive +changetowebserver +aptget update -qq + +echo 'Apt::Changelogs::Server "http://localhost:8080/";' >> ./aptconfig.conf + +aptget changelog apt -qq > apt.changelog +testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)" +rm aptarchive/pool/apt_1.0/changelog + +aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' > apt.changelog +testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)" +rm aptarchive/pool/apt_1.0.changelog + +testequal 'E: changelog download failed' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' -- 2.20.1