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.
 
 
 
 
 
 

50 lines
1.6 KiB

  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