summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-732746-preferences
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-12-21 18:50:03 +0100
committerMichael Vogt <mvo@debian.org>2013-12-21 19:09:06 +0100
commit75ab11ae3880530c5354cc90c8d1ff0998f8146b (patch)
tree36a7cdb2e92eb35bc968937dc6ea34f694c9c866 /test/integration/test-bug-732746-preferences
parent9b7c10509c534b7d413b5102231cb0ca387f1c65 (diff)
downloadapt-75ab11ae3880530c5354cc90c8d1ff0998f8146b.tar.gz
make /etc/apt/preferences parser deal with comment only sections
Diffstat (limited to 'test/integration/test-bug-732746-preferences')
-rwxr-xr-xtest/integration/test-bug-732746-preferences32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/integration/test-bug-732746-preferences b/test/integration/test-bug-732746-preferences
new file mode 100755
index 000000000..b31f98aa0
--- /dev/null
+++ b/test/integration/test-bug-732746-preferences
@@ -0,0 +1,32 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'i386'
+
+insertinstalledpackage 'bar' 'i386' '1.0'
+
+cat > rootdir/etc/apt/preferences << EOF
+# random test comment header
+
+# commented out by puppy^Wpuppet
+#Package: foo
+#Pin: origin "ftp.debian.org"
+#Pin: 800
+
+Package: bar
+Pin: version 1.0
+Pin-Priority: 700
+
+#Package: bar
+#Pin: version 1.0
+#Pin: 800
+EOF
+
+testequal "Reading package lists...
+Building dependency tree..." aptget check
+
+msgtest "Ensure policy is applied"
+aptcache policy bar|grep -q "*** 1.0 700" && msgpass || msgfail