Merge remote-tracking branch 'mvo/feature/upgrade-api' into debian/sid
[ntk/apt.git] / test / integration / test-apt-progress-fd
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6
7 setupenvironment
8 configarchitecture 'amd64' 'i386'
9
10 buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable'
11 buildsimplenativepackage 'testing' 'amd64' '0.8.15' 'stable'
12 buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable'
13 setupaptarchive
14
15 # install native
16 exec 3> apt-progress.log
17 testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3
18 testequal "dlstatus:1:0:Retrieving file 1 of 1
19 dlstatus:1:0:Retrieving file 1 of 1
20 pmstatus:dpkg-exec:0:Running dpkg
21 pmstatus:testing:0:Installing testing
22 pmstatus:testing:20:Preparing testing
23 pmstatus:testing:40:Unpacking testing
24 pmstatus:testing:60:Preparing to configure testing
25 pmstatus:dpkg-exec:60:Running dpkg
26 pmstatus:testing:60:Configuring testing
27 pmstatus:testing:80:Configuring testing
28 pmstatus:testing:100:Installed testing" cat apt-progress.log
29
30 # upgrade
31 exec 3> apt-progress.log
32 testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
33 testequal "dlstatus:1:0:Retrieving file 1 of 1
34 dlstatus:1:0:Retrieving file 1 of 1
35 pmstatus:dpkg-exec:0:Running dpkg
36 pmstatus:testing:20:Preparing testing
37 pmstatus:testing:40:Unpacking testing
38 pmstatus:testing:60:Preparing to configure testing
39 pmstatus:dpkg-exec:60:Running dpkg
40 pmstatus:testing:60:Configuring testing
41 pmstatus:testing:80:Configuring testing
42 pmstatus:testing:100:Installed testing" cat apt-progress.log
43
44 # and remove
45 exec 3> apt-progress.log
46 testsuccess aptget remove testing -y -o APT::Status-Fd=3
47 testequal "pmstatus:dpkg-exec:0:Running dpkg
48 pmstatus:testing:0:Removing testing
49 pmstatus:testing:33.3333:Preparing for removal of testing
50 pmstatus:testing:66.6667:Removing testing
51 pmstatus:testing:100:Removed testing" cat apt-progress.log
52
53
54 # install non-native and ensure we get proper progress info
55 exec 3> apt-progress.log
56 testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3
57
58 # and compare
59 testequal "dlstatus:1:0:Retrieving file 1 of 1
60 dlstatus:1:0:Retrieving file 1 of 1
61 pmstatus:dpkg-exec:0:Running dpkg
62 pmstatus:testing2:0:Installing testing2
63 pmstatus:testing2:20:Preparing testing2
64 pmstatus:testing2:40:Unpacking testing2
65 pmstatus:testing2:60:Preparing to configure testing2
66 pmstatus:dpkg-exec:60:Running dpkg
67 pmstatus:testing2:60:Configuring testing2
68 pmstatus:testing2:80:Configuring testing2
69 pmstatus:testing2:100:Installed testing2" cat apt-progress.log
70
71 rm -f apt-progress*.log