~mvo/apt/mvo

« back to all changes in this revision

Viewing changes to test/integration/test-bug-595691-empty-and-broken-archive-files

  • Committer: Michael Vogt
  • Date: 2011-11-10 15:32:52 UTC
  • mfrom: (1561.70.60 debian-experimental2)
  • Revision ID: michael.vogt@ubuntu.com-20111110153252-1u9lc3lm2cgb6b1m
merged from http://bzr.debian.org/bzr/apt/apt/debian-experimental2

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
setupflataptarchive
12
12
 
13
13
testaptgetupdate() {
14
 
        rm -rf rootdir/var/lib/apt rootdir/var/cache/apt
 
14
        rm -rf rootdir/var/lib/apt
15
15
        aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true
16
 
        sed -i -e '/^Fetched / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
 
16
        sed -i -e '/^Fetched / d' -e '/Ign / d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff
17
17
        GIVEN="$1"
18
18
        shift
19
19
        msgtest "Test for correctness of" "apt-get update with $*"
78
78
 
79
79
        createemptyfile 'en'
80
80
        testaptgetupdate "Get:1 file:  InRelease []
81
 
Ign file:  Translation-en
82
81
Reading package lists..." "empty file en.$COMPRESS over file"
83
82
 
84
83
        createemptyarchive 'en'
89
88
        # FIXME: Why omits the file transport the Packages Get line?
90
89
        #Get:3 file:  Packages []
91
90
        testaptgetupdate "Get:1 file:  InRelease []
92
 
Ign file:  Translation-en
93
91
Reading package lists..." "empty archive Packages.$COMPRESS over file"
94
92
 
95
93
        createemptyfile 'Packages'
96
94
        testaptgetupdate "Get:1 file:  InRelease []
97
 
Ign file:  Translation-en
98
95
Err file:  Packages
99
96
  Empty files can't be valid archives
100
97
W: Failed to fetch ${COMPRESSOR}:$(readlink -f aptarchive/Packages.$COMPRESS)  Empty files can't be valid archives
109
106
        testaptgetupdate "Get:1 http://localhost  InRelease []
110
107
Get:2 http://localhost  Packages []
111
108
Get:3 http://localhost  Translation-en
112
 
Ign http://localhost  Translation-en
113
109
Reading package lists..." "empty file en.$COMPRESS over http"
114
110
 
115
111
        createemptyarchive 'en'
121
117
        createemptyarchive 'Packages'
122
118
        testaptgetupdate "Get:1 http://localhost  InRelease []
123
119
Get:2 http://localhost  Packages []
124
 
Ign http://localhost  Translation-en
125
120
Reading package lists..." "empty archive Packages.$COMPRESS over http"
126
121
 
127
122
        createemptyfile 'Packages'
128
123
        #FIXME: we should response with a good error message instead
129
124
        testaptgetupdate "Get:1 http://localhost  InRelease []
130
125
Get:2 http://localhost  Packages
131
 
Ign http://localhost  Translation-en
132
126
Err http://localhost  Packages
133
127
  Empty files can't be valid archives
134
128
W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:8080_Packages)  Empty files can't be valid archives