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.

test-apt-get-source-arch 2.7 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. DOWNLOAD10="Need to get 0 B/25 B of source archives.
  22. 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 SHA256:ed7c25c832596339bee13e4e7c45cf49f869b60d2bf57252f18191d75866c2a7
  23. 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 SHA256:f3da8c6ebc62c8ef2dae439a498dddcdacc1a07f45ff67ad12f44b6e2353c239"
  24. # pick :amd64
  25. testsuccessequal "$HEADER
  26. $DOWNLOAD10" aptget source -q --print-uris foo:amd64
  27. # pick :i386
  28. testsuccessequal "$HEADER
  29. Need to get 0 B/25 B of source archives.
  30. 'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 11 SHA256:0fcb803ffbeef26db884625aaf06e75f3eda5c994634980e7c20fd37ed1fc104
  31. 'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 14 SHA256:ca9b0b828ca22372502af2b80f61f0bd9063910ece9fc34eeaf9d9e31aa8195a" aptget source -q --print-uris foo:i386
  32. # pick :i386 by release
  33. testsuccessequal "$HEADER
  34. Selected version '0.1' (oldstable) for foo
  35. Need to get 0 B/25 B of source archives.
  36. 'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 11 SHA256:72af24b0290fe1d13a3e25fddd2633e43c87ff79d249bc850009e47bcce73565
  37. 'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 14 SHA256:ec748ad88a71f98bfdc012e1a7632377d05fe3ebbf9c0922e0691fe4d79c0585" aptget source -q --print-uris foo:i386/oldstable
  38. # pick :i386 by version
  39. testsuccessequal "$HEADER
  40. $DOWNLOAD10" aptget source -q --print-uris foo:i386=1.0
  41. # error on unknown arch
  42. testfailureequal "$HEADER
  43. E: Can not find a package for architecture 'not-a-available-arch'
  44. E: Unable to find a source package for foo:not-a-available-arch" aptget source -q --print-uris foo:not-a-available-arch
  45. # error on unavailable version for arch
  46. testfailureequal "$HEADER
  47. E: Can not find a package 'foo:amd64' with version '2.0'
  48. E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0
  49. # error on unavailable release for arch
  50. testfailureequal "$HEADER
  51. E: Can not find a package 'foo:amd64' with release 'oldstable'
  52. E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable