summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-patterns56
-rwxr-xr-xtest/integration/test-authentication-basic42
2 files changed, 85 insertions, 13 deletions
diff --git a/test/integration/test-apt-patterns b/test/integration/test-apt-patterns
index 92c76edd1..06c552479 100755
--- a/test/integration/test-apt-patterns
+++ b/test/integration/test-apt-patterns
@@ -5,15 +5,16 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture 'i386' 'amd64'
-insertpackage 'unstable' 'available' 'all' '1.0'
+insertpackage 'unstable' 'available' 'all' '1.0' 'Section: asection'
insertinstalledpackage 'manual1' 'i386' '1.0' 'Depends: automatic1'
insertinstalledpackage 'manual2' 'i386' '1.0'
-insertinstalledpackage 'automatic1' 'i386' '1.0'
-insertinstalledpackage 'automatic2' 'i386' '1.0'
+insertinstalledpackage 'automatic1' 'i386' '1.0' 'Source: automatic (0)'
+insertinstalledpackage 'automatic2' 'i386' '1.0' 'Source: automatic (1)'
-insertinstalledpackage 'essential' 'i386' '1.0' 'Essential: yes'
+insertinstalledpackage 'essential' 'i386' '1.0' 'Essential: yes
+Section: asection'
insertinstalledpackage 'conf-only' 'i386' '1.0' '' '' 'deinstall ok config-files'
insertinstalledpackage 'broken' 'i386' '1.0' 'Depends: does-not-exist'
@@ -22,6 +23,7 @@ insertpackage 'unstable' 'not-obsolete' 'all' '2.0'
insertpackage 'unstable' 'foreign' 'amd64' '2.0'
+getoriginfromsuite() { echo -n 'meow'; }
setupaptarchive
testsuccess aptmark auto automatic1 automatic2
@@ -103,6 +105,27 @@ testsuccessequal "Listing...
automatic1/now 1.0 i386 [installed,local]" apt list '?and(?name(^automatic),?name(1$))'
+msgmsg "Narrow and friends"
+testsuccessequal "Listing...
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]
+N: There is 1 additional version. Please use the '-a' switch to see it" apt list '?and(?version(^1\.0$),?version(^2\.0$))'
+
+testsuccessequal "Listing..." apt list '?any-version(?and(?version(^1\.0$),?version(^2\.0$)))'
+testsuccessequal "Listing..." apt list '?narrow(?version(^1\.0$),?version(^2\.0$))'
+
+# XXX FIXME: I guess we do want this to only show version 1.0?
+testsuccessequal "Listing...
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]
+N: There is 1 additional version. Please use the '-a' switch to see it" apt list '?any-version(?and(?version(^1\.0$),?name(not-obsolete)))'
+testsuccessequal "Listing...
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]
+N: There is 1 additional version. Please use the '-a' switch to see it" apt list '?narrow(?version(^1\.0$),?name(not-obsolete))'
+
+
+testsuccessequal "Listing...
+foreign/unstable 2.0 amd64
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?not(?all-versions(?version(^1)))'
+
msgmsg "Package patterns"
testsuccessequal "Listing...
@@ -113,6 +136,11 @@ testsuccessequal "Listing..." apt list '?architecture(foreign)'
testsuccessequal "Listing..." apt list '?architecture(native)'
testsuccessequal "Listing...
+available/unstable 1.0 all
+foreign/unstable 2.0 amd64
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?archive(^unstable$)'
+
+testsuccessequal "Listing...
automatic1/now 1.0 i386 [installed,local]
automatic2/now 1.0 i386 [installed,local]" apt list '?automatic'
@@ -158,9 +186,29 @@ foreign/unstable 2.0 amd64
not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?not(?obsolete)'
testsuccessequal "Listing...
+available/unstable 1.0 all
+foreign/unstable 2.0 amd64
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?origin(^meow$)'
+
+testsuccessequal "Listing...
+available/unstable 1.0 all
+essential/now 1.0 i386 [installed,local]" apt list '?section(asection)'
+
+testsuccessequal "Listing...
+automatic1/now 1.0 i386 [installed,local]
+automatic2/now 1.0 i386 [installed,local]" apt list '?source-package(^automatic$)'
+
+testsuccessequal "Listing...
+automatic2/now 1.0 i386 [installed,local]" apt list '?source-version(^1$)'
+
+testsuccessequal "Listing...
not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]
N: There is 1 additional version. Please use the '-a' switch to see it" apt list '?upgradable'
+testsuccessequal "Listing...
+foreign/unstable 2.0 amd64
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?version(2.0)'
+
testsuccessequal "Package: does-not-exist
State: not a real package (virtual)
N: Can't select candidate version from package does-not-exist as it has no candidate
diff --git a/test/integration/test-authentication-basic b/test/integration/test-authentication-basic
index 211c73e35..5aafaade0 100755
--- a/test/integration/test-authentication-basic
+++ b/test/integration/test-authentication-basic
@@ -65,35 +65,59 @@ runtest() {
authfile ''
testauthfailure "$1"
+ protocol="${1%%://*}"
+
# good auth
- authfile 'machine localhost
+ authfile "machine ${protocol}://localhost
login star@irc
-password hunter2'
+password hunter2"
testauthsuccess "$1"
# bad auth
- authfile 'machine localhost
+ authfile "machine ${protocol}://localhost
login anonymous
-password hunter2'
+password hunter2"
testauthfailure "$1"
# 2 stanzas: unmatching + good auth
- authfile 'machine debian.org
+ authfile "machine ${protocol}://debian.org
login debian
password jessie
-machine localhost
+machine ${protocol}://localhost
login star@irc
-password hunter2'
+password hunter2"
testauthsuccess "$1"
+ # no protocol specifier
+ authfile "machine localhost
+login star@irc
+password hunter2"
+ if [ "$protocol" = "https" ]; then
+ testauthsuccess "$1"
+ else
+ testauthfailure "$1"
+ fi
+
+ # wrong protocol specifier
+ if [ "$protocol" = "https" ]; then
+ authfile "machine http://localhost
+login star@irc
+password hunter2"
+ else
+ authfile "machine https://localhost
+login star@irc
+password hunter2"
+ fi
+ testauthfailure "$1"
+
# delete file, make sure it fails; add auth.conf.d snippet, works again.
rm rootdir/etc/apt/auth.conf
testauthfailure "$1"
- authfile 'machine localhost
+ authfile "machine ${protocol}://localhost
login star@irc
-password hunter2' rootdir/etc/apt/auth.conf.d/myauth.conf
+password hunter2" rootdir/etc/apt/auth.conf.d/myauth.conf
testauthsuccess "$1"
rm rootdir/etc/apt/auth.conf.d/myauth.conf
}