diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-05-09 01:22:50 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-05-09 01:25:55 +0200 |
commit | 0c8171d7c52a46a719382ee7ed67451213f608ec (patch) | |
tree | 38b23d20f6cbb8f18b2a1a77701c57d064508f5a | |
parent | eb0d90f08d6a6f2ee334a94f8fb45c776f5bcd6e (diff) |
tests: be able to disable "Fetched …" statistics message
The line contains everchanging execution statistics which is harmful for
testcases as they need to filter out such lines, but this is hard so we
can just add an option to disable them instead and be done.
Git-Dch: Ignore
-rw-r--r-- | apt-private/acqprogress.cc | 3 | ||||
-rw-r--r-- | test/integration/framework | 1 | ||||
-rwxr-xr-x | test/integration/test-bug-595691-empty-and-broken-archive-files | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc index 4bcfd8f00..17a12799c 100644 --- a/apt-private/acqprogress.cc +++ b/apt-private/acqprogress.cc @@ -140,6 +140,9 @@ void AcqTextStatus::Stop() if (Quiet <= 0) cout << '\r' << BlankLine << '\r' << flush; + if (_config->FindB("quiet::NoStatistic", false) == true) + return; + if (FetchedBytes != 0 && _error->PendingError() == false) ioprintf(cout,_("Fetched %sB in %s (%sB/s)\n"), SizeToStr(FetchedBytes).c_str(), diff --git a/test/integration/framework b/test/integration/framework index ab1274d9c..9cdc31e23 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -226,6 +226,7 @@ setupenvironment() { fi echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf echo 'quiet::NoUpdate "true";' >> aptconfig.conf + echo 'quiet::NoStatistic "true";' >> aptconfig.conf echo "Acquire::https::CaInfo \"${TESTDIR}/apt.pem\";" > rootdir/etc/apt/apt.conf.d/99https echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary configcompression '.' 'gz' #'bz2' 'lzma' 'xz' diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index a05ed5fa6..8da0a52d2 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -13,7 +13,7 @@ setupflataptarchive testaptgetupdate() { rm -rf rootdir/var/lib/apt aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true - sed -i -e '/^Fetched / d' -e '/Ign / d' -e '/Release/ d' -e 's#Get:[0-9]\+ #Get: #' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff + sed -i -e '/Ign / d' -e '/Release/ d' -e 's#Get:[0-9]\+ #Get: #' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff GIVEN="$1" shift msgtest "Test for correctness of" "apt-get update with $*" |