summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-618288-multiarch-same-lockstep
blob: fde075172f0c292e9c7b37f93ea0b1b20d1d4c19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
set -e

TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture 'amd64' 'i386'

insertinstalledpackage 'libsame' 'i386,amd64' '1' 'Multi-Arch: same' 'required'
insertinstalledpackage 'apt' 'i386' '1' 'Depends: libsame (= 1)
Essential: yes' 'required'
insertinstalledpackage 'apt2' 'amd64' '1' 'Depends: libsame (= 1)
Essential: yes' 'required'
buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same' '' 'required'
buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'
buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'

setupaptarchive
aptget dist-upgrade -s 2>&1 > output.apt

# order in switch libsame:{amd64,i386} are unpacked is irrelevant, as both are installed - but we need to do it together
LS_U_AMD="$(grep -o -n '^Inst libsame ' output.apt | cut -d: -f1)"
LS_U_INT="$(grep -o -n '^Inst libsame:i386 ' output.apt | cut -d: -f1)"
LS_C_AMD="$(grep -o -n '^Conf libsame ' output.apt | cut -d: -f1)"
LS_C_INT="$(grep -o -n '^Conf libsame:i386 ' output.apt | cut -d: -f1)"

msgtest 'Test if libsame:amd64 unpack before configure'
test "$LS_U_AMD" -lt "$LS_C_AMD" && msgpass || msgfail

msgtest 'Test if libsame:i386 unpack before configure'
test "$LS_U_INT" -lt "$LS_C_INT" && msgpass || msgfail

msgtest 'Test if libsame:amd64 unpack is before libsame:i386 configure'
test "$LS_U_AMD" -lt "$LS_C_INT" && msgpass || msgfail

msgtest 'Test if libsame:i386 unpack is before libsame:amd64 configure'
test "$LS_U_INT" -lt "$LS_C_AMD" && msgpass || msgfail