From 718f797cef0fb766b6f7cfa1d34b617ad047dbc5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 9 Sep 2011 10:56:42 +0200 Subject: fix bashism (local outside function) and releasefile creation in testcases --- test/integration/framework | 9 +++++++-- test/integration/test-compressed-indexes | 8 ++++---- test/integration/test-disappearing-packages | 8 ++++---- test/integration/test-releasefile-valid-until | 5 +++++ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 322cf2875..a2e71760e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -513,6 +513,7 @@ buildaptarchivefromfiles() { # can be overridden by testcases for their pleasure getcodenamefromsuite() { echo -n "$1"; } getreleaseversionfromsuite() { true; } +getlabelfromsuite() { true; } generatereleasefiles() { # $1 is the Date header and $2 is the ValidUntil header to be set @@ -526,13 +527,17 @@ generatereleasefiles() { local SUITE="$(echo "$dir" | cut -d'/' -f 4)" local CODENAME="$(getcodenamefromsuite $SUITE)" local VERSION="$(getreleaseversionfromsuite $SUITE)" + local LABEL="$(getlabelfromsuite $SUITE)" if [ -n "$VERSION" ]; then - VERSION="-o APT::FTPArchive::Release::Version='${VERSION}'" + VERSION="-o APT::FTPArchive::Release::Version=${VERSION}" + fi + if [ -n "$LABEL" ]; then + LABEL="-o APT::FTPArchive::Release::Label=${LABEL}" fi aptftparchive -qq release $dir \ -o APT::FTPArchive::Release::Suite="${SUITE}" \ -o APT::FTPArchive::Release::Codename="${CODENAME}" \ - -o APT::FTPArchive::Release::Label="Testcases" \ + ${LABEL} \ ${VERSION} \ | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes index 26a45812e..a5e885745 100755 --- a/test/integration/test-compressed-indexes +++ b/test/integration/test-compressed-indexes @@ -10,10 +10,10 @@ configarchitecture "i386" buildsimplenativepackage "testpkg" "i386" "1.0" setupaptarchive -local GOODSHOW="$(aptcache show testpkg) +GOODSHOW="$(aptcache show testpkg) " -local GOODPOLICY="$(aptcache policy testpkg)" -local GOODSHOWSRC="$(aptcache showsrc testpkg) +GOODPOLICY="$(aptcache policy testpkg)" +GOODSHOWSRC="$(aptcache showsrc testpkg) " test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 || msgdie 'show is broken' @@ -99,7 +99,7 @@ testrun "compressed" rm rootdir/etc/apt/apt.conf.d/02compressindex changetowebserver aptget update -qq -local GOODPOLICY="$(aptcache policy testpkg)" +GOODPOLICY="$(aptcache policy testpkg)" test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4 testequal "$GOODPOLICY" aptcache policy testpkg diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index b5d565c2f..82ba9e592 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -12,13 +12,13 @@ buildsimplenativepackage "unrelated" "all" "0.5" "unstable" setupsimplenativepackage "new-pkg" "i386" "2.0" "unstable" "Provides: old-pkg Replaces: old-pkg Conflicts: old-pkg (<< 2.0)" -local BUILDDIR="incoming/new-pkg-2.0" +BUILDDIR="incoming/new-pkg-2.0" echo "/usr/share/doc/new-pkg /usr/share/doc/old-pkg" > ${BUILDDIR}/debian/new-pkg.links buildpackage "$BUILDDIR" "unstable" "main" rm -rf "$BUILDDIR" setupsimplenativepackage "old-pkg" "all" "2.0" "unstable" "Depends: new-pkg" -local BUILDDIR="incoming/old-pkg-2.0" +BUILDDIR="incoming/old-pkg-2.0" echo "/usr/share/doc/new-pkg /usr/share/doc/old-pkg" > ${BUILDDIR}/debian/old-pkg.links echo " override_dh_link: @@ -33,9 +33,9 @@ aptget install old-pkg=1.0 --trivial-only -qq 2>&1 > /dev/null testmarkedauto # old-pkg is manual installed -local CMD="aptget dist-upgrade -y -q=0" +CMD="aptget dist-upgrade -y -q=0" msgtest "Test for equality of" "$CMD" -local COMPAREFILE=$(mktemp) +COMPAREFILE=$(mktemp) echo "The following package disappeared from your system as all files have been overwritten by other packages: old-pkg diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until index c35fe97ff..680a370cb 100755 --- a/test/integration/test-releasefile-valid-until +++ b/test/integration/test-releasefile-valid-until @@ -8,6 +8,11 @@ configarchitecture 'i386' insertpackage 'wheezy' 'apt' 'all' '0.8.15' +getlabelfromsuite() { + echo -n 'Testcases' +} + + setupaptarchive setupreleasefile() { -- cgit v1.2.3