test-bug-841874-warning-for-mismatching-distribution 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. insertpackage 'testing' 'foo' 'all' '1'
  8. getcodenamefromsuite() { echo -n 'stretch'; }
  9. setupaptarchive --no-update
  10. APTARCHIVE="$(readlink -f './aptarchive')"
  11. ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/stretch"
  12. ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/zurg"
  13. testfailure apt show foo
  14. testsuccess apt update
  15. testsuccess apt show foo
  16. rm -rf rootdir/var/lib/apt/lists
  17. sed -i -e 's#testing#stretch#g' rootdir/etc/apt/sources.list.d/*
  18. testsuccess apt update
  19. testsuccess apt show foo
  20. rm -rf rootdir/var/lib/apt/lists
  21. sed -i -e 's#stretch#zurg#g' rootdir/etc/apt/sources.list.d/*
  22. testwarningmsg "W: Conflicting distribution: file:$APTARCHIVE zurg InRelease (expected zurg but got stretch)" apt update
  23. testsuccess apt show foo
  24. # check that 'foo/bar' is rewritten to 'foo' while we are at it
  25. rm -rf rootdir/var/lib/apt/lists
  26. sed -i -e 's#zurg#stretch/updates#g' rootdir/etc/apt/sources.list.d/*
  27. testfailure apt update
  28. testfailure apt show foo
  29. ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/stretch/updates"
  30. testsuccess apt update
  31. testsuccess apt show foo
  32. # … but only if needed
  33. rm -rf rootdir/var/lib/apt/lists
  34. sed -i -e 's#stretch#buster#g' rootdir/etc/apt/sources.list.d/*
  35. sed -i -e 's#^Codename: stretch$#Codename: buster/updates#g' $(find ./aptarchive -name 'Release')
  36. signreleasefiles
  37. testfailure apt update
  38. testfailure apt show foo
  39. ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/buster"
  40. testsuccess apt update
  41. testsuccess apt show foo
  42. # changing codenames gets a warning, too
  43. rm -rf rootdir/var/lib/apt/lists
  44. sed -i -e 's#buster#testing#g' rootdir/etc/apt/sources.list.d/*
  45. testsuccess apt update
  46. testsuccess apt show foo
  47. sed -i -e 's#^Codename: buster#Codename: zurg#g' $(find ./aptarchive -name 'Release')
  48. signreleasefiles
  49. testwarningmsg "W: Conflicting distribution: file:$APTARCHIVE testing/updates InRelease (expected buster/updates but got zurg/updates)" apt update
  50. testsuccess apt show foo
  51. testsuccess apt update
  52. testsuccess apt show foo