4 local TESTDIR
=$(readlink -f $(dirname $0))
7 configarchitecture
"i386"
13 aptget update
2>> testaptgetupdate.
diff >> testaptgetupdate.
diff || true
14 sed -i -e '/^Fetched / d' -e 's#\[[0-9]*[kMGTPY]*B\]#\[\]#' testaptgetupdate.
diff
17 msgtest
"Test for correctness of" "apt-get update with $*"
18 if [ -z "$GIVEN" ]; then
19 echo -n "" | checkdiff
- testaptgetupdate.
diff && msgpass
|| msgfail
21 echo "$GIVEN" | checkdiff
- testaptgetupdate.
diff && msgpass
|| msgfail
23 rm testaptgetupdate.
diff
26 touch aptarchive
/en.bz2
28 testaptgetupdate
"Ign file: Release.gpg
29 Ign file:$(readlink -f aptarchive)/ Translation-en
30 Get:1 file: Release []
31 Reading package lists..." "empty file en.bz2 over file"
34 echo -n "" | bzip2 > aptarchive
/en.bz2
36 testaptgetupdate
"Ign file: Release.gpg
37 Get:1 file: Release []
38 Reading package lists..." "empty archive en.bz2 over file"
42 # do the same again with http instead of file
45 touch aptarchive
/en.bz2
47 testaptgetupdate
"Ign http://localhost Release.gpg
48 Get:1 http://localhost/ Translation-en
49 Get:2 http://localhost Release []
50 Ign http://localhost/ Translation-en
51 Get:3 http://localhost Packages []
52 Reading package lists..." "empty file en.bz2 over http"
55 echo -n "" | bzip2 > aptarchive
/en.bz2
57 testaptgetupdate
"Ign http://localhost Release.gpg
58 Get:1 http://localhost/ Translation-en []
59 Get:2 http://localhost Release []
60 Ign http://localhost Packages/DiffIndex
61 Get:3 http://localhost Packages []
62 Reading package lists..." "empty archive en.bz2 over http"
66 rm aptarchive
/Packages
67 touch aptarchive
/Packages
68 buildaptarchivefromfiles
70 testaptgetupdate
"Ign http://localhost Release.gpg
71 Ign http://localhost/ Translation-en
72 Get:1 http://localhost Release []
73 Ign http://localhost Packages/DiffIndex
74 Get:2 http://localhost Packages []
75 Reading package lists..." "empty archive Packages over http"
77 find aptarchive
/ -name 'Packages*' -type f
-delete
78 touch aptarchive
/Packages.bz2
79 aptftparchive release aptarchive
/ > aptarchive
/Release
81 #FIXME: we should response with a good error message instead
82 testaptgetupdate
"Ign http://localhost Release.gpg
83 Ign http://localhost/ Translation-en
84 Get:1 http://localhost Release []
85 Ign http://localhost Packages/DiffIndex
86 Get:2 http://localhost Packages
87 Err http://localhost Packages
89 W: Failed to fetch http://localhost:8080/Packages.bz2 Undetermined Error
91 E: Some index files failed to download, they have been ignored, or old ones used instead." "empty file Packages over http"