test-apt-cdrom 4.4 KB

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