]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-apt-update-reporting
test, travis: Quieter testing with a new -qq mode
[apt.git] / test / integration / test-apt-update-reporting
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7configarchitecture 'amd64'
8
9for i in $(seq 100); do
10 insertpackage 'unstable' "foo-$i" 'all' '1.0'
11 insertsource 'unstable' "foo-$i" 'all' '1.0'
12done
13
14setupaptarchive --no-update
15changetowebserver
16
17aptget update -o Debug::Acquire::Progress=1 2>progress.log >ignore.out
18
19has_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}
33
34msgtest "Testing that progress does not go backward"
35testsuccess --nomsg has_progress