summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-06-26 17:37:57 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-07-11 18:34:21 +0200
commit7a948ec719ecc020c2337fe3f41c5fc42699e2c1 (patch)
treece9fa8cb9a5c7bce34fa513c34ad8559813da332 /test
parent90b9659c9a959601d5ed1cc77f7c8b9e0d5b8939 (diff)
Version 3 for DPkg::Pre-Install-Pkgs with MultiArch info
Adds on top of Version 2 to all displayed version numbers the architecture as well as the MultiArch flag for consumption by the hooks. Most of the time the architecture will be the same for both versions displayed, but packages might change from "all" to "any" (or back) between versions so we can't display the architecture for packages. Pseudo-Format for Version 3: <name> <version> <arch> <m-a-flag> <compare> <version> <arch> <m-a-flag> Examples: stuff - - none < 1 amd64 none **CONFIGURE** libsame 1 i386 same < 2 i386 same **CONFIGURE** stuff 2 i386 none > 1 i386 none **CONFIGURE** libsame 2 i386 same > - - none **REMOVE** toolkit 1 all foreign > - - none **REMOVE** Closes: #712116
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch95
1 files changed, 95 insertions, 0 deletions
diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
new file mode 100755
index 000000000..aee44f76b
--- /dev/null
+++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
@@ -0,0 +1,95 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+buildsimplenativepackage 'toolkit' 'all' '1' 'stable' 'Multi-Arch: foreign'
+buildsimplenativepackage 'toolkit' 'amd64' '2' 'unstable' 'Multi-Arch: foreign'
+buildsimplenativepackage 'libsame' 'i386,amd64' '1' 'stable' 'Multi-Arch: same'
+buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same'
+buildsimplenativepackage 'stuff' 'i386,amd64' '1' 'stable' 'Depends: libsame (= 1), toolkit (= 1)'
+buildsimplenativepackage 'stuff' 'i386,amd64' '2' 'unstable' 'Depends: libsame (= 2), toolkit (= 2)'
+
+setupaptarchive
+
+hook='pre-install-pkgs'
+
+enablehookversion() {
+ echo "#!/bin/sh
+while read line; do
+ if echo \"\$line\" | grep -Fq '**'; then
+ echo \"\$line\"
+ fi
+done > ${hook}-v${1}.list" > ${hook}-v${1}.sh
+ chmod +x ${hook}-v${1}.sh
+ echo "dpkg::${hook}:: \"./${hook}-v${1}.sh --foo -bar\";
+DPkg::Tools::options::\"./${hook}-v${1}.sh\"::Version \"$1\";" > rootdir/etc/apt/apt.conf.d/hook-v$1
+}
+
+enablehookversion 2
+enablehookversion 3
+
+observehook() {
+ rm -f ${hook}-v2.list ${hook}-v3.list
+ msgtest 'Observe hooks while' "$*"
+ aptget "$@" -y --force-yes >/dev/null 2>&1 && msgpass || msgfail
+}
+
+observehook install stuff -t stable
+testfileequal "${hook}-v2.list" 'libsame - < 1 **CONFIGURE**
+toolkit - < 1 **CONFIGURE**
+stuff - < 1 **CONFIGURE**'
+testfileequal "${hook}-v3.list" 'libsame - - none < 1 amd64 same **CONFIGURE**
+toolkit - - none < 1 all foreign **CONFIGURE**
+stuff - - none < 1 amd64 none **CONFIGURE**'
+
+observehook install stuff -t unstable
+testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE**
+toolkit 1 < 2 **CONFIGURE**
+stuff 1 < 2 **CONFIGURE**'
+testfileequal "${hook}-v3.list" 'libsame 1 amd64 same < 2 amd64 same **CONFIGURE**
+toolkit 1 all foreign < 2 amd64 foreign **CONFIGURE**
+stuff 1 amd64 none < 2 amd64 none **CONFIGURE**'
+
+observehook install stuff:i386 -t unstable
+testfileequal "${hook}-v2.list" 'stuff 2 > - **REMOVE**
+libsame - < 2 **CONFIGURE**
+stuff - < 2 **CONFIGURE**'
+testfileequal "${hook}-v3.list" 'stuff 2 amd64 none > - - none **REMOVE**
+libsame - - none < 2 i386 same **CONFIGURE**
+stuff - - none < 2 i386 none **CONFIGURE**'
+
+observehook remove libsame
+testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE**'
+testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE**'
+
+observehook install stuff:i386/stable libsame:i386/stable toolkit/stable
+testfileequal "${hook}-v2.list" 'libsame 2 > 1 **CONFIGURE**
+toolkit 2 > 1 **CONFIGURE**
+stuff 2 > 1 **CONFIGURE**'
+testfileequal "${hook}-v3.list" 'libsame 2 i386 same > 1 i386 same **CONFIGURE**
+toolkit 2 amd64 foreign > 1 all foreign **CONFIGURE**
+stuff 2 i386 none > 1 i386 none **CONFIGURE**'
+
+observehook install 'libsame:*'
+testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE**
+libsame - < 2 **CONFIGURE**
+toolkit 1 < 2 **CONFIGURE**
+stuff 1 < 2 **CONFIGURE**'
+testfileequal "${hook}-v3.list" 'libsame 1 i386 same < 2 i386 same **CONFIGURE**
+libsame - - none < 2 amd64 same **CONFIGURE**
+toolkit 1 all foreign < 2 amd64 foreign **CONFIGURE**
+stuff 1 i386 none < 2 i386 none **CONFIGURE**'
+
+observehook purge stuff:i386 'libsame:*' toolkit
+testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE**
+stuff 2 > - **REMOVE**
+libsame 2 > - **REMOVE**
+toolkit 2 > - **REMOVE**'
+testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE**
+stuff 2 i386 none > - - none **REMOVE**
+libsame 2 i386 same > - - none **REMOVE**
+toolkit 2 amd64 foreign > - - none **REMOVE**'