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.
 
 
 
 
 
 

67 lines
1.3 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386'
  7. insertpackage 'unstable' 'cool' 'all' '1.0-1'
  8. getcodenamefromsuite() {
  9. if [ "$SUITE" = 'unstable' ]; then
  10. echo -n 'sid'
  11. else
  12. echo -n "$SUITE"
  13. fi
  14. }
  15. getreleaseversionfromsuite() {
  16. if [ "$SUITE" = 'unstable' ]; then
  17. echo -n '42.0'
  18. else
  19. echo -n '0.8.15'
  20. fi
  21. }
  22. getlabelfromsuite() {
  23. if [ "$SUITE" = 'unstable' ]; then
  24. echo -n 'UnstableTestcases'
  25. else
  26. echo -n 'Testcases'
  27. fi
  28. }
  29. setupaptarchive
  30. passdist() {
  31. msgtest 'Test that target-release is accepted' $1
  32. testsuccess --nomsg aptget dist-upgrade -t $1
  33. msgtest 'Test that target-release pins with' $1
  34. aptcache policy -t $1 | grep -q ' 990' && msgpass || msgfail
  35. }
  36. faildist() {
  37. msgtest 'Test that target-release is refused' $1
  38. testfailure --nomsg aptget dist-upgrade -t $1
  39. }
  40. msgtest 'Test that no default-release is active in this test' 'setup'
  41. aptcache policy | grep -q ' 990' && msgfall || msgpass
  42. passdist unstable
  43. passdist sid
  44. faildist sidd
  45. faildist stable
  46. passdist 42.0
  47. passdist 42.*
  48. passdist 42*
  49. passdist 4*.0
  50. faildist 21.0
  51. faildist 21*
  52. # we accept, but don't validate the following
  53. passdist a=unstable
  54. passdist n=sid
  55. passdist v=42.0
  56. passdist c=main
  57. passdist l=UnstableTestcases