summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework45
1 files changed, 42 insertions, 3 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 96cdb5f5e..fa451cf4f 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -151,6 +151,7 @@ setupenvironment() {
configarchitecture() {
local CONFFILE=rootdir/etc/apt/apt.conf.d/01multiarch.conf
+ rm -f $CONFFILE
echo "APT::Architecture \"$1\";" > $CONFFILE
shift
while [ -n "$1" ]; do
@@ -429,6 +430,27 @@ Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE
done
}
+insertsource() {
+ local RELEASE="$1"
+ local NAME="$2"
+ local ARCH="$3"
+ local VERSION="$4"
+ local DEPENDENCIES="$5"
+ local ARCHS=""
+ local SPATH="aptarchive/dists/${RELEASE}/main/source"
+ mkdir -p $SPATH
+ local FILE="${SPATH}/Sources"
+ echo "Package: $NAME
+Binary: $NAME
+Version: $VERSION
+Maintainer: Joe Sixpack <joe@example.org>
+Architecture: $ARCH" >> $FILE
+ test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
+ echo "Files:
+ d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.dsc
+ d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.tar.gz" >> $FILE
+}
+
insertinstalledpackage() {
local NAME="$1"
local ARCH="$2"
@@ -481,6 +503,10 @@ buildaptarchivefromfiles() {
generatereleasefiles
}
+# can be overridden by testcases for their pleasure
+getcodenamefromsuite() { echo -n "$1"; }
+getreleaseversionfromsuite() { true; }
+
generatereleasefiles() {
msgninfo "\tGenerate Release files… "
local DATE="${1:-now}"
@@ -489,9 +515,22 @@ generatereleasefiles() {
aptftparchive -qq release $dir -o APT::FTPArchive::Release::Patterns::='Translation-*' > $dir/Index
done
for dir in $(find ./aptarchive/dists -mindepth 1 -maxdepth 1 -type d); do
- local CODENAME="$(echo "$dir" | cut -d'/' -f 4)"
- aptftparchive -qq release $dir -o APT::FTPArchive::Release::Suite="${CODENAME}" -o APT::FTPArchive::Release::Codename="${CODENAME}" | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
- if [ "$CODENAME" = "experimental" -o "$CODENAME" = "experimental2" ]; then
+ local SUITE="$(echo "$dir" | cut -d'/' -f 4)"
+ local CODENAME="$(getcodenamefromsuite $SUITE)"
+ local VERSION="$(getreleaseversionfromsuite $SUITE)"
+ if [ -z "$VERSION" ]; then
+ aptftparchive -qq release $dir \
+ -o APT::FTPArchive::Release::Suite="${SUITE}" \
+ -o APT::FTPArchive::Release::Codename="${CODENAME}" \
+ | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
+ else
+ aptftparchive -qq release $dir \
+ -o APT::FTPArchive::Release::Suite="${SUITE}" \
+ -o APT::FTPArchive::Release::Codename="${CODENAME}" \
+ -o APT::FTPArchive::Release::Version="${VERSION}" \
+ | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference
+ fi
+ if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then
sed -i '/^Date: / a\
NotAutomatic: yes' $dir/Release
fi