From 8f418981337503ff7abedd872f788b51bcdbc886 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 22 Apr 2014 16:07:32 +0200 Subject: show upgradable packages after apt update Closes: 748389 --- test/integration/test-apt-cli-update | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 test/integration/test-apt-cli-update (limited to 'test/integration/test-apt-cli-update') diff --git a/test/integration/test-apt-cli-update b/test/integration/test-apt-cli-update new file mode 100755 index 000000000..8237bf03f --- /dev/null +++ b/test/integration/test-apt-cli-update @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'foo' 'all' '2.0' +insertinstalledpackage 'foo' 'all' '1.0' + +setupaptarchive + +APTARCHIVE=$(readlink -f ./aptarchive) + +testequal "1 package can be upgraded. Run 'apt list --upgradable' to see it." apt update -q -- cgit v1.2.3 From 1df24acfdb8ba1cd8bbbaa166f170dda480ce41e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 19 Oct 2014 14:14:37 +0200 Subject: check for failure message in testsuccess/failure These functions check the exit code of the command, but for apt commands we can go further and require an error message for non-zero exits and none for zero exits. Git-Dch: Ignore --- test/integration/test-apt-cli-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration/test-apt-cli-update') diff --git a/test/integration/test-apt-cli-update b/test/integration/test-apt-cli-update index 8237bf03f..987bb9adb 100755 --- a/test/integration/test-apt-cli-update +++ b/test/integration/test-apt-cli-update @@ -10,7 +10,7 @@ configarchitecture "i386" insertpackage 'unstable' 'foo' 'all' '2.0' insertinstalledpackage 'foo' 'all' '1.0' -setupaptarchive +setupaptarchive --no-update APTARCHIVE=$(readlink -f ./aptarchive) -- cgit v1.2.3 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-update | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/integration/test-apt-cli-update') diff --git a/test/integration/test-apt-cli-update b/test/integration/test-apt-cli-update index 987bb9adb..83cc94b93 100755 --- a/test/integration/test-apt-cli-update +++ b/test/integration/test-apt-cli-update @@ -8,10 +8,17 @@ setupenvironment configarchitecture "i386" insertpackage 'unstable' 'foo' 'all' '2.0' +cp rootdir/var/lib/dpkg/status dpkg.status insertinstalledpackage 'foo' 'all' '1.0' setupaptarchive --no-update APTARCHIVE=$(readlink -f ./aptarchive) +testequal 'E: The update command takes no arguments' apt update -q arguments + testequal "1 package can be upgraded. Run 'apt list --upgradable' to see it." apt update -q + +cp dpkg.status rootdir/var/lib/dpkg/status +insertinstalledpackage 'foo' 'all' '2.0' +testequal 'All packages are up to date.' apt update -q -- 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-update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/integration/test-apt-cli-update') diff --git a/test/integration/test-apt-cli-update b/test/integration/test-apt-cli-update index 83cc94b93..d68ab25e4 100755 --- a/test/integration/test-apt-cli-update +++ b/test/integration/test-apt-cli-update @@ -15,10 +15,10 @@ setupaptarchive --no-update APTARCHIVE=$(readlink -f ./aptarchive) -testequal 'E: The update command takes no arguments' apt update -q arguments +testfailureequal 'E: The update command takes no arguments' apt update -q arguments -testequal "1 package can be upgraded. Run 'apt list --upgradable' to see it." apt update -q +testsuccessequal "1 package can be upgraded. Run 'apt list --upgradable' to see it." apt update -q cp dpkg.status rootdir/var/lib/dpkg/status insertinstalledpackage 'foo' 'all' '2.0' -testequal 'All packages are up to date.' apt update -q +testsuccessequal 'All packages are up to date.' apt update -q -- cgit v1.2.3