summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-12-09 11:21:14 +0100
committerMichael Vogt <mvo@debian.org>2013-12-09 11:21:14 +0100
commitf31d34ee967cb1637c0efeb408c76a2c26bbdc07 (patch)
treee50cdcdc04f6091aadc341fd419c5d1da087e8dc /test/integration
parent42e19c826b9da6c21a6d286f31db51bc04c73d87 (diff)
parent55e3b9e3ddc2a59df06e22be4efff7f72406d4ec (diff)
Merge remote-tracking branch 'origin/feature/deb-src-bts731102' into feature/source-deb822
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-apt-get-source60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source
new file mode 100755
index 000000000..5bef781f1
--- /dev/null
+++ b/test/integration/test-apt-get-source
@@ -0,0 +1,60 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+# we need to insert a package into "unstable" so that a Release file is
+# create for the test
+insertpackage 'wheezy' 'unreleated-package' 'all' '1.0'
+
+# a "normal" package with source and binary
+insertpackage 'unstable' 'foo' 'all' '2.0'
+insertsource 'unstable' 'foo' 'all' '2.0'
+
+insertpackage 'stable' 'foo' 'all' '1.0'
+insertsource 'stable' 'foo' 'all' '1.0'
+
+# this package exists only as source
+insertsource 'wheezy' 'foo' 'all' '0.1'
+
+setupaptarchive
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+# normal operation gets highest version number
+HEADER="Reading package lists...
+Building dependency tree..."
+testequal "$HEADER
+Need to get 0 B of source archives.
+'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
+'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo
+
+# select by release
+testequal "$HEADER
+Selectied version '1.0' (stable) for foo
+Need to get 0 B of source archives.
+'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
+'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/stable
+
+# select by version
+testequal "$HEADER
+Need to get 0 B of source archives.
+'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
+'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo=1.0
+
+# select by release with no binary package (Bug#731102)
+testequal "$HEADER
+Selectied version '0.1' (wheezy) for foo
+Need to get 0 B of source archives.
+'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
+'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/wheezy
+
+# unavailable one
+testequal "$HEADER
+E: Ignore unavailable version '9.9-not-there' of package 'foo'
+E: Unable to find a source package for foo" aptget source -q --print-uris foo=9.9-not-there
+