summaryrefslogtreecommitdiffstats
path: root/test/integration/test-bug-612958-use-dpkg-multiarch-config
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
commit851b6a097165af4d51c0db01b5e05256e5006896 (patch)
tree5f7c388ec894a7806c49a99f3bdb605d0b299a7c /test/integration/test-bug-612958-use-dpkg-multiarch-config
parentInitial commit. (diff)
downloadapt-851b6a097165af4d51c0db01b5e05256e5006896.tar.xz
apt-851b6a097165af4d51c0db01b5e05256e5006896.zip
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-bug-612958-use-dpkg-multiarch-config')
-rwxr-xr-xtest/integration/test-bug-612958-use-dpkg-multiarch-config83
1 files changed, 83 insertions, 0 deletions
diff --git a/test/integration/test-bug-612958-use-dpkg-multiarch-config b/test/integration/test-bug-612958-use-dpkg-multiarch-config
new file mode 100755
index 0000000..54200ff
--- /dev/null
+++ b/test/integration/test-bug-612958-use-dpkg-multiarch-config
@@ -0,0 +1,83 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'i386'
+
+testpass() {
+ msgtest 'Test architecture handling success' "$1 with $2"
+ rm -f archs.conf
+ aptconfig dump --no-empty --format='%V%n' APT::Architectures > archs.conf
+ testsuccess --nomsg grep "^$2\$" archs.conf
+}
+
+testfail() {
+ msgtest 'Test architecture handling failure' "$1 with $2"
+ rm -f archs.conf
+ aptconfig dump --no-empty --format='%V%n' APT::Architectures > archs.conf
+ testfailure --nomsg grep "^$2\$" archs.conf
+}
+
+testpass 'no config' 'i386'
+testfail 'no config' 'amd64'
+testfail 'no config' 'armel'
+
+CONFFILE=rootdir/etc/apt/apt.conf.d/99multiarch
+echo '#clear APT::Architectures;' >> $CONFFILE
+echo 'APT::Architectures:: "i386";' >> $CONFFILE
+echo 'APT::Architectures:: "amd64";' >> $CONFFILE
+
+testpass 'apt config' 'i386'
+testpass 'apt config' 'amd64'
+testfail 'apt config' 'armel'
+
+echo 'APT::Architectures:: "armel";' >> $CONFFILE
+
+testpass 'apt config' 'armel'
+
+rm $CONFFILE
+
+echo '#clear APT::Architectures;' >> $CONFFILE
+echo 'APT::Architectures "i386,amd64";' >> $CONFFILE
+
+testpass 'apt config' 'i386'
+testpass 'apt config' 'amd64'
+testfail 'apt config' 'armel'
+
+rm $CONFFILE
+
+echo '#clear APT::Architectures;' >> $CONFFILE
+echo 'Dir::Bin::dpkg "./dpkg-printer";' >> $CONFFILE
+
+echo '#! /bin/sh
+echo "amd64"' > ./dpkg-printer
+chmod +x ./dpkg-printer
+
+testpass 'dpkg config' 'i386'
+testpass 'dpkg config' 'amd64'
+testfail 'dpkg config' 'armel'
+
+echo '#! /bin/sh
+echo "amd64 armel"' > ./dpkg-printer
+
+testpass 'dpkg config' 'i386'
+testpass 'dpkg config' 'amd64'
+testpass 'dpkg config' 'armel'
+
+echo '#! /bin/sh
+echo "amd64
+armel"' > ./dpkg-printer
+
+testpass 'dpkg config' 'i386'
+testpass 'dpkg config' 'amd64'
+testpass 'dpkg config' 'armel'
+
+echo '#! /bin/sh
+echo "amd64
+i386"' > ./dpkg-printer
+
+testpass 'dpkg config' 'i386'
+testpass 'dpkg config' 'amd64'
+testfail 'dpkg config' 'armel'