Browse Source

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
tags/debian/1.1.exp9
David Kalnischkies 6 years ago
parent
commit
25b86db159
100 changed files with 571 additions and 491 deletions
  1. +22
    -2
      test/integration/framework
  2. +11
    -11
      test/integration/test-allow-scores-for-all-dependency-types
  3. +2
    -2
      test/integration/test-apt-by-hash-update
  4. +16
    -16
      test/integration/test-apt-cache
  5. +9
    -9
      test/integration/test-apt-cdrom
  6. +10
    -11
      test/integration/test-apt-cli-list
  7. +13
    -13
      test/integration/test-apt-cli-search
  8. +1
    -1
      test/integration/test-apt-cli-show
  9. +3
    -3
      test/integration/test-apt-cli-update
  10. +3
    -3
      test/integration/test-apt-cli-upgrade
  11. +12
    -12
      test/integration/test-apt-config
  12. +1
    -1
      test/integration/test-apt-extracttemplates
  13. +6
    -6
      test/integration/test-apt-ftparchive-cachedb
  14. +1
    -1
      test/integration/test-apt-ftparchive-cachedb-lp1274466
  15. +1
    -1
      test/integration/test-apt-ftparchive-src-cachedb
  16. +3
    -3
      test/integration/test-apt-get-autoremove
  17. +3
    -3
      test/integration/test-apt-get-build-dep
  18. +2
    -2
      test/integration/test-apt-get-changelog
  19. +1
    -1
      test/integration/test-apt-get-install-deb
  20. +9
    -9
      test/integration/test-apt-get-source
  21. +8
    -8
      test/integration/test-apt-get-source-arch
  22. +2
    -2
      test/integration/test-apt-get-source-multisources
  23. +4
    -4
      test/integration/test-apt-get-update-unauth-warning
  24. +3
    -3
      test/integration/test-apt-get-upgrade
  25. +7
    -7
      test/integration/test-apt-helper
  26. +2
    -2
      test/integration/test-apt-key
  27. +2
    -2
      test/integration/test-apt-key-net-update
  28. +18
    -18
      test/integration/test-apt-mark
  29. +10
    -10
      test/integration/test-apt-progress-fd
  30. +2
    -3
      test/integration/test-apt-progress-fd-deb822
  31. +2
    -2
      test/integration/test-apt-translation-has-no-packages
  32. +1
    -1
      test/integration/test-apt-update-expected-size
  33. +6
    -6
      test/integration/test-apt-update-nofallback
  34. +10
    -10
      test/integration/test-apt-update-rollback
  35. +1
    -1
      test/integration/test-apt-update-stale
  36. +10
    -10
      test/integration/test-architecture-specification-parsing
  37. +1
    -1
      test/integration/test-authentication-basic
  38. +10
    -10
      test/integration/test-bug-470115-new-and-tighten-recommends
  39. +1
    -1
      test/integration/test-bug-507998-dist-upgrade-recommends
  40. +5
    -5
      test/integration/test-bug-543966-downgrade-below-1000-pin
  41. +1
    -1
      test/integration/test-bug-549968-install-depends-of-not-installed
  42. +4
    -4
      test/integration/test-bug-590041-prefer-non-virtual-packages
  43. +1
    -1
      test/integration/test-bug-590438-broken-provides-thanks-to-remove-order
  44. +2
    -2
      test/integration/test-bug-591882-conkeror
  45. +8
    -8
      test/integration/test-bug-593360-modifiers-in-names
  46. +6
    -6
      test/integration/test-bug-596498-trusted-unsigned-repo
  47. +1
    -1
      test/integration/test-bug-598669-install-postfix-gets-exim-heavy
  48. +3
    -3
      test/integration/test-bug-601961-install-info
  49. +1
    -1
      test/integration/test-bug-602412-dequote-redirect
  50. +5
    -5
      test/integration/test-bug-604222-new-and-autoremove
  51. +1
    -1
      test/integration/test-bug-605394-versioned-or-groups
  52. +3
    -3
      test/integration/test-bug-611729-mark-as-manual
  53. +15
    -15
      test/integration/test-bug-612099-multiarch-conflicts
  54. +3
    -3
      test/integration/test-bug-612557-garbage-upgrade
  55. +1
    -1
      test/integration/test-bug-613420-new-garbage-dependency
  56. +1
    -1
      test/integration/test-bug-618848-always-respect-user-requests
  57. +7
    -10
      test/integration/test-bug-624218-Translation-file-handling
  58. +15
    -15
      test/integration/test-bug-632221-cross-dependency-satisfaction
  59. +2
    -2
      test/integration/test-bug-64141-install-dependencies-for-on-hold
  60. +1
    -1
      test/integration/test-bug-657695-resolver-breaks-on-virtuals
  61. +4
    -4
      test/integration/test-bug-661537-build-profiles-support
  62. +5
    -5
      test/integration/test-bug-675449-essential-are-protected
  63. +1
    -1
      test/integration/test-bug-679371-apt-get-autoclean-multiarch
  64. +10
    -10
      test/integration/test-bug-680041-apt-mark-holds-correctly
  65. +9
    -9
      test/integration/test-bug-683786-build-dep-on-virtual-packages
  66. +5
    -5
      test/integration/test-bug-686346-package-missing-architecture
  67. +1
    -1
      test/integration/test-bug-689582-100-char-long-path-names
  68. +6
    -6
      test/integration/test-bug-691453-apt-cache-search-multi-pattern
  69. +1
    -1
      test/integration/test-bug-709560-set-candidate-release
  70. +9
    -9
      test/integration/test-bug-712435-missing-descriptions
  71. +1
    -1
      test/integration/test-bug-717891-abolute-uris-for-proxies
  72. +3
    -6
      test/integration/test-bug-718329-support-data.tar-uncompressed
  73. +1
    -1
      test/integration/test-bug-719263-print-uris-removes-authentication
  74. +2
    -2
      test/integration/test-bug-720597-build-dep-purge
  75. +7
    -7
      test/integration/test-bug-722207-print-uris-even-if-very-quiet
  76. +5
    -5
      test/integration/test-bug-723586-any-stripped-in-single-arch
  77. +1
    -1
      test/integration/test-bug-728500-tempdir
  78. +1
    -1
      test/integration/test-bug-732746-preferences
  79. +4
    -4
      test/integration/test-bug-735967-lib32-to-i386-unavailable
  80. +2
    -2
      test/integration/test-bug-738785-switch-protocol
  81. +1
    -1
      test/integration/test-bug-745036-new-foreign-invalidates-cache
  82. +2
    -2
      test/integration/test-bug-745046-candidate-propagation-fails
  83. +2
    -2
      test/integration/test-bug-753297-upgradable
  84. +78
    -10
      test/integration/test-bug-758153-versioned-provides-support
  85. +4
    -4
      test/integration/test-bug-770291-reinstall
  86. +1
    -1
      test/integration/test-bug-multiarch-upgrade
  87. +16
    -16
      test/integration/test-cachecontainer-architecture-specification
  88. +13
    -13
      test/integration/test-compressed-indexes
  89. +1
    -1
      test/integration/test-conflicts-loop
  90. +3
    -3
      test/integration/test-conflicts-real-multiarch-same
  91. +4
    -4
      test/integration/test-cve-2013-1051-InRelease-parsing
  92. +1
    -1
      test/integration/test-essential-force-loopbreak
  93. +4
    -4
      test/integration/test-external-dependency-solver-protocol
  94. +7
    -7
      test/integration/test-handling-broken-orgroups
  95. +9
    -9
      test/integration/test-ignore-provides-if-versioned-breaks
  96. +9
    -9
      test/integration/test-ignore-provides-if-versioned-conflicts
  97. +4
    -4
      test/integration/test-implicit-conflicts-real-not-virtual
  98. +3
    -3
      test/integration/test-kernel-helper-autoremove
  99. +12
    -12
      test/integration/test-multiarch-foreign
  100. +4
    -4
      test/integration/test-ordering-ignore-not-matching-breaks

+ 22
- 2
test/integration/framework View File

@@ -1338,7 +1338,7 @@ testwarning() {
else
msgtest 'Test for successful execution with warnings of' "$*"
fi
local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output"
local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarning.output"
if "$@" >${OUTPUT} 2>&1; then
if expr match "$1" '^apt.*' >/dev/null; then
if grep -q -E ' runtime error: ' "$OUTPUT"; then
@@ -1388,6 +1388,26 @@ testfailure() {
aptautotest 'testfailure' "$@"
}

testsuccessequal() {
local CMP="$1"
shift
testsuccess "$@"
testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "$CMP"
}
testwarningequal() {
local CMP="$1"
shift
testwarning "$@"
testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarning.output" "$CMP"
}
testfailureequal() {
local CMP="$1"
shift
testfailure "$@"
testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" "$CMP"
}


testfilestats() {
msgtest "Test that file $1 has $2 $3" "$4"
if [ "$4" "$3" "$(stat --format "$2" "$1")" ]; then
@@ -1493,7 +1513,7 @@ aptautotest_apt_update() { aptautotest_aptget_update "$@"; }
testaptautotestnodpkgwarning() {
local TESTCALL="$1"
while [ -n "$2" ]; do
if [ "$2" = '-s' ]; then return; fi
if expr match "$2" '^-[a-z]*s' >/dev/null 2>&1; then return; fi
shift
done
testfailure grep '^dpkg: warning:.*ignor.*' "${TMPWORKINGDIRECTORY}/rootdir/tmp-before/${TESTCALL}.output"


+ 11
- 11
test/integration/test-allow-scores-for-all-dependency-types View File

@@ -42,7 +42,7 @@ setupaptarchive

insertinstalledpackage 'libdb-dev' 'amd64' '5.1.7' 'Depends: libdb5.1-dev'
insertinstalledpackage 'libdb5.1-dev' 'amd64' '5.1.29-7'
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages will be REMOVED:
@@ -57,7 +57,7 @@ Inst libdb-dev [5.1.7] (5.3.0 unversioned [amd64]) []
Inst libdb5.3-dev (5.3.28-3 unversioned [amd64])
Conf libdb5.3-dev (5.3.28-3 unversioned [amd64])
Conf libdb-dev (5.3.0 unversioned [amd64])' aptget dist-upgrade -st unversioned
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages will be REMOVED:
@@ -76,25 +76,25 @@ Conf libdb-dev (5.3.0 versioned [amd64])' aptget dist-upgrade -st versioned
cp -f rootdir/var/lib/dpkg/status-backup rootdir/var/lib/dpkg/status
insertinstalledpackage 'foo' 'amd64' '1'
insertinstalledpackage 'bar' 'amd64' '1'
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages have been kept back:
bar foo
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st unversioned
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages have been kept back:
bar foo
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st versioned
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages have been kept back:
bar foo
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st multipleno
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages will be REMOVED:
@@ -106,14 +106,14 @@ Remv foo [1]
Inst bar [1] (2.2 multipleyes [amd64])
Conf bar (2.2 multipleyes [amd64])' aptget dist-upgrade -st multipleyes

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
baz
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Inst baz (2 unversioned [amd64])
Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
foo
@@ -130,14 +130,14 @@ Inst baz (2 versioned [amd64])
Conf foo (2 versioned [amd64])
Conf baz (2 versioned [amd64])' aptget install baz -st versioned

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
baz
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Inst baz (2 unversioned [amd64])
Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
foo
@@ -159,7 +159,7 @@ cp -f rootdir/var/lib/dpkg/status-backup rootdir/var/lib/dpkg/status
insertinstalledpackage 'gdm3' 'amd64' '1' 'Depends: libaudit0, libaudit0'
insertinstalledpackage 'login' 'amd64' '1' 'Essential: yes'
insertinstalledpackage 'libaudit0' 'amd64' '1'
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages will be REMOVED:


+ 2
- 2
test/integration/test-apt-by-hash-update View File

@@ -29,7 +29,7 @@ mkdir -p aptarchive/dists/unstable/main/source/by-hash/SHA512
testfailure aptget upate

# ensure we do not know about "foo"
testequal "Reading package lists...
testfailureequal "Reading package lists...
Building dependency tree...
E: Unable to locate package foo" aptget install -q -s foo

@@ -37,7 +37,7 @@ E: Unable to locate package foo" aptget install -q -s foo
testsuccess aptget update -o APT::Acquire::By-Hash=1 -o Acquire::Languages=none

# ensure it works
testequal "Inst foo (1.0 unstable [all])
testsuccessequal "Inst foo (1.0 unstable [all])
Conf foo (1.0 unstable [all])" aptget install -qq -s foo

# add magic string to Release file ...


+ 16
- 16
test/integration/test-apt-cache View File

@@ -42,45 +42,45 @@ testsuccess aptcache dump
cp rootdir/tmp/testsuccess.output dump.output
testsuccess test -s dump.output

testequal 'dpkg
testsuccessequal 'dpkg
bar
fancy
foo' aptcache pkgnames
testequal 'bar' aptcache pkgnames bar
testequal 'fancy
testsuccessequal 'bar' aptcache pkgnames bar
testsuccessequal 'fancy
foo' aptcache pkgnames f

testequal " foo | 1 | file:$(readlink -f .)/aptarchive/ unstable/main amd64 Packages" aptcache madison foo
testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive/ unstable/main amd64 Packages" aptcache madison foo

### depends

testequal 'foo
testsuccessequal 'foo
Depends: bar
|Recommends: <cool>
Recommends: <cooler>
Conflicts: <foobar>
Conflicts: <foobar:i386>' aptcache depends foo
testequal 'foo
testsuccessequal 'foo
Depends: bar
Recommends: <cool>
Conflicts: <foobar>
Conflicts: <foobar:i386>' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1
testequal 'foo
testsuccessequal 'foo
Depends: bar
|Recommends: <cool> (>= 2)
Recommends: <cooler> (<< 5)
Conflicts: <foobar>
Conflicts: <foobar:i386>' aptcache depends foo -o APT::Cache::ShowVersion=1
testequal 'foo
testsuccessequal 'foo
Depends: bar
Conflicts: <foobar>
Conflicts: <foobar:i386>' aptcache depends foo --no-recommends
testequal 'foo
testsuccessequal 'foo
Depends: bar' aptcache depends foo --important
testequal 'foo
testsuccessequal 'foo
Conflicts: <foobar>
Conflicts: <foobar:i386>' aptcache depends foo --important --no-depends --conflicts
testequal 'foo
testsuccessequal 'foo
Depends: bar
|Recommends: <cool>
Recommends: <cooler>
@@ -97,7 +97,7 @@ bar
<foobar>
<foobar:i386>
<foo:i386>' aptcache depends foo --recurse
testequal 'foo
testsuccessequal 'foo
Depends: bar
bar
Depends: bar
@@ -107,18 +107,18 @@ bar

## rdpends

testequal 'foo
testsuccessequal 'foo
Reverse Depends:
bar
bar' aptcache rdepends foo
testequal 'foo
testsuccessequal 'foo
Reverse Depends:
Replaces: bar
Breaks: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1
testequal 'foo
testsuccessequal 'foo
Reverse Depends:
Replaces: bar (<< 1)
Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1
testequal 'foo
testsuccessequal 'foo
Reverse Depends:
Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks

+ 9
- 9
test/integration/test-apt-cdrom View File

@@ -49,12 +49,12 @@ deb-src cdrom:[Debian APT Testdisk 0.8.15]/ stable main
Unmounting CD-ROM...
Repeat this process for the rest of the CDs in your set."

testequal "$CDROM_PRE
testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
Found label 'Debian APT Testdisk 0.8.15'
$CDROM_POST" aptcdromlog add

testequal "Using CD-ROM mount point $(readlink -f ./rootdir/media)/cdrom/
testsuccessequal "Using CD-ROM mount point $(readlink -f ./rootdir/media)/cdrom/
Mounting CD-ROM...
Stored label: Debian APT Testdisk 0.8.15
Unmounting CD-ROM..." aptcdromlog ident
@@ -63,13 +63,13 @@ Unmounting CD-ROM..." aptcdromlog ident
ident="$(LC_ALL=C aptcdrom ident 2>&1 )"
CD_ID="$(echo "$ident" | grep "^Identifying" | head -n1 | cut -d" " -f2 | tr --delete '[]')"
CD_LABEL="$(echo "$ident" | grep "^Stored label:" | head -n1 | sed "s/^[^:]*: //")"
testequal "CD::${CD_ID} \"${CD_LABEL}\";
CD::${CD_ID}::Label \"${CD_LABEL}\";" cat rootdir/var/lib/apt/cdroms.list
testfileequal rootdir/var/lib/apt/cdroms.list "CD::${CD_ID} \"${CD_LABEL}\";
CD::${CD_ID}::Label \"${CD_LABEL}\";"

testcdromusage() {
touch rootdir/var/lib/apt/extended_states

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
@@ -84,7 +84,7 @@ Conf testing (0.8.15 stable [amd64])' aptget install testing -s
testsuccess aptget purge testing -y
testdpkgnotinstalled testing

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
@@ -114,18 +114,18 @@ Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s
testcdromusage

# check Idempotence of apt-cdrom (and disabling of Translation dropping)
testequal "$CDROM_PRE
testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
$CDROM_POST" aptcdromlog add -o APT::CDROM::DropTranslation=0

# take Translations from previous runs as needed
testequal "$CDROM_PRE
testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 2 translation indexes and 1 signatures
$CDROM_POST" aptcdromlog add
msgtest 'Test for the german description translation of' 'testing'
aptcache show testing -o Acquire::Languages=de | grep -q '^Description-de: ' && msgpass || msgfail
rm -rf rootdir/var/lib/apt/lists
testequal "$CDROM_PRE
testsuccessequal "$CDROM_PRE
Found 2 package indexes, 1 source indexes, 1 translation indexes and 1 signatures
$CDROM_POST" aptcdromlog add
msgtest 'Test for the english description translation of' 'testing'


+ 10
- 11
test/integration/test-apt-cli-list View File

@@ -27,50 +27,49 @@ setupaptarchive

APTARCHIVE=$(readlink -f ./aptarchive)

testequal "Listing...
testsuccessequal "Listing...
bar/now 1.0 i386 [installed,local]
baz/unstable 2.0 all [upgradable from: 0.1]
foo/unstable 1.0 all
foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list

testequal "Listing...
testsuccessequal "Listing...
foo/unstable 1.0 all
foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list "foo*"

testequal "Listing...
testsuccessequal "Listing...
baz/unstable 2.0 all [upgradable from: 0.1]
foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list --upgradable

# FIXME: hm, hm - does it make sense to have this different? shouldn't
# we use "installed,upgradable" consitently?
testequal "Listing...
testsuccessequal "Listing...
bar/now 1.0 i386 [installed,local]
baz/now 0.1 all [installed,upgradable to: 2.0]
foobar/now 1.0 i386 [installed,upgradable to: 2.0]" apt list --installed

testequal "Listing...
testsuccessequal "Listing...
bar/now 1.0 i386 [installed,local]

foobar/unstable 2.0 i386 [upgradable from: 1.0]
foobar/now 1.0 i386 [installed,upgradable to: 2.0]
" apt list bar foobar --all-versions

testequal "Listing...
testsuccessequal "Listing...
bar/now 1.0 i386 [installed,local]
an autogenerated dummy bar=1.0/installed
" apt list bar --verbose

# test for dpkg ^rc state
insertinstalledpackage 'conf-only' 'i386' '1.0' '' '' 'deinstall ok config-files'
testequal "Listing...
testsuccessequal "Listing...
conf-only/now 1.0 i386 [residual-config]" apt list conf-only

# ensure that the users learns about multiple versions too
testequal "Listing...
testsuccessequal "Listing...
baz/unstable 2.0 all [upgradable from: 0.1]
N: There are 2 additional versions. Please use the '-a' switch to see them." apt list baz -o quiet=0

# test format strings for machine parseable output
apt list -qq bar baz -o APT::Cmd::use-format=true -o APT::Cmd::format="\${Package} - \${installed:Version} - \${candidate:Version}" > output.txt
testequal "bar - 1.0 - 1.0
baz - 0.1 - 2.0" cat output.txt
testsuccessequal 'bar - 1.0 - 1.0
baz - 0.1 - 2.0' apt list -qq bar baz -o APT::Cmd::use-format=true -o APT::Cmd::format="\${Package} - \${installed:Version} - \${candidate:Version}"

+ 13
- 13
test/integration/test-apt-cli-search View File

@@ -25,51 +25,51 @@ setupaptarchive

APTARCHIVE=$(readlink -f ./aptarchive)

testequal 'E: You must give at least one search pattern' aptcache search
testequal 'E: You must give at least one search pattern' apt search
testfailureequal 'E: You must give at least one search pattern' aptcache search
testfailureequal 'E: You must give at least one search pattern' apt search

# with OP progress
testequal "Sorting...
testsuccessequal "Sorting...
Full Text Search...
foo/unstable 1.0 all
$DESCR
" apt search xxyyzz

# without op progress
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
" apt search -qq xxyyzz
testempty apt search -qq --names-only xxyyzz

# search name
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
" apt search -qq foo
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
" apt search -qq --names-only foo

# search with multiple words is a AND search
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
" apt search -qq aabbcc xxyyzz
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
" apt search -qq 'a+b+c+' 'i*xxy{0,2}zz'

# search is not case-sensitive by default
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
" apt search -qq uppercase
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
" apt search -qq 'up[pP]erc[Aa]se'

# search is done in the long description
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
" apt search -qq 'long description'
testequal "foo/unstable 1.0 all
testsuccessequal "foo/unstable 1.0 all
$DESCR
Long description of stuff and such, with lines
.
@@ -77,7 +77,7 @@ testequal "foo/unstable 1.0 all
" apt search --full -qq 'long description'

# output is sorted and search word finds both package
testequal "bar/testing 2.0 i386
testsuccessequal "bar/testing 2.0 i386
$DESCR2

foo/unstable 1.0 all


+ 1
- 1
test/integration/test-apt-cli-show View File

@@ -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


+ 3
- 3
test/integration/test-apt-cli-update View File

@@ -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

+ 3
- 3
test/integration/test-apt-cli-upgrade View File

@@ -23,7 +23,7 @@ setupaptarchive
APTARCHIVE=$(readlink -f ./aptarchive)

# default is to allow new dependencies
testequal "The following NEW packages will be installed:
testsuccessequal "The following NEW packages will be installed:
foo-new-dependency
The following packages will be upgraded:
foo
@@ -33,7 +33,7 @@ Inst foo [1.0] (2.0 unstable [all])
Conf foo-new-dependency (2.0 unstable [all])
Conf foo (2.0 unstable [all])" apt upgrade -qq -s

# ensure
testequal "The following packages have been kept back:
# ensure the 'old' way works as well
testsuccessequal "The following packages have been kept back:
foo
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded." apt upgrade -qq -s --no-new-pkgs

+ 12
- 12
test/integration/test-apt-config View File

@@ -8,29 +8,29 @@ setupenvironment
configarchitecture 'amd64'

testsuccess aptconfig dump
testequal 'APT::Architecture "amd64";' aptconfig dump APT::Architecture
testsuccessequal 'APT::Architecture "amd64";' aptconfig dump APT::Architecture
testempty aptconfig dump config::which::does::not::exist

testequal 'APT::Architectures "";
testsuccessequal 'APT::Architectures "";
APT::Architectures:: "amd64";' aptconfig dump APT::Architectures
testequal 'APT::Architectures:: "amd64";' aptconfig dump --no-empty APT::Architectures
testequal 'amd64' aptconfig dump --no-empty --format='%v%n' APT::Architectures
testsuccessequal 'APT::Architectures:: "amd64";' aptconfig dump --no-empty APT::Architectures
testsuccessequal 'amd64' aptconfig dump --no-empty --format='%v%n' APT::Architectures

testempty aptconfig shell
testequal 'E: Arguments not in pairs' aptconfig shell APT::Architecture
testfailureequal 'E: Arguments not in pairs' aptconfig shell APT::Architecture
testempty aptconfig shell APT::Architecture ARCH # incorrect order
testequal "ARCH='amd64'" aptconfig shell ARCH APT::Architecture
testsuccessequal "ARCH='amd64'" aptconfig shell ARCH APT::Architecture

ROOTDIR="$(readlink -f rootdir)"
testequal "CONFIG='apt.conf'" aptconfig shell CONFIG Dir::Etc::main
testequal "CONFIG='${ROOTDIR}/etc/apt/apt.conf'" aptconfig shell CONFIG Dir::Etc::main/f
testequal "CONFIG='etc/apt/'" aptconfig shell CONFIG Dir::Etc
testequal "CONFIG='${ROOTDIR}/etc/apt/'" aptconfig shell CONFIG Dir::Etc/ # old style
testequal "CONFIG='${ROOTDIR}/etc/apt/'" aptconfig shell CONFIG Dir::Etc/d
testsuccessequal "CONFIG='apt.conf'" aptconfig shell CONFIG Dir::Etc::main
testsuccessequal "CONFIG='${ROOTDIR}/etc/apt/apt.conf'" aptconfig shell CONFIG Dir::Etc::main/f
testsuccessequal "CONFIG='etc/apt/'" aptconfig shell CONFIG Dir::Etc
testsuccessequal "CONFIG='${ROOTDIR}/etc/apt/'" aptconfig shell CONFIG Dir::Etc/ # old style
testsuccessequal "CONFIG='${ROOTDIR}/etc/apt/'" aptconfig shell CONFIG Dir::Etc/d

testempty aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
export DEB_BUILD_PROFILES='nodoc stage1'
testequal 'nodoc
testsuccessequal 'nodoc
stage1' aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
unset DEB_BUILD_PROFILES
testempty aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles

+ 1
- 1
test/integration/test-apt-extracttemplates View File

@@ -35,7 +35,7 @@ Description: Some bar var
OUT='rootdir/tmp/testsuccess.output'
testequal "$1" cut -f1 -d' ' $OUT
if [ -n "$2" ]; then
testequal '' cut -f2 -d' ' $OUT
testequal '' cut -s -f2 -d' ' $OUT
else
testequal '1.0' cut -f2 -d' ' $OUT
fi


+ 6
- 6
test/integration/test-apt-ftparchive-cachedb View File

@@ -9,14 +9,14 @@ $(dpkg-deb -I ./aptarchive/pool/main/foo_1_i386.deb | grep 'Installed-Size:' | s
Maintainer: Joe Sixpack <joe@example.org>
Architecture: i386
Version: 1
Filename: pool/main/foo_1_i386.deb" head -n8 ./aptarchive/dists/test/main/binary-i386/Packages
Filename: pool/main/foo_1_i386.deb" head -n8 ./aptarchive/dists/test/main/binary-i386/Packages
}

ensure_correct_contents_file() {
testequal "usr/bin/foo-i386 others/foo
testfileequal ./aptarchive/dists/test/Contents-i386 "usr/bin/foo-i386 others/foo
usr/share/doc/foo/FEATURES others/foo
usr/share/doc/foo/changelog others/foo
usr/share/doc/foo/copyright others/foo" cat ./aptarchive/dists/test/Contents-i386
usr/share/doc/foo/copyright others/foo"
}

#
@@ -99,8 +99,8 @@ testfileequal 'rootdir/tmp/testsuccess.output' ' Misses in Cache: 0

# and clean
rm -rf aptarchive/pool/main/*
testequal "packages-main-i386.db" aptftparchive clean ftparchive.conf -q=0
testsuccessequal "packages-main-i386.db" aptftparchive clean ftparchive.conf -q=0
testsuccess aptftparchive clean ftparchive.conf -q=0 -o Debug::APT::FTPArchive::Clean=1
cp rootdir/tmp/testsuccess.output clean-out.txt
testequal "0 Number of unique keys in the tree" grep unique clean-out.txt
testequal "packages-main-i386.db" grep packages-main-i386.db clean-out.txt
testsuccessequal "0 Number of unique keys in the tree" grep unique clean-out.txt
testsuccessequal "packages-main-i386.db" grep packages-main-i386.db clean-out.txt

+ 1
- 1
test/integration/test-apt-ftparchive-cachedb-lp1274466 View File

@@ -26,7 +26,7 @@ testsuccess grep 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc
testfailure grep 7da58ff901a40ecf42a730dc33198b182e9ba9ec98799fc2c2b6fabeeee40cc12a0e7cadb4b66764235c56e1009dbfe8a9a566fb1eedf47a992d1fff2cc3332c old-format.dump

# regression test for corruption with previous generation of cachedb
testequal "Package: foo
testsuccessequal "Package: foo
Priority: optional
Section: others
Installed-Size: 29


+ 1
- 1
test/integration/test-apt-ftparchive-src-cachedb View File

@@ -2,7 +2,7 @@
set -e

assert_correct_sources_file() {
testequal "Package: bar
testsuccessequal "Package: bar
Architecture: all
Version: 1.0
Binary: bar


+ 3
- 3
test/integration/test-apt-get-autoremove View File

@@ -20,7 +20,7 @@ testdpkgnotinstalled 'debhelper'
testdpkginstalled 'po-debconf' 'unrelated'

echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
@@ -55,7 +55,7 @@ testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
testsuccess aptmark auto debhelper

testmarkedauto 'debhelper' 'po-debconf'
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
@@ -65,7 +65,7 @@ Remv debhelper [8.0.0]
Remv po-debconf [1.0.16]' aptget autoremove -s

testsuccess aptmark hold debhelper
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s

+ 3
- 3
test/integration/test-apt-get-build-dep View File

@@ -32,7 +32,7 @@ Files:
1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
EOF

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
Note, using file '2vcard_0.5-3.dsc' to get the build dependencies
The following NEW packages will be installed:
@@ -75,7 +75,7 @@ z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
-----END PGP SIGNATURE-----
EOF

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
Note, using file '2vcard_0.5-3.dsc' to get the build dependencies
The following NEW packages will be installed:
@@ -117,7 +117,7 @@ Description: install packages using the apt protocol - common data

EOF

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
Note, using directory './foo-1.0' to get the build dependencies
The following NEW packages will be installed:


+ 2
- 2
test/integration/test-apt-get-changelog View File

@@ -21,9 +21,9 @@ chmod -R -w rootdir/var/cache/apt/archives

echo 'Apt::Changelogs::Server "http://localhost:8080/";' > rootdir/etc/apt/apt.conf.d/changelog.conf

testequal "'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt --print-uris
testsuccessequal "'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt --print-uris

testequal "'http://localhost:8080/pool/apt_1.0/changelog'
testsuccessequal "'http://localhost:8080/pool/apt_1.0/changelog'
'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt apt --print-uris

cd downloaded


+ 1
- 1
test/integration/test-apt-get-install-deb View File

@@ -8,7 +8,7 @@ setupenvironment
configarchitecture "i386"

# regression test for #754904
testequal 'E: Unable to locate package /dev/null' aptget install -qq /dev/null
testfailureequal 'E: Unable to locate package /dev/null' aptget install -qq /dev/null

# and ensure we fail for invalid debs
cat > foo.deb <<EOF


+ 9
- 9
test/integration/test-apt-get-source View File

@@ -34,55 +34,55 @@ APTARCHIVE=$(readlink -f ./aptarchive)
# normal operation gets highest version number
HEADER="Reading package lists...
Building dependency tree..."
testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo

# select by release: suite
testequal "$HEADER
testsuccessequal "$HEADER
Selected version '1.0' (stable) for foo
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/stable
testequal "$HEADER
testsuccessequal "$HEADER
Selected version '2.0' (unstable) for foo
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/unstable

# select by release: codename
testequal "$HEADER
testsuccessequal "$HEADER
Selected version '2.0' (sid) for foo
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/sid

# select by version
testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo=1.0

# select by release with no binary package (Bug#731102) but ensure to get
# highest version
testequal "$HEADER
testsuccessequal "$HEADER
Selected version '0.1' (wheezy) for foo
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/wheezy

# unavailable one
testequal "$HEADER
testfailureequal "$HEADER
E: Can not find version '9.9-not-there' of package 'foo'
E: Unable to find a source package for foo" aptget source -q --print-uris foo=9.9-not-there

# version and release
testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_0.0.1.dsc' foo_0.0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_0.0.1.tar.gz' foo_0.0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris -t unstable foo=0.0.1

testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
Fetch source foo" aptget source -q -s foo

+ 8
- 8
test/integration/test-apt-get-source-arch View File

@@ -30,41 +30,41 @@ HEADER="Reading package lists...
Building dependency tree..."

# pick :amd64
testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:amd64

# pick :i386
testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386

# pick :i386 by release
testequal "$HEADER
testsuccessequal "$HEADER
Selected version '0.1' (oldstable) for foo
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386/oldstable

# pick :i386 by version
testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386=1.0

# error on unknown arch
testequal "$HEADER
testfailureequal "$HEADER
E: Can not find a package for architecture 'not-a-available-arch'
E: Unable to find a source package for foo:not-a-available-arch" aptget source -q --print-uris foo:not-a-available-arch

# error on unavailable version for arch
testequal "$HEADER
testfailureequal "$HEADER
E: Can not find a package 'foo:amd64' with version '2.0'
E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0

# error on unavailable release for arch
testequal "$HEADER
# error on unavailable release for arch
testfailureequal "$HEADER
E: Can not find a package 'foo:amd64' with release 'oldstable'
E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable

+ 2
- 2
test/integration/test-apt-get-source-multisources View File

@@ -19,12 +19,12 @@ APTARCHIVE=$(readlink -f ./aptarchive)

HEADER="Reading package lists...
Building dependency tree..."
testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
'file://${APTARCHIVE}/adduser_3.113+nmu3.dsc' adduser_3.113+nmu3.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/python-fll_0.9.11.dsc' python-fll_0.9.11.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qdy --print-uris --dsc-only adduser=3.113 python-fll=0.9.11

testequal "$HEADER
testsuccessequal "$HEADER
Need to get 0 B of source archives.
'file://${APTARCHIVE}/python-fll_0.9.11.dsc' python-fll_0.9.11.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e
'file://${APTARCHIVE}/adduser_3.113+nmu3.dsc' adduser_3.113+nmu3.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qdy --print-uris --dsc-only python-fll=0.9.11 adduser=3.113

+ 4
- 4
test/integration/test-apt-get-update-unauth-warning View File

@@ -19,7 +19,7 @@ APTARCHIVE=$(readlink -f ./aptarchive)
rm -f $APTARCHIVE/dists/unstable/*Release*

# update without authenticated files leads to warning
testequal "Ign file: unstable InRelease
testfailureequal "Ign file: unstable InRelease
File not found
Err file: unstable Release
File not found
@@ -27,18 +27,18 @@ W: The repository 'file: unstable Release' does not have a Release file. This is
E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories

# no package foo
testequal 'Listing...' apt list foo
testsuccessequal 'Listing...' apt list foo
testequal 'lock
partial' ls rootdir/var/lib/apt/lists

# allow override
testequal "Ign file: unstable InRelease
testwarningequal "Ign file: unstable InRelease
File not found
Ign file: unstable Release
File not found
Reading package lists...
W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories
# ensure we can not install the package
testequal "WARNING: The following packages cannot be authenticated!
testfailureequal "WARNING: The following packages cannot be authenticated!
foo
E: There are problems and -y was used without --force-yes" aptget install -qq -y foo

+ 3
- 3
test/integration/test-apt-get-upgrade View File

@@ -24,7 +24,7 @@ insertpackage 'stable,installed' 'conflicting-dep' 'all' '1.0'
setupaptarchive

# Test if normal upgrade works as expected
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages have been kept back:
@@ -36,7 +36,7 @@ Inst upgrade-simple [1.0] (2.0 unstable [all])
Conf upgrade-simple (2.0 unstable [all])' aptget -s upgrade

# Test if apt-get upgrade --with-new-pkgs works
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following NEW packages will be installed:
@@ -54,7 +54,7 @@ Conf upgrade-simple (2.0 unstable [all])
Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs

# Test if apt-get dist-upgrade works
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages will be REMOVED:


+ 7
- 7
test/integration/test-apt-helper View File

@@ -44,7 +44,7 @@ E: Download Failed'

test_apt_helper_detect_proxy() {
# no proxy
testequal "Using proxy '' for URL 'http://example.com/'" apthelper auto-detect-proxy http://example.com/
testsuccessequal "Using proxy '' for URL 'http://example.com/'" apthelper auto-detect-proxy http://example.com/


# http auto detect proxy script
@@ -55,7 +55,7 @@ EOF
chmod 755 apt-proxy-detect
echo "Acquire::http::Proxy-Auto-Detect \"$(pwd)/apt-proxy-detect\";" > rootdir/etc/apt/apt.conf.d/02proxy-detect

testequal "Using proxy 'http://some-proxy' for URL 'http://www.example.com/'" apthelper auto-detect-proxy http://www.example.com
testsuccessequal "Using proxy 'http://some-proxy' for URL 'http://www.example.com/'" apthelper auto-detect-proxy http://www.example.com


# https auto detect proxy script
@@ -66,14 +66,14 @@ EOF
chmod 755 apt-proxy-detect
echo "Acquire::https::Proxy-Auto-Detect \"$(pwd)/apt-proxy-detect\";" > rootdir/etc/apt/apt.conf.d/02proxy-detect

testequal "Using proxy 'https://https-proxy' for URL 'https://ssl.example.com/'" apthelper auto-detect-proxy https://ssl.example.com
testsuccessequal "Using proxy 'https://https-proxy' for URL 'https://ssl.example.com/'" apthelper auto-detect-proxy https://ssl.example.com
}

test_apt_helper_download
test_apt_helper_detect_proxy

# test failure modes
testequal 'E: Invalid operation download' apthelper download
testequal 'E: Must specify at least one pair url/filename' apthelper download-file
testequal 'E: Must specify at least one pair url/filename' apthelper download-file http://example.org/
testequal 'E: Need one URL as argument' apthelper auto-detect-proxy
testfailureequal 'E: Invalid operation download' apthelper download
testfailureequal 'E: Must specify at least one pair url/filename' apthelper download-file
testfailureequal 'E: Must specify at least one pair url/filename' apthelper download-file http://example.org/
testfailureequal 'E: Need one URL as argument' apthelper auto-detect-proxy

+ 2
- 2
test/integration/test-apt-key View File

@@ -17,7 +17,7 @@ testaptkeys() {
if ! aptkey list | grep '^pub' > aptkey.list; then
echo -n > aptkey.list
fi
testequal "$1" cat ./aptkey.list
testfileequal './aptkey.list' "$1"
}

echo 'APT::Key::ArchiveKeyring "./keys/joesixpack.pub";
@@ -35,7 +35,7 @@ testrun() {

testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18'

testequal 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) <joe@example.org>" not changed
testsuccessequal 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) <joe@example.org>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1' aptkey --fakeroot update



+ 2
- 2
test/integration/test-apt-key-net-update View File

@@ -23,7 +23,7 @@ echo 'APT::Key::ArchiveKeyringURI "http://localhost:8080/ubuntu/project/test-arc
echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf

# test against the "real" webserver
testequal 'Checking for new archive signing keys now
testsuccessequal 'Checking for new archive signing keys now
gpg: key F68C85A3: public key "Test Automatic Archive Signing Key <ftpmaster@example.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)' aptkey --fakeroot net-update
@@ -40,7 +40,7 @@ echo 'APT::Key::ArchiveKeyringURI "http://localhost:8080/ubuntu/project/marvinpa
echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf

# test against the "real" webserver
testequal "Checking for new archive signing keys now
testsuccessequal "Checking for new archive signing keys now
Key 'DE66AECA9151AFA1877EC31DE8525D47528144E2' not added. It is not signed with a master key" aptkey --fakeroot net-update

aptkey list | grep '^pub' > aptkey.list


+ 18
- 18
test/integration/test-apt-mark View File

@@ -21,20 +21,20 @@ testdpkginstalled dpkg
testnoautopkg() {
testempty aptmark showauto
testempty aptcache showauto
testequal 'bar
testsuccessequal 'bar
dpkg
foo' aptmark showmanual
testequal 'bar
testsuccessequal 'bar
foo' aptmark showmanual bar foo uninstalled
}
testfooisauto() {
testequal 'foo' aptmark showauto
testequal 'foo' aptcache showauto
testequal 'foo' aptmark showauto foo
testequal 'foo' aptcache showauto foo
testequal 'bar
testsuccessequal 'foo' aptmark showauto
testsuccessequal 'foo' aptcache showauto
testsuccessequal 'foo' aptmark showauto foo
testsuccessequal 'foo' aptcache showauto foo
testsuccessequal 'bar
dpkg' aptmark showmanual
testequal 'bar' aptmark showmanual bar
testsuccessequal 'bar' aptmark showmanual bar
}
testmarkonpkgasauto() {
testsuccess $1 $2 foo
@@ -48,8 +48,8 @@ testmarkonpkgasauto() {
testnoautopkg
}

testequal 'E: No packages found' aptmark auto
testequal 'E: No packages found' aptmark manual
testfailureequal 'E: No packages found' aptmark auto
testfailureequal 'E: No packages found' aptmark manual

testnoautopkg
testmarkonpkgasauto 'aptmark' 'auto' 'manual'
@@ -63,10 +63,10 @@ testnoholdpkg() {
testempty aptmark showholds dpkg
}
testpkgonhold() {
testequal "$1" aptmark showhold
testequal "$1" aptmark showholds
testequal "$1" aptmark showhold $1
testequal "$1" aptmark showholds $1
testsuccessequal "$1" aptmark showhold
testsuccessequal "$1" aptmark showholds
testsuccessequal "$1" aptmark showhold $1
testsuccessequal "$1" aptmark showholds $1
}
testmarkonepkgashold() {
testsuccess aptmark hold $1
@@ -79,8 +79,8 @@ testmarkonepkgashold() {
testnoholdpkg
}

testequal 'E: No packages found' aptmark hold
testequal 'E: No packages found' aptmark unhold
testfailureequal 'E: No packages found' aptmark hold
testfailureequal 'E: No packages found' aptmark unhold

testnoholdpkg
testmarkonepkgashold 'foo'
@@ -97,5 +97,5 @@ fi
testmarkonepkgashold 'uninstalled'
testmarkonepkgashold 'uninstalled-native'

testequal 'uninstalled set on hold.' aptmark hold uninstalled
testequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native
testsuccessequal 'uninstalled set on hold.' aptmark hold uninstalled
testsuccessequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native

+ 10
- 10
test/integration/test-apt-progress-fd View File

@@ -15,7 +15,7 @@ setupaptarchive
# install native
exec 3> apt-progress.log
testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3
testequal "dlstatus:1:0:Retrieving file 1 of 1
testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
dlstatus:1:20:Retrieving file 1 of 1
pmstatus:dpkg-exec:0:Running dpkg
pmstatus:testing:0:Installing testing (amd64)
@@ -26,12 +26,12 @@ pmstatus:dpkg-exec:50:Running dpkg
pmstatus:testing:50:Configuring testing (amd64)
pmstatus:testing:66.6667:Configuring testing (amd64)
pmstatus:testing:83.3333:Installed testing (amd64)
pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
pmstatus:dpkg-exec:83.3333:Running dpkg'

# upgrade
exec 3> apt-progress.log
testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
testequal "dlstatus:1:0:Retrieving file 1 of 1
testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
dlstatus:1:20:Retrieving file 1 of 1
pmstatus:dpkg-exec:0:Running dpkg
pmstatus:testing:0:Installing testing (amd64)
@@ -42,12 +42,12 @@ pmstatus:dpkg-exec:50:Running dpkg
pmstatus:testing:50:Configuring testing (amd64)
pmstatus:testing:66.6667:Configuring testing (amd64)
pmstatus:testing:83.3333:Installed testing (amd64)
pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
pmstatus:dpkg-exec:83.3333:Running dpkg'

# reinstall
exec 3> apt-progress.log
testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3
testequal "dlstatus:1:0:Retrieving file 1 of 1
testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
dlstatus:1:20:Retrieving file 1 of 1
pmstatus:dpkg-exec:0:Running dpkg
pmstatus:testing:0:Installing testing (amd64)
@@ -58,24 +58,24 @@ pmstatus:dpkg-exec:50:Running dpkg
pmstatus:testing:50:Configuring testing (amd64)
pmstatus:testing:66.6667:Configuring testing (amd64)
pmstatus:testing:83.3333:Installed testing (amd64)
pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
pmstatus:dpkg-exec:83.3333:Running dpkg'

# and remove
exec 3> apt-progress.log
testsuccess aptget remove testing -y -o APT::Status-Fd=3
testequal "pmstatus:dpkg-exec:0:Running dpkg
testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0:Running dpkg
pmstatus:testing:0:Removing testing (amd64)
pmstatus:testing:25:Preparing for removal of testing (amd64)
pmstatus:testing:50:Removing testing (amd64)
pmstatus:testing:75:Removed testing (amd64)
pmstatus:dpkg-exec:75:Running dpkg" cat apt-progress.log
pmstatus:dpkg-exec:75:Running dpkg'

# install non-native and ensure we get proper progress info
exec 3> apt-progress.log
testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3

# and compare
testequal "dlstatus:1:0:Retrieving file 1 of 1
testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
dlstatus:1:20:Retrieving file 1 of 1
pmstatus:dpkg-exec:0:Running dpkg
pmstatus:testing2:0:Installing testing2 (i386)
@@ -86,6 +86,6 @@ pmstatus:dpkg-exec:50:Running dpkg
pmstatus:testing2:50:Configuring testing2 (i386)
pmstatus:testing2:66.6667:Configuring testing2 (i386)
pmstatus:testing2:83.3333:Installed testing2 (i386)
pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
pmstatus:dpkg-exec:83.3333:Running dpkg'

rm -f apt-progress*.log

+ 2
- 3
test/integration/test-apt-progress-fd-deb822 View File

@@ -16,7 +16,7 @@ setupaptarchive
exec 3> apt-progress.log
testsuccess aptget install testing=0.1 -y -o APT::Status-deb822-Fd=3

testequal "Status: progress
testfileequal './apt-progress.log' 'Status: progress
Percent: 0
Message: Running dpkg

@@ -62,7 +62,6 @@ Message: Installed testing (amd64)
Status: progress
Percent: 83.3333
Message: Running dpkg
" cat apt-progress.log

'

rm -f apt-progress*.log

+ 2
- 2
test/integration/test-apt-translation-has-no-packages View File

@@ -17,7 +17,7 @@ configarchitecture "amd64"

if [ ! -x ${BUILDDIRECTORY}/apt ]; then
msgmsg "No ${BUILDDIRECTORY}/apt"
msgskip
msgskip
exit 0
fi

@@ -33,7 +33,7 @@ cp $APTARCHIVE/dists/unstable/main/binary-amd64/Packages \

# ensure that there is no Version for the package foo generated out of
# the corrupted Translation-en file
testequal "foo:
testsuccessequal "foo:
Installed: (none)
Candidate: 1.0
Version table:


+ 1
- 1
test/integration/test-apt-update-expected-size View File

@@ -39,6 +39,6 @@ find aptarchive -name 'Packages*' | while read pkg; do
done
NEW_SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)"
rm -f rootdir/var/lib/apt/lists/localhost*
testequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages Writing more data than expected ($NEW_SIZE > $SIZE)
testfailureequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages Writing more data than expected ($NEW_SIZE > $SIZE)

E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq

+ 6
- 6
test/integration/test-apt-update-nofallback View File

@@ -31,14 +31,14 @@ EOF

assert_update_is_refused_and_last_good_state_used()
{
testequal "E: The repository 'file: unstable Release.gpg' is no longer signed." aptget update -qq
testfailureequal "E: The repository 'file: unstable Release.gpg' is no longer signed." aptget update -qq

assert_repo_is_intact
}

assert_repo_is_intact()
{
testequal "foo/unstable 2.0 all" apt list -q
testsuccessequal "foo/unstable 2.0 all" apt list -q
testsuccess aptget install -y -s foo
testfailure aptget install -y evil
testsuccess aptget source foo --print-uris
@@ -97,7 +97,7 @@ test_from_inrelease_to_unsigned_with_override()
testwarning aptget update --allow-insecure-repositories \
-o Acquire::AllowDowngradeToInsecureRepositories=1
# but that the individual packages are still considered untrusted
testequal "WARNING: The following packages cannot be authenticated!
testfailureequal "WARNING: The following packages cannot be authenticated!
evil
E: There are problems and -y was used without --force-yes" aptget install -qq -y evil
}
@@ -149,7 +149,7 @@ test_subvert_inrelease()
# replace InRelease with something else
mv $APTARCHIVE/dists/unstable/Release $APTARCHIVE/dists/unstable/InRelease

testequal "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/InRelease Does not start with a cleartext signature
testfailureequal "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/InRelease Does not start with a cleartext signature

E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq

@@ -169,7 +169,7 @@ test_inrelease_to_invalid_inrelease()
sed -i 's/Codename.*/Codename: evil!'/ $APTARCHIVE/dists/unstable/InRelease
inject_evil_package

testequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>

W: Failed to fetch file:${APTARCHIVE}/dists/unstable/InRelease The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>

@@ -193,7 +193,7 @@ test_release_gpg_to_invalid_release_release_gpg()
echo "Some evil data" >> $APTARCHIVE/dists/unstable/Release
inject_evil_package

testequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable Release.gpg: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>
testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable Release.gpg: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>

W: Failed to fetch file:${APTARCHIVE}/dists/unstable/Release.gpg The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) <joe@example.org>



+ 10
- 10
test/integration/test-apt-update-rollback View File

@@ -38,7 +38,7 @@ start_with_good_inrelease() {
create_fresh_archive
testsuccess aptget update
listcurrentlistsdirectory > lists.before
testequal "old/unstable 1.0 all" apt list -q
testsuccessequal "old/unstable 1.0 all" apt list -q
}

test_inrelease_to_new_inrelease() {
@@ -47,7 +47,7 @@ test_inrelease_to_new_inrelease() {

add_new_package '+1hour'
testsuccess aptget update -o Debug::Acquire::Transaction=1
testequal "new/unstable 1.0 all
testsuccessequal "new/unstable 1.0 all
old/unstable 1.0 all" apt list -q
}

@@ -60,12 +60,12 @@ test_inrelease_to_broken_hash_reverts_all() {
break_repository_sources_index '+1hour'

# test the error condition
testequal "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/main/source/Sources Hash Sum mismatch
testfailureequal "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/main/source/Sources Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
# ensure that the Packages file is also rolled back
testfileequal lists.before "$(listcurrentlistsdirectory)"
testequal "E: Unable to locate package new" aptget install new -s -qq
testfailureequal "E: Unable to locate package new" aptget install new -s -qq
}

test_inrelease_to_valid_release() {
@@ -78,7 +78,7 @@ test_inrelease_to_valid_release() {
rm $APTARCHIVE/dists/unstable/Release.gpg

# update fails
testequal "E: The repository 'file: unstable Release.gpg' is no longer signed." aptget update -qq
testfailureequal "E: The repository 'file: unstable Release.gpg' is no longer signed." aptget update -qq

# test that security downgrade was not successful
testfileequal lists.before "$(listcurrentlistsdirectory)"
@@ -101,7 +101,7 @@ test_inrelease_to_release_reverts_all() {
break_repository_sources_index '+1hour'

# ensure error
testequal "E: The repository 'file: unstable Release.gpg' is no longer signed." aptget update -qq # -o Debug::acquire::transaction=1
testfailureequal "E: The repository 'file: unstable Release.gpg' is no longer signed." aptget update -qq # -o Debug::acquire::transaction=1

# ensure that the Packages file is also rolled back
testfileequal lists.before "$(listcurrentlistsdirectory)"
@@ -119,7 +119,7 @@ test_unauthenticated_to_invalid_inrelease() {

testwarning aptget update --allow-insecure-repositories
listcurrentlistsdirectory > lists.before
testequal "WARNING: The following packages cannot be authenticated!
testfailureequal "WARNING: The following packages cannot be authenticated!
old
E: There are problems and -y was used without --force-yes" aptget install -qq -y old

@@ -127,13 +127,13 @@ E: There are problems and -y was used without --force-yes" aptget install -qq -y
add_new_package '+1hour'
break_repository_sources_index '+1hour'

testequal "W: Failed to fetch file:$APTARCHIVE/dists/unstable/main/source/Sources Hash Sum mismatch
testfailureequal "W: Failed to fetch file:$APTARCHIVE/dists/unstable/main/source/Sources Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq

testfileequal lists.before "$(listcurrentlistsdirectory)"
testfailure ls rootdir/var/lib/apt/lists/*_InRelease
testequal "WARNING: The following packages cannot be authenticated!
testfailureequal "WARNING: The following packages cannot be authenticated!
old
E: There are problems and -y was used without --force-yes" aptget install -qq -y old
}
@@ -144,7 +144,7 @@ test_inrelease_to_unauth_inrelease() {

signreleasefiles 'Marvin Paranoid'

testequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2
testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2

W: Failed to fetch file:$APTARCHIVE/dists/unstable/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2



+ 1
- 1
test/integration/test-apt-update-stale View File

@@ -39,7 +39,7 @@ cp -p aptarchive/dists/unstable/main/binary-i386/saved/Packages* \
aptarchive/dists/unstable/main/binary-i386/

# ensure this raises an error
testequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages Hash Sum mismatch
testfailureequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
testfileequal lists.before "$(listcurrentlistsdirectory)"

+ 10
- 10
test/integration/test-architecture-specification-parsing View File

@@ -26,7 +26,7 @@ insertinstalledpackage 'build-essential' 'all' '11.5' 'Multi-Arch: foreign'

setupaptarchive

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
The following extra packages will be installed:
foo
@@ -38,7 +38,7 @@ Inst pkg-arch-foo (1.0 stable [${NATIVE}])
Conf foo (1.0 stable [${NATIVE}])
Conf pkg-arch-foo (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo -s

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
pkg-arch-no-foo
@@ -46,7 +46,7 @@ The following NEW packages will be installed:
Inst pkg-arch-no-foo (1.0 stable [${NATIVE}])
Conf pkg-arch-no-foo (1.0 stable [${NATIVE}])" aptget install pkg-arch-no-foo -s

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
The following extra packages will be installed:
foo
@@ -58,7 +58,7 @@ Inst pkg-arch-foo-unrelated-no (1.0 stable [${NATIVE}])
Conf foo (1.0 stable [${NATIVE}])
Conf pkg-arch-foo-unrelated-no (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo-unrelated-no -s

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
The following extra packages will be installed:
foo
@@ -70,7 +70,7 @@ Inst pkg-arch-foo-unrelated-no2 (1.0 stable [${NATIVE}])
Conf foo (1.0 stable [${NATIVE}])
Conf pkg-arch-foo-unrelated-no2 (1.0 stable [${NATIVE}])" aptget install pkg-arch-foo-unrelated-no2 -s

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
foo
@@ -78,11 +78,11 @@ The following NEW packages will be installed:
Inst foo (1.0 stable [${NATIVE}])
Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep pkg-arch-no-foo -s

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
foo
@@ -90,7 +90,7 @@ The following NEW packages will be installed:
Inst foo (1.0 stable [${NATIVE}])
Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo-unrelated-no -s

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
foo
@@ -98,13 +98,13 @@ The following NEW packages will be installed:
Inst foo (1.0 stable [${NATIVE}])
Conf foo (1.0 stable [${NATIVE}])" aptget build-dep pkg-arch-foo-unrelated-no2 -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep no-depends -s

# this is not really testing APT - more that dpkg is in line with us
configarchitecture 'amd64' 'armel'
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
no-depends:armel


+ 1
- 1
test/integration/test-authentication-basic View File

@@ -38,7 +38,7 @@ testauthsuccess() {

rm -rf rootdir/var/lib/apt/lists
testsuccess aptget update
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
foo


+ 10
- 10
test/integration/test-bug-470115-new-and-tighten-recommends View File

@@ -47,7 +47,7 @@ insertpackage 'unstable' 'now-satisfiable' 'all' '2' 'Recommends: cool (>= 2)'

setupaptarchive

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
cool
@@ -59,7 +59,7 @@ Inst tighten-cool [1] (2 unstable [all])
Conf cool (2 unstable [all])
Conf tighten-cool (2 unstable [all])' aptget install tighten-cool -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
stuff
@@ -71,7 +71,7 @@ Inst tighten-coolorstuff [1] (2 unstable [all])
Conf stuff (2 unstable [all])
Conf tighten-coolorstuff (2 unstable [all])' aptget install tighten-coolorstuff -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
cool
@@ -83,7 +83,7 @@ Inst tighten-coolorstuff2 [1] (2 unstable [all])
Conf cool (2 unstable [all])
Conf tighten-coolorstuff2 (2 unstable [all])' aptget install tighten-coolorstuff2 -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
cool
@@ -95,7 +95,7 @@ Inst newrec-cool [1] (2 unstable [all])
Conf cool (2 unstable [all])
Conf newrec-cool (2 unstable [all])' aptget install newrec-cool -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
super
@@ -109,7 +109,7 @@ Inst super (2 unstable [all])
Conf newrec-super (2 unstable [all])
Conf super (2 unstable [all])' aptget install newrec-super -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
cool
@@ -121,7 +121,7 @@ Inst newrec-coolorstuff [1] (2 unstable [all])
Conf cool (2 unstable [all])
Conf newrec-coolorstuff (2 unstable [all])' aptget install newrec-coolorstuff -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
stuff
@@ -133,7 +133,7 @@ Inst stuff [1] (2 unstable [all])
Conf cool-gone (2 unstable [all])
Conf stuff (2 unstable [all])' aptget install cool-gone -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
super
@@ -149,7 +149,7 @@ Conf super-overtake (2 unstable [all])' aptget install super-overtake -s

# if super would be in front, we would get a new here as it is new and
# the first option in an or-group should be the preferred one…
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following extra packages will be installed:
cool
@@ -163,7 +163,7 @@ Conf upgrade-over-new (2 unstable [all])' aptget install upgrade-over-new -s

# the recommends wasn't used before so while we could do it now,
# the user doesn't seem to need it so avoid upgrading it
testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following packages will be upgraded:
now-satisfiable


+ 1
- 1
test/integration/test-bug-507998-dist-upgrade-recommends View File

@@ -14,7 +14,7 @@ insertpackage 'unstable' 'wireshark' 'amd64' '1.2.1-2' 'Depends: wireshark-commo

setupaptarchive

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
Calculating upgrade...
The following packages will be upgraded:


+ 5
- 5
test/integration/test-bug-543966-downgrade-below-1000-pin View File

@@ -15,7 +15,7 @@ setupaptarchive
STATUS=$(readlink -f rootdir/var/lib/dpkg/status)
APTARCHIVE="$(readlink -f aptarchive)/"

testequal "base-files:
testsuccessequal "base-files:
Installed: 5.0.0-1
Candidate: 5.0.0-1
Version table:
@@ -28,7 +28,7 @@ echo 'Package: base-files
Pin: release a=unstable
Pin-Priority: 99' > rootdir/etc/apt/preferences

testequal "base-files:
testsuccessequal "base-files:
Installed: 5.0.0-1
Candidate: 5.0.0-1
Package pin: 5.0.0
@@ -42,7 +42,7 @@ echo 'Package: base-files
Pin: release a=unstable
Pin-Priority: 100' > rootdir/etc/apt/preferences

testequal "base-files:
testsuccessequal "base-files:
Installed: 5.0.0-1
Candidate: 5.0.0-1
Package pin: 5.0.0
@@ -56,7 +56,7 @@ echo 'Package: base-files
Pin: release a=unstable
Pin-Priority: 999' > rootdir/etc/apt/preferences

testequal "base-files:
testsuccessequal "base-files:
Installed: 5.0.0-1
Candidate: 5.0.0-1
Package pin: 5.0.0
@@ -70,7 +70,7 @@ echo 'Package: base-files
Pin: release a=unstable
Pin-Priority: 1000' > rootdir/etc/apt/preferences

testequal "base-files:
testsuccessequal "base-files:
Installed: 5.0.0-1
Candidate: 5.0.0
Package pin: 5.0.0


+ 1
- 1
test/integration/test-bug-549968-install-depends-of-not-installed View File

@@ -14,7 +14,7 @@ setupaptarchive

# We check the Markers here as the autoremove nuker will also
# prevent it, but to late - its better to fail earlier
testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
MarkInstall coolstuff [ i386 ] < none -> 1.0 > ( other ) FU=1
Ignore MarkInstall of extracoolstuff [ i386 ] < none -> 1.0 > ( other ) as its mode (Keep) is protected


+ 4
- 4
test/integration/test-bug-590041-prefer-non-virtual-packages View File

@@ -46,8 +46,8 @@ EOF
setupaptarchive

testshowvirtual libc6:i386
testequal "$pkglibc6" aptcache show libc6:armel
testequal "$pkglibc6" aptcache show libc6
testequal "$pkglibdb1" aptcache show libdb1:i386
testsuccessequal "$pkglibc6" aptcache show libc6:armel
testsuccessequal "$pkglibc6" aptcache show libc6
testsuccessequal "$pkglibdb1" aptcache show libdb1:i386
testnopackage libdb1:armel
testequal "$pkglibdb1" aptcache show libdb1
testsuccessequal "$pkglibdb1" aptcache show libdb1

+ 1
- 1
test/integration/test-bug-590438-broken-provides-thanks-to-remove-order View File

@@ -29,7 +29,7 @@ predependsgawk() {
echo "$pkgbasefile
Pre-Depends: $1
" >> rootdir/var/lib/dpkg/status
testequal "Inst gawk (1:3.1.7.dfsg-5 localhost [i386])
testsuccessequal "Inst gawk (1:3.1.7.dfsg-5 localhost [i386])
Conf gawk (1:3.1.7.dfsg-5 localhost [i386])
Remv mawk [1.3.3-15]" aptget install gawk mawk- -sqq -o PreDepends=$(echo "$1" | sed 's/ //g')
}


+ 2
- 2
test/integration/test-bug-591882-conkeror View File

@@ -73,5 +73,5 @@ After this operation, 36.0 MB of additional disk space will be used.
E: Trivial Only specified but this is not a trivial operation."

# Test that the old behavior can be restored with the option
testequal "$UPGRADEFAIL" aptget dist-upgrade --trivial-only -o pkgProblemResolver::FixByInstall=0
testequal "$UPGRADESUCCESS" aptget dist-upgrade --trivial-only #-o pkgProblemResolver::FixByInstall=0
testfailureequal "$UPGRADEFAIL" aptget dist-upgrade --trivial-only -o pkgProblemResolver::FixByInstall=0
testfailureequal "$UPGRADESUCCESS" aptget dist-upgrade --trivial-only #-o pkgProblemResolver::FixByInstall=0

+ 8
- 8
test/integration/test-bug-593360-modifiers-in-names View File

@@ -7,7 +7,7 @@ setupenvironment
configarchitecture "i386"
setupaptarchive

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
g++
@@ -15,12 +15,12 @@ The following NEW packages will be installed:
Inst g++ (4:4.4.5-1 localhost [i386])
Conf g++ (4:4.4.5-1 localhost [i386])' aptget install g++ -s

testequal "Reading package lists...
testsuccessequal "Reading package lists...
Building dependency tree...
Package 'g++' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove g++ -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
g++
@@ -28,7 +28,7 @@ The following NEW packages will be installed:
Inst g++ (4:4.4.5-1 localhost [i386])
Conf g++ (4:4.4.5-1 localhost [i386])' aptget install g+++ -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
g++
@@ -36,7 +36,7 @@ The following NEW packages will be installed:
Inst g++ (4:4.4.5-1 localhost [i386])
Conf g++ (4:4.4.5-1 localhost [i386])' aptget purge g+++ -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
apt
@@ -44,7 +44,7 @@ The following NEW packages will be installed:
Inst apt (0.8.8 localhost [all])
Conf apt (0.8.8 localhost [all])' aptget install apt -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
apt+
@@ -52,7 +52,7 @@ The following NEW packages will be installed:
Inst apt+ (0.8.8 localhost [all])
Conf apt+ (0.8.8 localhost [all])' aptget install apt+ -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
apt+
@@ -60,7 +60,7 @@ The following NEW packages will be installed:
Inst apt+ (0.8.8 localhost [all])
Conf apt+ (0.8.8 localhost [all])' aptget install apt++ -s

testequal 'Reading package lists...
testsuccessequal 'Reading package lists...
Building dependency tree...
The following NEW packages will be installed:
apt+


+ 6
- 6
test/integration/test-bug-596498-trusted-unsigned-repo View File

@@ -18,16 +18,16 @@ aptgetupdate() {
PKGTEXT="$(aptget install cool --assume-no -d | head -n 7)"
DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list'

testequal "$PKGTEXT
testsuccessequal "$PKGTEXT
Download complete and in download only mode" aptget install cool --assume-no -d

testequal "$PKGTEXT
testsuccessequal "$PKGTEXT
Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated

sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE
aptgetupdate 'testsuccess'

testequal "$PKGTEXT
testfailureequal "$PKGTEXT
WARNING: The following packages cannot be authenticated!
cool
Install these packages without verification? [y/N] N
@@ -37,13 +37,13 @@ find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete
sed -i -e 's#deb \[trusted=no\]#deb#' $DEBFILE
aptgetupdate

testequal "$PKGTEXT
testfailureequal "$PKGTEXT
WARNING: The following packages cannot be authenticated!
cool
Install these packages without verification? [y/N] N
E: Some packages could not be authenticated" aptget install cool --assume-no -d

testequal "$PKGTEXT
testsuccessequal "$PKGTEXT
WARNING: The following packages cannot be authenticated!
cool
Authentication warning overridden.
@@ -52,5 +52,5 @@ Download complete and in download only mode" aptget install cool --assume-no -d
sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE
aptgetupdate

testequal "$PKGTEXT
testsuccessequal "$PKGTEXT
Download complete and in download only mode" aptget install cool --assume-no -d

+ 1
- 1
test/integration/test-bug-598669-install-postfix-gets-exim-heavy View File

@@ -7,7 +7,7 @@ setupenvironment
configarchitecture "i386"
setupaptarchive

testequal "Reading package lists...
testfailureequal "Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
exim4 exim4-daemon-light


+ 3
- 3
test/integration/test-bug-601961-install-info View File

@@ -7,7 +7,7 @@ setupenvironment
configarchitecture "i386"
setupaptarchive

testequal 'Reading package lists...
testfailureequal 'Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
findutils
@@ -18,7 +18,7 @@ This should NOT be done unless you know exactly what you are doing!
After this operation, 1745 kB disk space will be freed.
E: Trivial Only specified but this is not a trivial operation.' aptget remove findutils --trivial-only

testequal 'Reading package lists...
testfailureequal 'Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
install-info