summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-get-install-deb
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-apt-get-install-deb')
-rwxr-xr-xtest/integration/test-apt-get-install-deb57
1 files changed, 51 insertions, 6 deletions
diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb
index 36e94a2dc..844f1d7c5 100755
--- a/test/integration/test-apt-get-install-deb
+++ b/test/integration/test-apt-get-install-deb
@@ -8,20 +8,26 @@ setupenvironment
configarchitecture 'amd64' 'i386'
# regression test for #754904
-testfailureequal 'E: Unsupported file /dev/null given on commandline' aptget install -qq /dev/null
-
-# only consider .deb files
cat > foo.rpm <<EOF
I'm not a deb, I'm a teapot.
EOF
-testfailureequal 'E: Unsupported file ./foo.rpm given on commandline' aptget install -qq ./foo.rpm
+for exe in apt aptget; do
+ for cmd in install remove purge upgrade full-upgrade; do
+ testfailureequal 'E: Unsupported file /dev/null given on commandline' $exe $cmd -qq /dev/null
+ testfailureequal 'E: Unsupported file ./foo.rpm given on commandline' $exe $cmd -qq ./foo.rpm
+ done
+done
# and ensure we fail for invalid debs
mv foo.rpm foo.deb
-testfailuremsg "E: Sub-process Popen returned an error code (2)
+for exe in apt aptget; do
+ for cmd in install remove purge upgrade full-upgrade; do
+ testfailuremsg "E: Sub-process Popen returned an error code (2)
E: Encountered a section with no Package: header
E: Problem with MergeList ${TMPWORKINGDIRECTORY}/foo.deb
-E: The package lists or status file could not be parsed or opened." aptget install ./foo.deb
+E: The package lists or status file could not be parsed or opened." $exe $cmd ./foo.deb
+ done
+done
buildsimplenativepackage 'foo' 'i386,amd64' '1.0'
@@ -40,6 +46,41 @@ The following packages have unmet dependencies:
foo : Conflicts: foo:i386 but 1.0 is to be installed
E: Unable to correct problems, you have held broken packages." aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s
+testsuccess apt show foo --with-source ./incoming/foo_1.0_amd64.deb
+testequal 'Package: foo
+Version: 1.0' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output
+testsuccess apt show ./incoming/foo_1.0_amd64.deb
+testequal 'Package: foo
+Version: 1.0' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output
+testsuccess apt show foo:i386 ./incoming/foo_1.0_amd64.deb --with-source ./incoming/foo_1.0_i386.deb
+testequal 'Package: foo:i386
+Version: 1.0
+Package: foo
+Version: 1.0' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output
+
+testsuccess aptcache show foo --with-source ./incoming/foo_1.0_amd64.deb
+testequal 'Package: foo
+Version: 1.0
+Architecture: amd64' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output
+testsuccess aptcache show ./incoming/foo_1.0_amd64.deb
+testequal 'Package: foo
+Version: 1.0
+Architecture: amd64' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output
+testsuccess aptcache show foo:i386 ./incoming/foo_1.0_amd64.deb --with-source ./incoming/foo_1.0_i386.deb
+testequal 'Package: foo
+Version: 1.0
+Architecture: i386
+Package: foo
+Version: 1.0
+Architecture: amd64' grep -e '^Package:' -e '^Version:' -e '^Architecture:' rootdir/tmp/testsuccess.output
+
+testsuccessequal 'Sorting...
+Full Text Search...
+foo/local-deb 1.0 amd64
+ an autogenerated dummy foo=1.0/unstable
+' apt search foo --with-source ./incoming/foo_1.0_amd64.deb
+testsuccessequal 'foo - an autogenerated dummy foo=1.0/unstable' aptcache search foo --with-source ./incoming/foo_1.0_amd64.deb
+
testdpkgnotinstalled 'foo' 'foo:i386'
testsuccess aptget install ./incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1
testdpkginstalled 'foo:i386'
@@ -124,6 +165,9 @@ createpkg 'leading-newline' '
'
createpkg 'trailing-newline' '' '
'
+createpkg 'double-trailing-newline' '' '
+
+'
echo 'Package: /pkg-/
Pin: release a=experimental
@@ -132,6 +176,7 @@ Pin-Priority: 501' > rootdir/etc/apt/preferences.d/pinit
testsuccess aptget install ./incoming/pkg-as-it-should-be_0_all.deb
testsuccess aptget install "$(readlink -f ./incoming/pkg-leading-newline_0_all.deb)"
testsuccess aptget install ./incoming/pkg-trailing-newline_0_all.deb
+testsuccess aptget install ./incoming/pkg-double-trailing-newline_0_all.deb
testempty apt clean
if [ "$(id -u)" = '0' ]; then