summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-05-31 10:34:56 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-05-31 10:34:56 +0200
commit3b310a644d82abeb76b5028a9ee7b8d1b96fc629 (patch)
tree4f700ae465eb6c065dfba405741c1ab800e06f11 /test/integration/framework
parentc996a75cabffa5d3e5bc610d9f1097c2edae606f (diff)
parent4fdb612374655361c8923a4611db6a0d10054317 (diff)
merged from the debian branch
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework75
1 files changed, 47 insertions, 28 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 013a71ec0..cc5af798c 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -145,6 +145,7 @@ setupenvironment() {
echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf
echo 'quiet::NoUpdate "true";' >> aptconfig.conf
export LC_ALL=C
+ export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
msgdone "info"
}
@@ -218,6 +219,7 @@ buildsimplenativepackage() {
local DEPENDENCIES="$5"
local DESCRIPTION="$6"
local SECTION="${7:-others}"
+ local PRIORITY="${8:-optional}"
local DISTSECTION
if [ "$SECTION" = "$(echo "$SECTION" | cut -d'/' -f 2)" ]; then
DISTSECTION="main"
@@ -240,7 +242,7 @@ echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME}
-- Joe Sixpack <joe@example.org> $(date -R)" > ${BUILDDIR}/debian/changelog
echo "Source: $NAME
Section: $SECTION
-Priority: optional
+Priority: $PRIORITY
Maintainer: Joe Sixpack <joe@example.org>
Standards-Version: 3.9.1
@@ -396,29 +398,34 @@ insertpackage() {
local ARCH="$3"
local VERSION="$4"
local DEPENDENCIES="$5"
- local ARCHS="$ARCH"
- if [ "$ARCHS" = "all" ]; then
- ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')"
- fi
- for BUILDARCH in $ARCHS; do
- local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}"
- mkdir -p $PPATH aptarchive/dists/${RELEASE}/main/source
- touch aptarchive/dists/${RELEASE}/main/source/Sources
- local FILE="${PPATH}/Packages"
- echo "Package: $NAME
-Priority: optional
+ local PRIORITY="${6:-optional}"
+ local ARCHS=""
+ for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do
+ if [ "$arch" = "all" ]; then
+ ARCHS="$(aptconfig dump | grep APT::Architecture | cut -d'"' -f 2 | sed '/^$/ d' | sort | uniq | tr '\n' ' ')"
+ else
+ ARCHS="$arch"
+ fi
+ for BUILDARCH in $ARCHS; do
+ local PPATH="aptarchive/dists/${RELEASE}/main/binary-${BUILDARCH}"
+ mkdir -p $PPATH aptarchive/dists/${RELEASE}/main/source
+ touch aptarchive/dists/${RELEASE}/main/source/Sources
+ local FILE="${PPATH}/Packages"
+ echo "Package: $NAME
+Priority: $PRIORITY
Section: other
Installed-Size: 42
Maintainer: Joe Sixpack <joe@example.org>
-Architecture: $ARCH
+Architecture: $arch
Version: $VERSION
-Filename: pool/main/${NAME}/${NAME}_${VERSION}_${ARCH}.deb" >> $FILE
- test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
- echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
+Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE
+ test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
+ echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
If you find such a package installed on your system,
YOU did something horribly wrong! They are autogenerated
und used only by testcases for APT and surf no other proposeā€¦
" >> $FILE
+ done
done
}
@@ -427,21 +434,24 @@ insertinstalledpackage() {
local ARCH="$2"
local VERSION="$3"
local DEPENDENCIES="$4"
+ local PRIORITY="${5:-optional}"
local FILE="rootdir/var/lib/dpkg/status"
- echo "Package: $NAME
+ for arch in $(echo "$ARCH" | sed -e 's#,#\n#g'); do
+ echo "Package: $NAME
Status: install ok installed
-Priority: optional
+Priority: $PRIORITY
Section: other
Installed-Size: 42
Maintainer: Joe Sixpack <joe@example.org>
-Architecture: $ARCH
+Architecture: $arch
Version: $VERSION" >> $FILE
- test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
- echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
+ test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
+ echo "Description: an autogenerated dummy ${NAME}=${VERSION}/installed
If you find such a package installed on your system,
YOU did something horribly wrong! They are autogenerated
und used only by testcases for APT and surf no other proposeā€¦
" >> $FILE
+ done
}
@@ -563,13 +573,22 @@ changetowebserver() {
if which weborf > /dev/null; then
weborf -xb aptarchive/ 2>&1 > /dev/null &
addtrap "kill $!;"
- local APTARCHIVE="file://$(readlink -f ./aptarchive)"
- for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
- sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#"
- done
- return 0
+ elif which lighttpd > /dev/null; then
+ echo "server.document-root = \"$(readlink -f ./aptarchive)\"
+server.port = 8080
+server.stat-cache-engine = \"disable\"" > lighttpd.conf
+ lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid'
+ lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null &
+ addtrap "kill $!;"
+ else
+ msgdie 'You have to install weborf or lighttpd first'
+ return 1
fi
- return 1
+ local APTARCHIVE="file://$(readlink -f ./aptarchive)"
+ for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do
+ sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#"
+ done
+ return 0
}
checkdiff() {
@@ -685,7 +704,7 @@ testmarkedauto() {
while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE
else
msgtest 'Test for correctly marked as auto-installed' 'no package'
- echo > $COMPAREFILE
+ echo -n > $COMPAREFILE
fi
aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
}