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