test-apt-ftparchive-notautomatic 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386'
  7. getnotautomaticfromsuite() {
  8. case "$1" in
  9. experimental|backports) echo 'yes';;
  10. esac
  11. }
  12. getbutautomaticupgradesfromsuite() {
  13. case "$1" in
  14. backports) echo 'yes';;
  15. esac
  16. }
  17. insertpackage 'unstable' 'foo' 'i386' '1'
  18. insertpackage 'backports' 'foo' 'i386' '3~bpo1'
  19. insertpackage 'experimental' 'foo' 'i386' '3'
  20. setupaptarchive
  21. # check no unstable NotAutomatic field
  22. testfailure grep "NotAutomatic:" aptarchive/dists/unstable/*Release
  23. # check backports NotAutomatic field
  24. testsuccess grep "NotAutomatic: yes" aptarchive/dists/backports/*Release
  25. # check experimental NotAutomatic field
  26. testsuccess grep "NotAutomatic: yes" aptarchive/dists/experimental/*Release
  27. # check no unstable ButAutomaticUpgrades field
  28. testfailure grep "ButAutomaticUpgrades:" aptarchive/dists/unstable/*Release
  29. # check backports ButAutomaticUpgrades field
  30. testsuccess grep "ButAutomaticUpgrades: yes" aptarchive/dists/backports/*Release
  31. # check no experimental ButAutomaticUpgrades field
  32. testfailure grep "ButAutomaticUpgrades:" aptarchive/dists/experimental/*Release
  33. testsuccessequal 'Reading package lists...
  34. Building dependency tree...
  35. The following NEW packages will be installed:
  36. foo
  37. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  38. Inst foo (1 unstable [i386])
  39. Conf foo (1 unstable [i386])' apt install foo -s
  40. insertinstalledpackage 'foo' 'i386' '2'
  41. testsuccessequal 'Reading package lists...
  42. Building dependency tree...
  43. The following packages will be upgraded:
  44. foo
  45. 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  46. Inst foo [2] (3~bpo1 backports [i386])
  47. Conf foo (3~bpo1 backports [i386])' apt install foo -s