From 081c9d442a6d39fb9bc419fe3ce697cc791cb844 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Nov 2014 21:38:53 +0100 Subject: various small additional tests and testcases Usually they don't provide a lot in terms of what they test, but they help in covering many lines from strictly anecdotal commands (stats, moo) and error messages, so that stuff which really needs to be tested, but isn't is better visible in coverage reports. Git-Dch: Ignore --- test/integration/test-apt-cli-show | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/integration/test-apt-cli-show') diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show index 4c8e134d6..930e591e0 100755 --- a/test/integration/test-apt-cli-show +++ b/test/integration/test-apt-cli-show @@ -36,3 +36,14 @@ APT-Sources: file:$APTARCHIVE/ unstable/main i386 Packages Description: Some description That has multiple lines " apt show foo + +# this is the default, but disabled by the testcases +testsuccess apt show foo -o Apt::Cmd::Disable-Script-Warning=0 +cp rootdir/tmp/testsuccess.output aptshow.output +testsuccess grep '^WARNING: ' aptshow.output + +if [ "$(id -u)" != '0' ]; then + testsuccess apt install foo -s -o APT::Get::Show-User-Simulation-Note=1 + cp rootdir/tmp/testsuccess.output aptshow.output + testsuccess grep '^NOTE: ' aptshow.output +fi -- cgit v1.2.3 From 25b86db159fbc3c043628e285c0c1ef24dec2c6e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 10 Mar 2015 00:59:44 +0100 Subject: test exitcode as well as string equality We use test{success,failure} now all over the place in the framework, so its only consequencial to do this in the situations in which we test for a specific output as well. Git-Dch: Ignore --- test/integration/test-apt-cli-show | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration/test-apt-cli-show') diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show index 930e591e0..5604620fd 100755 --- a/test/integration/test-apt-cli-show +++ b/test/integration/test-apt-cli-show @@ -24,7 +24,7 @@ APTARCHIVE=$(readlink -f ./aptarchive) # note that we do not display Description-md5 with the "apt" cmd # and also show some additional fields that are calculated -testequal "Package: foo +testsuccessequal "Package: foo Priority: optional Section: other Installed-Size: 43.0 kB -- cgit v1.2.3 From 88593886a42025d51d76051da5929b044e42efee Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 11 May 2015 15:08:08 +0200 Subject: rewrite all TFRewrite instances to use the new pkgTagSection::Write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While it is mostly busywork to rewrite all instances it actually fixes bugs as the data storage used by the new method is std::string rather than a char*, the later mostly created by c_str() from a std::string which the caller has to ensure keeps in scope – something apt-ftparchive actually didn't ensure and relied on copy-on-write behavior instead which c++11 forbids and hence the new default gcc abi doesn't use it. --- test/integration/test-apt-cli-show | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration/test-apt-cli-show') diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show index 5604620fd..43072cf03 100755 --- a/test/integration/test-apt-cli-show +++ b/test/integration/test-apt-cli-show @@ -25,11 +25,11 @@ APTARCHIVE=$(readlink -f ./aptarchive) # note that we do not display Description-md5 with the "apt" cmd # and also show some additional fields that are calculated testsuccessequal "Package: foo +Version: 1.0 Priority: optional Section: other -Installed-Size: 43.0 kB Maintainer: Joe Sixpack -Version: 1.0 +Installed-Size: 43.0 kB Download-Size: unknown APT-Manual-Installed: yes APT-Sources: file:$APTARCHIVE/ unstable/main i386 Packages -- cgit v1.2.3 From 1da3b7b8e15b642135b54684e70a0c271471f07a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 11 Jun 2015 10:56:31 +0200 Subject: show URI.Path in all acquire item descriptions It is a rather strange sight that index items use SiteOnly which strips the Path, while e.g. deb files are downloaded with NoUserPassword which does not. Important to note here is that for the file transport Path is pretty important as there is no Host which would be displayed by Site, which always resulted in "interesting" unspecific errors for "file:". Adding a 'middle' ground between the two which does show the Path but potentially modifies it (it strips a pending / at the end if existing) solves this "file:" issue, syncs the output and in the end helps to identify which file is meant exactly in progress output and co as a single site can have multiple repositories in different paths. --- test/integration/test-apt-cli-show | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration/test-apt-cli-show') diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show index 43072cf03..5f4ef1b48 100755 --- a/test/integration/test-apt-cli-show +++ b/test/integration/test-apt-cli-show @@ -32,7 +32,7 @@ Maintainer: Joe Sixpack Installed-Size: 43.0 kB Download-Size: unknown APT-Manual-Installed: yes -APT-Sources: file:$APTARCHIVE/ unstable/main i386 Packages +APT-Sources: file:$APTARCHIVE unstable/main i386 Packages Description: Some description That has multiple lines " apt show foo -- cgit v1.2.3