call URIStart in cdrom and file method
[apt.git] / test / integration / test-apt-progress-fd
CommitLineData
42c1513b
MV
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture 'amd64' 'i386'
9
10buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable'
11buildsimplenativepackage 'testing' 'amd64' '0.8.15' 'stable'
12buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable'
13setupaptarchive
14
15# install native
16exec 3> apt-progress.log
17testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3
25b86db1 18testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
ff86d7df 19dlstatus:1:0:Retrieving file 1 of 1
f7bf262e 20dlstatus:1:20:Retrieving file 1 of 1
42c1513b 21pmstatus:dpkg-exec:0:Running dpkg
dd640f3c 22pmstatus:testing:0:Installing testing (amd64)
ecb777dd
DK
23pmstatus:testing:16.6667:Preparing testing (amd64)
24pmstatus:testing:33.3333:Unpacking testing (amd64)
25pmstatus:testing:50:Preparing to configure testing (amd64)
26pmstatus:dpkg-exec:50:Running dpkg
27pmstatus:testing:50:Configuring testing (amd64)
28pmstatus:testing:66.6667:Configuring testing (amd64)
29pmstatus:testing:83.3333:Installed testing (amd64)
25b86db1 30pmstatus:dpkg-exec:83.3333:Running dpkg'
42c1513b
MV
31
32# upgrade
33exec 3> apt-progress.log
34testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
25b86db1 35testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
ff86d7df 36dlstatus:1:0:Retrieving file 1 of 1
f7bf262e 37dlstatus:1:20:Retrieving file 1 of 1
42c1513b 38pmstatus:dpkg-exec:0:Running dpkg
4c559e97 39pmstatus:testing:0:Installing testing (amd64)
ecb777dd
DK
40pmstatus:testing:16.6667:Preparing testing (amd64)
41pmstatus:testing:33.3333:Unpacking testing (amd64)
42pmstatus:testing:50:Preparing to configure testing (amd64)
43pmstatus:dpkg-exec:50:Running dpkg
44pmstatus:testing:50:Configuring testing (amd64)
45pmstatus:testing:66.6667:Configuring testing (amd64)
46pmstatus:testing:83.3333:Installed testing (amd64)
25b86db1 47pmstatus:dpkg-exec:83.3333:Running dpkg'
4c559e97
DK
48
49# reinstall
50exec 3> apt-progress.log
51testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3
25b86db1 52testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
ff86d7df 53dlstatus:1:0:Retrieving file 1 of 1
a1380a5c 54dlstatus:1:20:Retrieving file 1 of 1
4c559e97
DK
55pmstatus:dpkg-exec:0:Running dpkg
56pmstatus:testing:0:Installing testing (amd64)
ecb777dd
DK
57pmstatus:testing:16.6667:Preparing testing (amd64)
58pmstatus:testing:33.3333:Unpacking testing (amd64)
59pmstatus:testing:50:Preparing to configure testing (amd64)
60pmstatus:dpkg-exec:50:Running dpkg
61pmstatus:testing:50:Configuring testing (amd64)
62pmstatus:testing:66.6667:Configuring testing (amd64)
63pmstatus:testing:83.3333:Installed testing (amd64)
25b86db1 64pmstatus:dpkg-exec:83.3333:Running dpkg'
42c1513b
MV
65
66# and remove
67exec 3> apt-progress.log
68testsuccess aptget remove testing -y -o APT::Status-Fd=3
25b86db1 69testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0:Running dpkg
dd640f3c 70pmstatus:testing:0:Removing testing (amd64)
ecb777dd
DK
71pmstatus:testing:25:Preparing for removal of testing (amd64)
72pmstatus:testing:50:Removing testing (amd64)
73pmstatus:testing:75:Removed testing (amd64)
25b86db1 74pmstatus:dpkg-exec:75:Running dpkg'
42c1513b 75
42c1513b
MV
76# install non-native and ensure we get proper progress info
77exec 3> apt-progress.log
78testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3
25b86db1 79testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
ff86d7df 80dlstatus:1:0:Retrieving file 1 of 1
f7bf262e 81dlstatus:1:20:Retrieving file 1 of 1
42c1513b 82pmstatus:dpkg-exec:0:Running dpkg
dd640f3c 83pmstatus:testing2:0:Installing testing2 (i386)
ecb777dd
DK
84pmstatus:testing2:16.6667:Preparing testing2 (i386)
85pmstatus:testing2:33.3333:Unpacking testing2 (i386)
86pmstatus:testing2:50:Preparing to configure testing2 (i386)
87pmstatus:dpkg-exec:50:Running dpkg
88pmstatus:testing2:50:Configuring testing2 (i386)
89pmstatus:testing2:66.6667:Configuring testing2 (i386)
90pmstatus:testing2:83.3333:Installed testing2 (i386)
25b86db1 91pmstatus:dpkg-exec:83.3333:Running dpkg'
42c1513b 92
dd640f3c 93rm -f apt-progress*.log