test-apt-get-source-authenticated 924 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #
  3. # Regression test for debian bug #749795. Ensure that we fail with
  4. # an error if apt-get source foo will download a source that comes
  5. # from a unauthenticated repository
  6. #
  7. set -e
  8. TESTDIR="$(readlink -f "$(dirname "$0")")"
  9. . "$TESTDIR/framework"
  10. setupenvironment
  11. configarchitecture "i386"
  12. # a "normal" package with source and binary
  13. buildsimplenativepackage 'foo' 'all' '2.0'
  14. setupaptarchive --no-update
  15. APTARCHIVE="$(readlink -f ./aptarchive)"
  16. find "$APTARCHIVE/dists/unstable" -name '*Release*' -delete
  17. # update without authenticated InRelease file
  18. testwarning aptget update --allow-insecure-repositories
  19. # this all should fail
  20. testfailure aptget install -y foo
  21. cd downloaded
  22. testfailure aptget source foo
  23. testfailure test -e foo_2.0.dsc
  24. # allow overriding the warning
  25. testsuccess aptget source --allow-unauthenticated foo -o Debug::pkgAcquire::Worker=1
  26. testsuccess test -s foo_2.0.dsc -a -L foo_2.0.dsc