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.
 
 
 
 
 
 

63 lines
1.9 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'i386'
  7. buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable'
  8. setupaptarchive
  9. aptgetupdate() {
  10. rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin
  11. ${1:-testwarning} aptget update --allow-insecure-repositories
  12. }
  13. PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)"
  14. DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)"
  15. PKGTEXT="$(echo "$PKGTEXT" | head -n 7)"
  16. DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-*.list'
  17. testsuccessequal "$PKGTEXT
  18. $DOWNLOG
  19. Download complete and in download only mode" aptget install cool --assume-no -d
  20. testsuccessequal "$PKGTEXT
  21. $DOWNLOG
  22. Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
  23. sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=no] #' $DEBFILE
  24. aptgetupdate 'testsuccess'
  25. testfailureequal "$PKGTEXT
  26. WARNING: The following packages cannot be authenticated!
  27. cool
  28. Install these packages without verification? [y/N] N
  29. E: Some packages could not be authenticated" aptget install cool --assume-no -d
  30. find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
  31. sed -i -e 's#\(deb\(-src\)\?\) \[trusted=no\] #\1 #' $DEBFILE
  32. aptgetupdate
  33. testfailureequal "$PKGTEXT
  34. WARNING: The following packages cannot be authenticated!
  35. cool
  36. Install these packages without verification? [y/N] N
  37. E: Some packages could not be authenticated" aptget install cool --assume-no -d
  38. testsuccessequal "$PKGTEXT
  39. WARNING: The following packages cannot be authenticated!
  40. cool
  41. Authentication warning overridden.
  42. $DOWNLOG
  43. Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated
  44. sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=yes] #' $DEBFILE
  45. aptgetupdate
  46. testsuccessequal "$PKGTEXT
  47. $DOWNLOG
  48. Download complete and in download only mode" aptget install cool --assume-no -d