]>
Commit | Line | Data |
---|---|---|
fb193b1c MV |
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 | ||
f46a1d94 JAK |
19 | has_progress() { |
20 | prev_percent=0.0 | |
21 | while read line; do | |
22 | percent="$(echo "$line"|cut -b2-6)" | |
23 | # need to cut the decimal point and digits because sh can not do | |
24 | # float compare | |
25 | if [ "${percent%%.*}" -lt "${prev_percent%%.*}" ]; then | |
26 | cat progress.log | |
27 | return 1 | |
28 | fi | |
29 | prev_percent="$percent" | |
30 | done < progress.log | |
31 | return 0 | |
32 | } | |
fb193b1c | 33 | |
f46a1d94 JAK |
34 | msgtest "Testing that progress does not go backward" |
35 | testsuccess --nomsg has_progress |