]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-624218-Translation-file-handling
close leaking slave fd after setting up pty magic
[apt.git] / test / integration / test-bug-624218-Translation-file-handling
CommitLineData
7cb28948
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'i386'
8
9buildsimplenativepackage 'coolstuff' 'all' '1.0' 'unstable'
10
7824564b 11setupaptarchive --no-update
7cb28948
DK
12
13changetowebserver
7cb28948
DK
14rm -rf rootdir/var/lib/apt/lists
15
a5b9f489
DK
16translationslisted() {
17 msgtest 'No download of non-existent locals' "$1"
7824564b
DK
18 export LC_ALL=""
19 testsuccess --nomsg aptget update -o Acquire::Languages=en
20 testfailure grep -q -e 'Translation-[^e][^n] ' rootdir/tmp/testsuccess.output
a5b9f489 21 rm -rf rootdir/var/lib/apt/lists
7cb28948 22
a5b9f489 23 msgtest 'Download of existent locals' "$1"
7824564b
DK
24 testsuccess --nomsg aptget update
25 cp rootdir/tmp/testsuccess.output testsuccess.output
26 testsuccess grep -q -e 'Translation-en ' testsuccess.output
a5b9f489 27 rm -rf rootdir/var/lib/apt/lists
7cb28948 28
a5b9f489 29 msgtest 'Download of en in LC_ALL=C' "$1"
7824564b
DK
30 export LC_ALL=C
31 testsuccess --nomsg aptget update
32 cp rootdir/tmp/testsuccess.output testsuccess.output
33 testsuccess grep -q -e 'Translation-en ' testsuccess.output
a5b9f489 34 rm -rf rootdir/var/lib/apt/lists
7824564b 35 unset LC_ALL
7cb28948 36
a5b9f489 37 msgtest 'Download of en as forced language' "$1"
7824564b
DK
38 testsuccess --nomsg aptget update -o Acquire::Languages=en
39 cp rootdir/tmp/testsuccess.output testsuccess.output
40 testsuccess grep -q -e 'Translation-en ' testsuccess.output
a5b9f489 41 rm -rf rootdir/var/lib/apt/lists
7cb28948 42
a5b9f489 43 msgtest 'Download of nothing else in forced language' "$1"
7824564b
DK
44 testsuccess --nomsg aptget update -o Acquire::Languages=en
45 testfailure grep -q -e 'Translation-[^e][^n] ' rootdir/tmp/testsuccess.output
a5b9f489 46 rm -rf rootdir/var/lib/apt/lists
7cb28948 47
a5b9f489 48 msgtest 'Download no Translation- if forced language is non-existent' "$1"
7824564b
DK
49 testsuccess --nomsg aptget update -o Acquire::Languages=ast_DE
50 testfailure grep -q -e 'Translation-' rootdir/tmp/testsuccess.output
a5b9f489
DK
51 rm -rf rootdir/var/lib/apt/lists
52
53 msgtest 'Download of nothing if none is forced' "$1"
7824564b
DK
54 testsuccess --nomsg aptget update -o Acquire::Languages=none
55 testfailure grep -q -e 'Translation' rootdir/tmp/testsuccess.output
a5b9f489
DK
56 rm -rf rootdir/var/lib/apt/lists
57}
58
59translationslisted 'with full Index'
60
7933b3a1
MV
61# No Release file at all, so no records about Translation files
62# (fallback to guessing)
7824564b 63find aptarchive \( -name 'Release' -o -name 'InRelease' \) -delete
18593cf7 64configallowinsecurerepositories "true";
7cb28948 65
7cb28948 66msgtest 'Download of en as forced language' 'without Index'
7824564b
DK
67testwarning --nomsg aptget update -o Acquire::Languages=en
68cp rootdir/tmp/testsuccess.output testsuccess.output
69testsuccess grep -q -e 'Translation-en ' testsuccess.output
7cb28948
DK
70rm -rf rootdir/var/lib/apt/lists
71
72msgtest 'Download of nothing else in forced language' 'without Index'
7824564b
DK
73testwarning --nomsg aptget update -o Acquire::Languages=en
74testfailure grep -q -e 'Translation-[^e][^n] ' rootdir/tmp/testsuccess.output
7cb28948
DK
75rm -rf rootdir/var/lib/apt/lists
76
77msgtest 'Download of ast_DE as forced language' 'without Index'
7824564b
DK
78testwarning --nomsg aptget update -o Acquire::Languages=ast_DE
79cp rootdir/tmp/testsuccess.output testsuccess.output
80testsuccess grep -q -e 'Translation-ast_DE$' testsuccess.output
7cb28948
DK
81rm -rf rootdir/var/lib/apt/lists
82
83msgtest 'Download of nothing else in forced language' 'without Index'
7824564b
DK
84testwarning --nomsg aptget update -o Acquire::Languages=ast_DE
85testfailure grep -q -e 'Translation-[^a][^s]' rootdir/tmp/testsuccess.output
7cb28948
DK
86rm -rf rootdir/var/lib/apt/lists
87
88msgtest 'Download of nothing if none is forced' 'without Index'
7824564b
DK
89testwarning --nomsg aptget update -o Acquire::Languages=none
90testfailure grep -q -e 'Translation' rootdir/tmp/testsuccess.output
7cb28948
DK
91rm -rf rootdir/var/lib/apt/lists
92
93mkdir -p rootdir/var/lib/apt/lists
94touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
95
96msgtest 'Download of builtin files' 'without Index'
7824564b
DK
97testwarning --nomsg aptget update
98cp rootdir/tmp/testsuccess.output testsuccess.output
99testsuccess grep -q -e 'Translation-ast_DE' testsuccess.output
7cb28948
DK
100rm -rf rootdir/var/lib/apt/lists
101
102mkdir -p rootdir/var/lib/apt/lists
103touch rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_i18n_Translation-ast_DE
104
105msgtest 'Download of nothing (even builtin) if none is forced' 'without Index'
7824564b
DK
106testwarning --nomsg aptget update -o Acquire::Languages=none
107testfailure grep -q -e 'Translation' rootdir/tmp/testsuccess.output
7cb28948 108rm -rf rootdir/var/lib/apt/lists