test-bug-618288-multiarch-same-lockstep 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. insertinstalledpackage 'libsame' 'i386,amd64' '1' 'Multi-Arch: same' 'required'
  8. insertinstalledpackage 'apt' 'i386' '1' 'Depends: libsame (= 1)
  9. Essential: yes' 'required'
  10. insertinstalledpackage 'apt2' 'amd64' '1' 'Depends: libsame (= 1)
  11. Essential: yes' 'required'
  12. buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same' '' 'required'
  13. buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'
  14. buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'
  15. setupaptarchive
  16. testsuccess aptget dist-upgrade -s -o Debug::pkgPackageManager=1
  17. # order in switch libsame:{amd64,i386} are unpacked is irrelevant, as both are installed - but we need to do it together
  18. OUTPUT=rootdir/tmp/testsuccess.output
  19. LS_U_AMD="$(grep -o -n '^Inst libsame ' $OUTPUT | cut -d: -f1)"
  20. LS_U_INT="$(grep -o -n '^Inst libsame:i386 ' $OUTPUT | cut -d: -f1)"
  21. LS_C_AMD="$(grep -o -n '^Conf libsame ' $OUTPUT | cut -d: -f1)"
  22. LS_C_INT="$(grep -o -n '^Conf libsame:i386 ' $OUTPUT | cut -d: -f1)"
  23. msgtest 'Test if' 'libsame:amd64 unpack before configure'
  24. test "$LS_U_AMD" -lt "$LS_C_AMD" && msgpass || msgfail
  25. msgtest 'Test if' 'libsame:i386 unpack before configure'
  26. test "$LS_U_INT" -lt "$LS_C_INT" && msgpass || msgfail
  27. msgtest 'Test if' 'libsame:amd64 unpack is before libsame:i386 configure'
  28. test "$LS_U_AMD" -lt "$LS_C_INT" && msgpass || msgfail
  29. msgtest 'Test if' 'libsame:i386 unpack is before libsame:amd64 configure'
  30. test "$LS_U_INT" -lt "$LS_C_AMD" && msgpass || msgfail
  31. # lets see if it really does work out
  32. testsuccess apt dist-upgrade -y