summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-translation-has-no-packages
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
commit21248c0f00ee71412dbadc6ebf84011cf974346d (patch)
tree7dc1f5904399482d2128765b5b86d57a4ac5b3e1 /test/integration/test-apt-translation-has-no-packages
parente5f34ad3b043abf033c1626eb8449b75955d6760 (diff)
parent4fc6b7570c3e97b65c118b58cdf6729fa94c9b03 (diff)
Merge branch 'debian/experimental' into feature/srv-records
Conflicts: cmdline/apt-helper.cc cmdline/makefile
Diffstat (limited to 'test/integration/test-apt-translation-has-no-packages')
-rwxr-xr-xtest/integration/test-apt-translation-has-no-packages41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/integration/test-apt-translation-has-no-packages b/test/integration/test-apt-translation-has-no-packages
new file mode 100755
index 000000000..440fd30cf
--- /dev/null
+++ b/test/integration/test-apt-translation-has-no-packages
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Due to corruption (local or network) a user might end up with a
+# Translation-$lang file on disk that is actually a Packages file. In this
+# case apt used to generate invalid package versions out of the
+# Translation-$lang file (i.e. apt-cache policy foo) would show a version
+# comming out of a Translation file. Downloading this versions fails as
+# there is no acquire method available for the package
+#
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "amd64"
+
+if [ ! -x ${BUILDDIRECTORY}/apt ]; then
+ msgmsg "No ${BUILDDIRECTORY}/apt"
+ msgskip
+ exit 0
+fi
+
+buildsimplenativepackage 'foo' 'all' '1.0'
+setupaptarchive
+
+APTARCHIVE=$(readlink -f ./aptarchive)
+
+# corrupt the Translation-en file to look like a regular Packages file
+rm rootdir/var/cache/apt/*.bin
+cp $APTARCHIVE/dists/unstable/main/binary-amd64/Packages \
+ rootdir/var/lib/apt/lists/*Translation-en
+
+# ensure that there is no Version for the package foo generated out of
+# the corrupted Translation-en file
+testsuccessequal "foo:
+ Installed: (none)
+ Candidate: 1.0
+ Version table:
+ 1.0 0
+ 500 file:$APTARCHIVE/ unstable/main amd64 Packages" aptcache policy foo