summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-08-15 09:26:00 +0200
committerMichael Vogt <mvo@debian.org>2013-08-15 09:26:00 +0200
commitd7a4635391d9ff36152603ab6faa6eafa206750a (patch)
treee16a562e3e9a195cae286433c5751a1ab9990635 /test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
parent2a49601f69e08f06fb2727d869d420daacdd09d5 (diff)
parent183116d1a64a2610b88fa6b50f2c5199b69d5841 (diff)
Merge branch 'debian/sid' into debian/experimental
Conflicts: apt-pkg/contrib/strutl.cc apt-pkg/deb/dpkgpm.cc configure.ac debian/changelog doc/po/apt-doc.pot po/apt-all.pot po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/framework test/integration/test-bug-602412-dequote-redirect test/integration/test-ubuntu-bug-346386-apt-get-update-paywall test/interactive-helper/aptwebserver.cc test/interactive-helper/makefile
Diffstat (limited to 'test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch')
-rwxr-xr-xtest/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch120
1 files changed, 120 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..af65397ea
--- /dev/null
+++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
@@ -0,0 +1,120 @@
+#!/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)'
+
+setupsimplenativepackage 'confpkg' 'amd64' '1' 'unstable'
+BUILDDIR='incoming/confpkg-1'
+echo 'foo "bar";' > ${BUILDDIR}/pkg.conf
+echo 'pkg.conf /etc/pkg.conf' >> ${BUILDDIR}/debian/install
+buildpackage "$BUILDDIR" 'unstable' 'main' 'amd64'
+rm -rf "$BUILDDIR"
+
+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' "$*"
+ testsuccess --nomsg aptget "$@" -y --force-yes
+}
+
+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**'
+
+observehook install confpkg
+testfileequal "${hook}-v2.list" 'confpkg - < 1 **CONFIGURE**'
+testfileequal "${hook}-v3.list" 'confpkg - - none < 1 amd64 none **CONFIGURE**'
+
+observehook remove confpkg
+testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**'
+testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**'
+
+msgtest 'Conffiles of package remained after remove' 'confpkg'
+dpkg -l confpkg | grep -q '^rc' && msgpass || msgfail
+
+observehook purge confpkg
+testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**'
+testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**'
+
+msgtest 'Conffiles are gone after purge' 'confpkg'
+dpkg -l confpkg 2>/dev/null | grep -q '^rc' && msgfail || msgpass