test-apt-cdrom 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. buildsimplenativepackage 'testing' 'amd64,i386' '0.8.15' 'stable'
  8. setupaptarchive --no-update
  9. changetocdrom 'Debian APT Testdisk 0.8.15'
  10. # -de is not in the Release file, but picked up anyway for compatibility
  11. cd rootdir/media/cdrom/dists/stable/main/i18n
  12. sed -e '/^Description-en:/ d' -e '/^ / d' -e '/^$/ d' Translation-en > Translation-de
  13. echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable
  14. Diese Pakete sind nur für das testen von APT gedacht,
  15. sie erfüllen keinen Zweck auf einem normalen System…
  16. ' >> Translation-de
  17. compressfile Translation-de
  18. rm Translation-en Translation-de
  19. cd - > /dev/null
  20. addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;"
  21. chmod -R -w rootdir/media/cdrom/dists
  22. aptcdromlog() {
  23. rm -f rootdir/tmp/apt-cdrom.log
  24. aptcdrom "$@" -o quiet=1 >rootdir/tmp/apt-cdrom.log 2>&1
  25. sed -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' rootdir/tmp/apt-cdrom.log
  26. }
  27. testequal "Scanning disc for index files..
  28. Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
  29. Found label 'Debian APT Testdisk 0.8.15'
  30. This disc is called:
  31. 'Debian APT Testdisk 0.8.15'
  32. Writing new source list
  33. Source list entries for this disc are:
  34. deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  35. deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  36. Repeat this process for the rest of the CDs in your set." aptcdromlog add -m
  37. testequal 'Stored label: Debian APT Testdisk 0.8.15' aptcdromlog ident -m
  38. testequal 'Reading package lists...
  39. Building dependency tree...
  40. The following NEW packages will be installed:
  41. testing
  42. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  43. Inst testing (0.8.15 stable [amd64])
  44. Conf testing (0.8.15 stable [amd64])' aptget install testing -s
  45. testequal 'Reading package lists...
  46. Building dependency tree...
  47. The following NEW packages will be installed:
  48. testing:i386
  49. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  50. Inst testing:i386 (0.8.15 stable [i386])
  51. Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
  52. # check Idempotence of apt-cdrom (and disabling of Translation dropping)
  53. testequal "Scanning disc for index files..
  54. Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
  55. This disc is called:
  56. 'Debian APT Testdisk 0.8.15'
  57. Writing new source list
  58. Source list entries for this disc are:
  59. deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  60. deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  61. Repeat this process for the rest of the CDs in your set." aptcdromlog add -m -o APT::CDROM::DropTranslation=0
  62. # take Translations from previous runs as needed
  63. testequal "Scanning disc for index files..
  64. Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
  65. This disc is called:
  66. 'Debian APT Testdisk 0.8.15'
  67. Writing new source list
  68. Source list entries for this disc are:
  69. deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  70. deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  71. Repeat this process for the rest of the CDs in your set." aptcdromlog add -m
  72. msgtest 'Test for the german description translation of' 'testing'
  73. aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail
  74. rm -rf rootdir/var/lib/apt/lists
  75. mkdir -p rootdir/var/lib/apt/lists/partial
  76. testequal "Scanning disc for index files..
  77. Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
  78. This disc is called:
  79. 'Debian APT Testdisk 0.8.15'
  80. Writing new source list
  81. Source list entries for this disc are:
  82. deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  83. deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  84. Repeat this process for the rest of the CDs in your set." aptcdromlog add -m
  85. msgtest 'Test for the english description translation of' 'testing'
  86. aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail
  87. # check that we really can install from a 'cdrom'
  88. testdpkgnotinstalled testing
  89. testsuccess aptget install testing -y
  90. testdpkginstalled testing