testpass() {
rm rootdir/var/cache/apt/*.bin
msgtest 'Test architecture handling' "$1 with $2"
- aptcache show libapt:$2 2> /dev/null > /dev/null && msgpass || msgfail
+ testsuccess --nomsg aptcache show libapt:$2
}
testfail() {
rm rootdir/var/cache/apt/*.bin
msgtest 'Test architecture handling' "$1 with $2"
- aptcache show libapt:$2 2> /dev/null > /dev/null && msgfail || msgpass
+ testfailure --nomsg aptcache show libapt:$2
}
testpass 'no config' 'i386'
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'