test-bug-624218-Translation-file-handling 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'i386'
  7. buildsimplenativepackage 'coolstuff' 'all' '1.0' 'unstable'
  8. setupaptarchive
  9. changetowebserver
  10. rm -rf rootdir/var/lib/apt/lists
  11. msgtest 'No download of non-existent locals' 'with Index'
  12. LC_ALL="" aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
  13. rm -rf rootdir/var/lib/apt/lists
  14. msgtest 'Download of existent locals' 'with Index'
  15. LC_ALL="" aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail
  16. rm -rf rootdir/var/lib/apt/lists
  17. msgtest 'Download of en in LC_ALL=C' 'with Index'
  18. LC_ALL=C aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail
  19. rm -rf rootdir/var/lib/apt/lists
  20. msgtest 'Download of en as forced language' 'with Index'
  21. aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail
  22. rm -rf rootdir/var/lib/apt/lists
  23. msgtest 'Download of nothing else in forced language' 'with Index'
  24. aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
  25. rm -rf rootdir/var/lib/apt/lists
  26. msgtest 'Download no Translation- if forced language is non-existent' 'with Index'
  27. aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass
  28. rm -rf rootdir/var/lib/apt/lists
  29. msgtest 'Download of nothing if none is forced' 'with Index'
  30. aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
  31. rm -rf rootdir/var/lib/apt/lists
  32. sed -i '/i18n\/Index$/ d' $(find aptarchive -name 'Release')
  33. signreleasefiles
  34. # we have to try as not every archive includes the i18n Index in the Release file - if it has one at all
  35. msgtest 'Download no Translation- if forced language is non-existent' 'with not-announced Index'
  36. aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass
  37. rm -rf rootdir/var/lib/apt/lists
  38. find aptarchive -name 'Index' -delete
  39. msgtest 'Download of en as forced language' 'without Index'
  40. aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail
  41. rm -rf rootdir/var/lib/apt/lists
  42. msgtest 'Download of nothing else in forced language' 'without Index'
  43. aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass
  44. rm -rf rootdir/var/lib/apt/lists
  45. msgtest 'Download of ast_DE as forced language' 'without Index'
  46. aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-ast_DE$' && msgpass || msgfail
  47. rm -rf rootdir/var/lib/apt/lists
  48. msgtest 'Download of nothing else in forced language' 'without Index'
  49. aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-[^a][^s]' && msgfail || msgpass
  50. rm -rf rootdir/var/lib/apt/lists
  51. msgtest 'Download of nothing if none is forced' 'without Index'
  52. aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
  53. rm -rf rootdir/var/lib/apt/lists
  54. mkdir -p rootdir/var/lib/apt/lists
  55. touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
  56. msgtest 'Download of builtin files' 'without Index'
  57. aptget update | grep -q -e 'Translation-ast_DE' && msgpass || msgfail
  58. rm -rf rootdir/var/lib/apt/lists
  59. mkdir -p rootdir/var/lib/apt/lists
  60. touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
  61. msgtest 'Download of nothing (even builtin) if none is forced' 'without Index'
  62. aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass
  63. rm -rf rootdir/var/lib/apt/lists