test-apt-get-source-arch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386" "amd64"
  7. # different version for the individual arches
  8. insertpackage 'stable' 'foo' 'amd64' '1.0'
  9. insertsource 'stable' 'foo' 'amd64' '1.0'
  10. insertpackage 'stable' 'foo' 'i386' '1.0'
  11. insertsource 'stable' 'foo' 'i386' '1.0'
  12. insertpackage 'stable' 'foo' 'i386' '2.0'
  13. insertsource 'stable' 'foo' 'i386' '2.0'
  14. insertpackage 'oldstable' 'foo' 'i386' '0.1'
  15. insertsource 'oldstable' 'foo' 'i386' '0.1'
  16. # just needed so that there is a release file entry for the test
  17. insertpackage 'oldstable' 'unreleated' 'amd64' '0.1'
  18. setupaptarchive
  19. APTARCHIVE=$(readlink -f ./aptarchive)
  20. HEADER="Reading package lists...
  21. Building dependency tree..."
  22. DOWNLOAD10="Need to get 0 B/25 B of source archives.
  23. 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 MD5Sum:b998e085e36cf162e6a33c2801318fef
  24. 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 MD5Sum:d46b9a02af8487cbeb49165540c88184"
  25. # pick :amd64
  26. testsuccessequal "$HEADER
  27. $DOWNLOAD10" aptget source -q --print-uris foo:amd64
  28. # pick :i386
  29. testsuccessequal "$HEADER
  30. Need to get 0 B/25 B of source archives.
  31. 'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 11 MD5Sum:c0de572c6f8aa576c8ff78c81132ed55
  32. 'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 14 MD5Sum:e10bb487c375b2b938d27bd31c2d1f5f" aptget source -q --print-uris foo:i386
  33. # pick :i386 by release
  34. testsuccessequal "$HEADER
  35. Selected version '0.1' (oldstable) for foo
  36. Need to get 0 B/25 B of source archives.
  37. 'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 11 MD5Sum:0811a4d85238056c613ea897f49f01af
  38. 'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 14 MD5Sum:fa1ecb7a1a53e8e6f6551ca7db888a61" aptget source -q --print-uris foo:i386/oldstable
  39. # pick :i386 by version
  40. testsuccessequal "$HEADER
  41. $DOWNLOAD10" aptget source -q --print-uris foo:i386=1.0
  42. # error on unknown arch
  43. testfailureequal "$HEADER
  44. E: Can not find a package for architecture 'not-a-available-arch'
  45. E: Unable to find a source package for foo:not-a-available-arch" aptget source -q --print-uris foo:not-a-available-arch
  46. # error on unavailable version for arch
  47. testfailureequal "$HEADER
  48. E: Can not find a package 'foo:amd64' with version '2.0'
  49. E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0
  50. # error on unavailable release for arch
  51. testfailureequal "$HEADER
  52. E: Can not find a package 'foo:amd64' with release 'oldstable'
  53. E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable