summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-09-09 10:56:42 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-09-09 10:56:42 +0200
commit718f797cef0fb766b6f7cfa1d34b617ad047dbc5 (patch)
tree092d01ee38b493f09716dd39ba35fc5799cc8184 /test
parent89500a25b30d53ea0f5ae213c4207e13f35d1d61 (diff)
fix bashism (local outside function) and releasefile creation in testcases
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework9
-rwxr-xr-xtest/integration/test-compressed-indexes8
-rwxr-xr-xtest/integration/test-disappearing-packages8
-rwxr-xr-xtest/integration/test-releasefile-valid-until5
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() {