]> git.saurik.com Git - apt.git/blob - test/integration/test-apt-update-reporting
test-apt-download-progress: Use a larger file for testing
[apt.git] / test / integration / test-apt-update-reporting
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6 setupenvironment
7 configarchitecture 'amd64'
8
9 for i in $(seq 100); do
10 insertpackage 'unstable' "foo-$i" 'all' '1.0'
11 insertsource 'unstable' "foo-$i" 'all' '1.0'
12 done
13
14 setupaptarchive --no-update
15 changetowebserver
16
17 aptget update -o Debug::Acquire::Progress=1 2>progress.log >ignore.out
18
19 prev_percent=0.0
20 while read line; do
21 percent="$(echo "$line"|cut -b2-6)"
22 # need to cut the decimal point and digits because sh can not do
23 # float compare
24 if [ "${percent%%.*}" -lt "${prev_percent%%.*}" ]; then
25 echo "progress goes backwards"
26 cat progress.log
27 exit 1
28 fi
29 prev_percent="$percent"
30 done < progress.log
31