You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

95 lines
4.7 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. testbinaries() {
  8. msgtest 'Test acquired archs for' "$1"
  9. shift
  10. rm -f gotarchs.list
  11. aptget update --print-uris | grep -o '/binary-[a-z0-9-]\+/Packages' | sort > gotarchs.list
  12. while [ -n "$1" ]; do
  13. echo "/binary-${1}/Packages"
  14. shift
  15. done | sort | checkdiff - gotarchs.list && msgpass || msgfail
  16. }
  17. echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  18. testbinaries 'default & native' 'amd64' 'all'
  19. configarchitecture 'amd64' 'i386'
  20. testbinaries 'default & native + foreign' 'amd64' 'i386' 'all'
  21. configarchitecture 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel'
  22. testbinaries 'default & native + many foreigns' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'
  23. echo 'deb [arch=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  24. testbinaries 'arch=native' 'amd64' 'all'
  25. echo 'deb [arch=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  26. testbinaries 'arch=foreign' 'mips' 'all'
  27. echo 'deb [arch=kfreebsd-armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  28. testbinaries 'arch=unknown' 'kfreebsd-armel' 'all'
  29. echo 'deb [arch=amd64,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  30. testbinaries 'arch=native,foreign' 'amd64' 'i386' 'all'
  31. echo 'deb [arch=mips,armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  32. testbinaries 'arch=foreign,foreign' 'mips' 'armhf' 'all'
  33. echo 'deb [arch=kfreebsd-armel,hurd-powerpc,mipsel,armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  34. testbinaries 'arch=unknown,unknown,foreign,foreign' 'kfreebsd-armel' 'hurd-powerpc' 'mipsel' 'armel' 'all'
  35. echo 'deb [arch+=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  36. testbinaries 'arch+=native' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'
  37. echo 'deb [arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  38. testbinaries 'arch+=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'
  39. echo 'deb [arch+=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  40. testbinaries 'arch+=foreign,foreign,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'
  41. echo 'deb [arch+=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  42. testbinaries 'arch+=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' 'all'
  43. echo 'deb [arch+=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  44. testbinaries 'arch+=foreign,unknown,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' 'all'
  45. echo 'deb [arch-=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  46. testbinaries 'arch-=native' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'
  47. echo 'deb [arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  48. testbinaries 'arch-=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mipsel' 'all'
  49. echo 'deb [arch-=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  50. testbinaries 'arch-=foreign,foreign,foreign' 'amd64' 'armel' 'mipsel' 'all'
  51. echo 'deb [arch-=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  52. testbinaries 'arch-=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'all'
  53. echo 'deb [arch-=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  54. testbinaries 'arch-=foreign,unknown,foreign' 'amd64' 'armel' 'armhf' 'mipsel' 'all'
  55. echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  56. testbinaries 'subtract from a arch-set' 'i386' 'all'
  57. echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  58. testbinaries 'useless subtract from a arch-set' 'i386' 'all'
  59. echo 'deb [arch=mips,i386 arch+=armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  60. testbinaries 'addition to a arch-set' 'i386' 'mips' 'armhf' 'all'
  61. echo 'deb [arch=mips,i386 arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  62. testbinaries 'useless addition to a arch-set' 'i386' 'mips' 'all'
  63. echo 'deb [arch=i386 arch-=all] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  64. testbinaries 'substract all from arch-set' 'i386'
  65. echo 'deb [arch=i386 arch+=all] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  66. testbinaries 'useless addition of all' 'i386' 'all'
  67. echo 'deb [arch=all] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
  68. testbinaries 'explicit all' 'all'