test-apt-cdrom 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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
  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. cat Translation-de | gzip > Translation-de.gz
  18. cat Translation-de | bzip2 > Translation-de.bz2
  19. cat Translation-de | xz --format=lzma > Translation-de.lzma
  20. cat Translation-de | xz > Translation-de.xz
  21. rm Translation-en Translation-de
  22. cd - > /dev/null
  23. addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;"
  24. chmod -R -w rootdir/media/cdrom/dists
  25. aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
  26. sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
  27. testfileequal apt-cdrom.log "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."
  37. testequal 'Reading package lists...
  38. Building dependency tree...
  39. The following NEW packages will be installed:
  40. testing
  41. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  42. Inst testing (0.8.15 stable [amd64])
  43. Conf testing (0.8.15 stable [amd64])' aptget install testing -s
  44. testequal 'Reading package lists...
  45. Building dependency tree...
  46. The following NEW packages will be installed:
  47. testing:i386
  48. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  49. Inst testing:i386 (0.8.15 stable [i386])
  50. Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
  51. # check Idempotence of apt-cdrom (and disabling of Translation dropping)
  52. aptcdrom add -m -o quiet=1 -o APT::CDROM::DropTranslation=0 > apt-cdrom.log 2>&1
  53. sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
  54. testfileequal apt-cdrom.log "Scanning disc for index files..
  55. Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
  56. This disc is called:
  57. 'Debian APT Testdisk 0.8.15'
  58. Writing new source list
  59. Source list entries for this disc are:
  60. deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  61. deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  62. Repeat this process for the rest of the CDs in your set."
  63. # take Translations from previous runs as needed
  64. aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
  65. sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
  66. testfileequal apt-cdrom.log "Scanning disc for index files..
  67. Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
  68. This disc is called:
  69. 'Debian APT Testdisk 0.8.15'
  70. Writing new source list
  71. Source list entries for this disc are:
  72. deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  73. deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  74. Repeat this process for the rest of the CDs in your set."
  75. msgtest 'Test for the german description translation of' 'testing'
  76. aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail
  77. rm -rf rootdir/var/lib/apt/lists
  78. mkdir -p rootdir/var/lib/apt/lists/partial
  79. aptcdrom add -m -o quiet=1 > apt-cdrom.log 2>&1
  80. sed -i -e '/^Using CD-ROM/ d' -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' apt-cdrom.log
  81. testfileequal apt-cdrom.log "Scanning disc for index files..
  82. Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
  83. This disc is called:
  84. 'Debian APT Testdisk 0.8.15'
  85. Writing new source list
  86. Source list entries for this disc are:
  87. deb cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  88. deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
  89. Repeat this process for the rest of the CDs in your set."
  90. msgtest 'Test for the english description translation of' 'testing'
  91. aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && msgpass || msgfail
  92. # check that we really can install from a 'cdrom'
  93. testdpkgnotinstalled testing
  94. aptget install testing -y > /dev/null 2>&1
  95. testdpkginstalled testing