Browse Source

add chronic-like testsuccess/testfailure helpers

For many commands the output isn't stable (like then dpkg is called) but
the exitcode is, so this helper enhances the common && msgpass ||
msgfail by generating automatically a msgtest and showing the output of
the command in case of failure instead of discarding it unconditionally,
the later being chronic-like behaviour

Git-Dch: Ignore
tags/debian/0.9.10
David Kalnischkies 8 years ago
parent
commit
0440d936d7
26 changed files with 125 additions and 93 deletions
  1. +34
    -0
      test/integration/framework
  2. +1
    -1
      test/integration/test-apt-cdrom
  3. +5
    -5
      test/integration/test-apt-get-autoremove
  4. +2
    -2
      test/integration/test-bug-407511-fail-invalid-default-release
  5. +2
    -2
      test/integration/test-bug-602412-dequote-redirect
  6. +1
    -1
      test/integration/test-bug-604222-new-and-autoremove
  7. +5
    -5
      test/integration/test-bug-604401-files-are-directories
  8. +10
    -10
      test/integration/test-bug-611729-mark-as-manual
  9. +6
    -6
      test/integration/test-bug-612099-multiarch-conflicts
  10. +2
    -2
      test/integration/test-bug-612557-garbage-upgrade
  11. +2
    -2
      test/integration/test-bug-612958-use-dpkg-multiarch-config
  12. +1
    -1
      test/integration/test-bug-613420-new-garbage-dependency
  13. +1
    -1
      test/integration/test-bug-64141-install-dependencies-for-on-hold
  14. +2
    -2
      test/integration/test-bug-673536-pre-depends-breaks-loop
  15. +2
    -2
      test/integration/test-bug-679371-apt-get-autoclean-multiarch
  16. +2
    -2
      test/integration/test-bug-686346-package-missing-architecture
  17. +1
    -1
      test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch
  18. +2
    -2
      test/integration/test-bug-717891-abolute-uris-for-proxies
  19. +17
    -17
      test/integration/test-compressed-indexes
  20. +1
    -1
      test/integration/test-cve-2013-1051-InRelease-parsing
  21. +1
    -1
      test/integration/test-disappearing-packages
  22. +2
    -2
      test/integration/test-pdiff-usage
  23. +4
    -4
      test/integration/test-policy-pinning
  24. +16
    -16
      test/integration/test-releasefile-valid-until
  25. +2
    -4
      test/integration/test-ubuntu-bug-761175-remove-purge
  26. +1
    -1
      test/integration/test-ubuntu-bug-784473-InRelease-one-message-only

+ 34
- 0
test/integration/framework View File

@@ -928,6 +928,40 @@ testmarkedauto() {
aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail
}

testsuccess() {
if [ "$1" = '--nomsg' ]; then
shift
else
msgtest 'Test for successful execution of' "$*"
fi
local OUTPUT=$(mktemp)
addtrap "rm $OUTPUT;"
if $@ >${OUTPUT} 2>&1; then
msgpass
else
echo
cat $OUTPUT
msgfail
fi
}

testfailure() {
if [ "$1" = '--nomsg' ]; then
shift
else
msgtest 'Test for failure in execution of' "$*"
fi
local OUTPUT=$(mktemp)
addtrap "rm $OUTPUT;"
if $@ >${OUTPUT} 2>&1; then
echo
cat $OUTPUT
msgfail
else
msgpass
fi
}

pause() {
echo "STOPPED execution. Press enter to continue"
local IGNORE


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

@@ -102,5 +102,5 @@ aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' &&

# check that we really can install from a 'cdrom'
testdpkgnotinstalled testing
aptget install testing -y > /dev/null 2>&1
testsuccess aptget install testing -y
testdpkginstalled testing

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

@@ -11,11 +11,11 @@ buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable'
buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf'
setupaptarchive

aptget install unrelated debhelper -qq 2>&1 > /dev/null
testsuccess aptget install unrelated debhelper -y
testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'

testmarkedauto 'po-debconf'
aptget remove debhelper -y -qq 2>&1 > /dev/null
testsuccess aptget remove debhelper -y
testdpkgnotinstalled 'debhelper'
testdpkginstalled 'po-debconf' 'unrelated'

@@ -30,15 +30,15 @@ Remv po-debconf [1.0.16]' aptget autoremove -s
testdpkginstalled 'po-debconf'

echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
aptget autoremove -y -qq 2>&1 > /dev/null
testsuccess aptget autoremove -y
testdpkginstalled 'po-debconf'

echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
aptget autoremove -y -qq 2>&1 > /dev/null
testsuccess aptget autoremove -y
testdpkginstalled "po-debconf"

rm rootdir/etc/apt/apt.conf.d/00autoremove
aptget autoremove -y -qq 2>&1 > /dev/null
testsuccess aptget autoremove -y
testdpkgnotinstalled 'po-debconf'
testmarkedauto



+ 2
- 2
test/integration/test-bug-407511-fail-invalid-default-release View File

@@ -35,14 +35,14 @@ setupaptarchive

passdist() {
msgtest 'Test that target-release is accepted' $1
aptget dist-upgrade -t $1 -qq && msgpass || msgfail
testsuccess --nomsg aptget dist-upgrade -t $1
msgtest 'Test that target-release pins with' $1
aptcache policy -t $1 | grep -q ' 990' && msgpass || msgfail
}

faildist() {
msgtest 'Test that target-release is refused' $1
aptget dist-upgrade -t $1 -qq 2> /dev/null && msgfail || msgpass
testfailure --nomsg aptget dist-upgrade -t $1
}

msgtest 'Test that no default-release is active in this test' 'setup'


+ 2
- 2
test/integration/test-bug-602412-dequote-redirect View File

@@ -16,7 +16,7 @@ mv aptarchive/pool aptarchive/newpool
mv aptarchive/dists aptarchive/newdists

msgtest 'Test redirection works in' 'apt-get update'
aptget update -qq && msgpass || msgfail
testsuccess --nomsg aptget update

# check that I-M-S header is kept in redirections
testequal 'Hit http://localhost:8080 unstable InRelease
@@ -26,4 +26,4 @@ Hit http://localhost:8080 unstable/main Translation-en
Reading package lists...' aptget update #-o debug::pkgacquire=1 -o debug::pkgacquire::worker=1

msgtest 'Test redirection works in' 'package download'
aptget install unrelated --download-only -qq && msgpass || msgfail
testsuccess --nomsg aptget install unrelated --download-only

+ 1
- 1
test/integration/test-bug-604222-new-and-autoremove View File

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

touch rootdir/var/lib/apt/extended_states
aptmark markauto 'libvtk5.4'
testsuccess aptmark markauto 'libvtk5.4'
testmarkedauto 'libvtk5.4'

testequal "Reading package lists...


+ 5
- 5
test/integration/test-bug-604401-files-are-directories View File

@@ -11,7 +11,7 @@ test ! -e rootdir/etc/apt/apt.conf || mv rootdir/etc/apt/apt.conf rootdir/etc/ap

msgtest "Directory instead of a file as apt.conf ignored"
mkdir -p rootdir/etc/apt/apt.conf
aptconfig dump > /dev/null && msgpass || msgfail
testsuccess --nomsg aptconfig dump
rmdir rootdir/etc/apt/apt.conf

msgtest "Good link instead of a file as apt.conf ignored"
@@ -22,7 +22,7 @@ rm rootdir/etc/apt/apt.conf

msgtest "Broken link instead of a file as apt.conf ignored"
ln -s /tmp/doesnt-exist rootdir/etc/apt/apt.conf
aptconfig dump > /dev/null && msgpass || msgfail
testsuccess --nomsg aptconfig dump
rm rootdir/etc/apt/apt.conf


@@ -30,7 +30,7 @@ test ! -e rootdir/etc/apt/sources.list || mv rootdir/etc/apt/sources.list rootdi

msgtest "Directory instead of a file as sources.list ignored"
mkdir -p rootdir/etc/apt/sources.list
aptget update --print-uris 2> /dev/null && msgpass || msgfail
testsuccess --nomsg aptget update --print-uris
rmdir rootdir/etc/apt/sources.list

msgtest "Good link instead of a file as sources.list ignored"
@@ -49,7 +49,7 @@ test ! -e rootdir/etc/apt/preferences || mv rootdir/etc/apt/preferences rootdir/

msgtest "Directory instead of a file as preferences ignored"
mkdir -p rootdir/etc/apt/preferences
aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail
testsuccess --nomsg aptcache policy
rmdir rootdir/etc/apt/preferences

msgtest "Good link instead of a file as preferences ignored"
@@ -62,5 +62,5 @@ rm rootdir/etc/apt/preferences

msgtest "Broken link instead of a file as preferences ignored"
ln -s /tmp/doesnt-exist rootdir/etc/apt/preferences
aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail
testsuccess --nomsg aptcache policy
rm rootdir/etc/apt/preferences

+ 10
- 10
test/integration/test-bug-611729-mark-as-manual View File

@@ -15,21 +15,21 @@ buildsimplenativepackage "c" "all" "1.0" "stable" "Depends: b"
setupaptarchive

# dpkg freaks out if the last package is removed so keep one around
aptget install peace-dpkg -y -qq 2>&1 > /dev/null
testsuccess aptget install peace-dpkg -y
testdpkginstalled peace-dpkg
testmarkedauto

aptget install a -y -qq 2>&1 > /dev/null
testsuccess aptget install a -y
testdpkginstalled a b
testdpkgnotinstalled c
testmarkedauto 'b'

aptget remove a -y -qq 2>&1 > /dev/null
testsuccess aptget remove a -y
testdpkgnotinstalled a c
testdpkginstalled b
testmarkedauto 'b'

aptget install c -y -qq 2>&1 > /dev/null
testsuccess aptget install c -y
testdpkgnotinstalled a
testdpkginstalled b c
testmarkedauto 'b'
@@ -50,7 +50,7 @@ testmarkedauto 'b'

rm rootdir/var/log/apt/history.log

aptget install b --reinstall -y -qq 2>&1 > /dev/null
testsuccess aptget install b --reinstall -y
testdpkgnotinstalled a
testdpkginstalled b c
testmarkedauto 'b'
@@ -67,24 +67,24 @@ b set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b
testmarkedauto

aptget remove b -y -qq 2>&1 > /dev/null
testsuccess aptget remove b -y
testdpkgnotinstalled a b c
testmarkedauto

aptget install a b -y -qq 2>&1 > /dev/null
testsuccess aptget install a b -y
testdpkginstalled a b
testdpkgnotinstalled c
testmarkedauto

aptget purge a b -y -qq 2>&1 > /dev/null
testsuccess aptget purge a b -y
testdpkgnotinstalled a b c
testmarkedauto

aptget install b c -y -qq 2>&1 > /dev/null
testsuccess aptget install b c -y
testdpkgnotinstalled a
testdpkginstalled b c
testmarkedauto

aptget install a -y -qq 2>&1 > /dev/null
testsuccess aptget install a -y
testdpkginstalled a b c
testmarkedauto

+ 6
- 6
test/integration/test-bug-612099-multiarch-conflicts View File

@@ -15,7 +15,7 @@ buildsimplenativepackage 'foobar' 'amd64' '1.0' 'stable' 'Depends: libc6'

setupaptarchive

aptget install libc6:i386 -t stable -y -qq 2>&1 > /dev/null
testsuccess aptget install libc6:i386 -t stable -y
testdpkginstalled libc6:i386
testequal 'Reading package lists...
Building dependency tree...
@@ -79,8 +79,8 @@ Conf libc6 (2.0 testing [all])' aptget upgrade -t testing -s
# as APT (here i386) disagree about the native architecture, so
# we fake it here:
#aptget upgrade -y -qq 2>&1 > /dev/null
aptget purge libc6 -y -qq 2>&1 >/dev/null
aptget install libc6:i386 -y -qq 2>&1 >/dev/null
testsuccess aptget purge libc6 -y
testsuccess aptget install libc6:i386 -y
testdpkginstalled libc6:all

testequal 'Reading package lists...
@@ -129,7 +129,7 @@ buildsimplenativepackage 'foobar-same' 'amd64' '1.0' 'stable' 'Depends: libc6-sa

setupaptarchive

aptget install libc6-same:i386 -t stable -y -qq 2>&1 > /dev/null
testsuccess aptget install libc6-same:i386 -t stable -y
testdpkginstalled libc6-same:i386

testequal 'Reading package lists...
@@ -177,8 +177,8 @@ Conf libc6-same (2.0 testing [all])' aptget upgrade -t testing -s
# as APT (here i386) disagree about the native architecture, so
# we fake it here:
#aptget upgrade -y -qq 2>&1 > /dev/null
aptget purge libc6-same -y -qq 2>&1 >/dev/null
aptget install libc6-same:i386 -y -qq 2>&1 >/dev/null
testsuccess aptget purge libc6-same -y
testsuccess aptget install libc6-same:i386 -y
testdpkginstalled libc6-same:all




+ 2
- 2
test/integration/test-bug-612557-garbage-upgrade View File

@@ -13,7 +13,7 @@ insertpackage 'unstable' 'libreoffice-common' 'all' '1:3.3.0-2' 'Conflicts: open
setupaptarchive

touch rootdir/var/lib/apt/extended_states
aptmark markauto python-uno openoffice.org-common
testsuccess aptmark markauto python-uno openoffice.org-common
#aptmark unmarkauto openoffice.org-emailmerge
testmarkedauto python-uno openoffice.org-common

@@ -32,7 +32,7 @@ The following packages will be upgraded:
After this operation, 53.2 MB disk space will be freed.
E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno

aptmark markauto openoffice.org-emailmerge
testsuccess aptmark markauto openoffice.org-emailmerge
testmarkedauto python-uno openoffice.org-common openoffice.org-emailmerge

testequal 'Reading package lists...


+ 2
- 2
test/integration/test-bug-612958-use-dpkg-multiarch-config View File

@@ -14,13 +14,13 @@ insertinstalledpackage 'libapt' 'armel' '1.0'
testpass() {
rm rootdir/var/cache/apt/*.bin
msgtest 'Test architecture handling' "$1 with $2"
aptcache show libapt:$2 2> /dev/null > /dev/null && msgpass || msgfail
testsuccess --nomsg aptcache show libapt:$2
}

testfail() {
rm rootdir/var/cache/apt/*.bin
msgtest 'Test architecture handling' "$1 with $2"
aptcache show libapt:$2 2> /dev/null > /dev/null && msgfail || msgpass
testfailure --nomsg aptcache show libapt:$2
}

testpass 'no config' 'i386'


+ 1
- 1
test/integration/test-bug-613420-new-garbage-dependency View File

@@ -15,7 +15,7 @@ insertpackage 'unstable' 'openoffice.org-officebean' 'all' '1:3.3.0-5' 'Depends:
setupaptarchive

touch rootdir/var/lib/apt/extended_states
aptmark markauto openoffice.org-officebean
testsuccess aptmark markauto openoffice.org-officebean
testmarkedauto openoffice.org-officebean

testequal "Reading package lists...


+ 1
- 1
test/integration/test-bug-64141-install-dependencies-for-on-hold View File

@@ -31,7 +31,7 @@ The following packages will be upgraded:
After this operation, 0 B of additional disk space will be used.
E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only

aptmark hold apt -qq
testsuccess aptmark hold apt

testequal 'Reading package lists...
Building dependency tree...


+ 2
- 2
test/integration/test-bug-673536-pre-depends-breaks-loop View File

@@ -15,9 +15,9 @@ setupaptarchive
# we check with 'real' packages here as the simulation reports a 'Conf broken'
# which is technical correct for the simulation, but testing errormsg is ugly

aptget install basic=1 -qq > /dev/null
testsuccess aptget install basic=1 -y
testdpkginstalled basic
testdpkgnotinstalled common

aptget dist-upgrade -qq > /dev/null
testsuccess aptget dist-upgrade -y
testdpkginstalled basic common

+ 2
- 2
test/integration/test-bug-679371-apt-get-autoclean-multiarch View File

@@ -14,8 +14,8 @@ setupaptarchive

changetowebserver

aptget update -qq
aptget install pkgall pkgnative pkgforeign -y -qq > /dev/null
testsuccess aptget update
testsuccess aptget install pkgall pkgnative pkgforeign -y

testdpkginstalled pkgall pkgnative pkgforeign



+ 2
- 2
test/integration/test-bug-686346-package-missing-architecture View File

@@ -58,13 +58,13 @@ Building dependency tree...
# pkgd has no update with an architecture
testdpkginstalled pkgd
msgtest 'Test apt-get purge' 'pkgd'
aptget purge pkgd -y >/dev/null 2>&1 && msgpass || msgfail
testsuccess --nomsg aptget purge pkgd -y
testdpkgnotinstalled pkgd

# there is a pkgb with an architecture
testdpkginstalled pkgb
msgtest 'Test apt-get purge' 'pkgb:none'
aptget purge pkgb:none -y >/dev/null 2>&1 && msgpass || msgfail
testsuccess --nomsg aptget purge pkgb:none -y
testdpkgnotinstalled pkgb

# check that dependencies are created after the none package exists in the cache


+ 1
- 1
test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch View File

@@ -42,7 +42,7 @@ enablehookversion 3
observehook() {
rm -f ${hook}-v2.list ${hook}-v3.list
msgtest 'Observe hooks while' "$*"
aptget "$@" -y --force-yes >/dev/null 2>&1 && msgpass || msgfail
testsuccess --nomsg aptget "$@" -y --force-yes
}

observehook install stuff -t stable


+ 2
- 2
test/integration/test-bug-717891-abolute-uris-for-proxies View File

@@ -12,12 +12,12 @@ setupaptarchive
changetowebserver --request-absolute='uri'

msgtest 'Check that absolute paths are' 'not accepted'
aptget update >/dev/null 2>&1 && msgfail || msgpass
testfailure --nomsg aptget update

echo 'Acquire::http::Proxy "http://localhost:8080";' > rootdir/etc/apt/apt.conf.d/99proxy

msgtest 'Check that requests to proxies are' 'absolute uris'
aptget update >/dev/null 2>&1 && msgpass || msgfail
testsuccess --nomsg aptget update

testequal 'Reading package lists...
Building dependency tree...


+ 17
- 17
test/integration/test-compressed-indexes View File

@@ -46,10 +46,10 @@ testrun() {
msgpass
fi
msgtest "Check if package is downloadable"
aptget install -d testpkg -qq && msgpass || msgfail
msgtest "\tdeb file is present"; test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail
testsuccess --nomsg aptget install -d testpkg
msgtest "\tdeb file is present"; testsuccess --nomsg test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb
aptget clean
msgtest "\tdeb file is gone"; ! test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail
msgtest "\tdeb file is gone"; testfailure --nomsg test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb
fi
rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
testequal "$GOODSHOW" aptcache show testpkg
@@ -62,9 +62,9 @@ testrun() {
testequal "$GOODSHOWSRC" aptcache showsrc testpkg
aptget clean
msgtest "Check if the source is aptgetable"
aptget source testpkg -qq 2> /dev/null > /dev/null && msgpass || msgfail
msgtest "\tdsc file is present"; test -f testpkg_1.0.dsc && msgpass || msgfail
msgtest "\tdirectory is present"; test -d testpkg-1.0 && msgpass || msgfail
testsuccess --nomsg aptget source testpkg
msgtest "\tdsc file is present"; testsuccess --nomsg test -f testpkg_1.0.dsc
msgtest "\tdirectory is present"; testsuccess --nomsg test -d testpkg-1.0
rm -rf testpkg-1.0
}

@@ -72,11 +72,11 @@ echo 'Acquire::GzipIndexes "false";' > rootdir/etc/apt/apt.conf.d/02compressinde
msgmsg "File: Test with uncompressed indexes"
testrun

aptget update -qq -o Acquire::Pdiffs=1
testsuccess aptget update -o Acquire::Pdiffs=1
msgmsg "File: Test with uncompressed indexes (update unchanged with pdiffs)"
testrun

aptget update -qq -o Acquire::Pdiffs=0
testsuccess aptget update -o Acquire::Pdiffs=0
msgmsg "File: Test with uncompressed indexes (update unchanged without pdiffs)"
testrun

@@ -84,21 +84,21 @@ rm -rf rootdir/var/lib/apt/lists
echo 'Acquire::CompressionTypes::Order:: "gz";
Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex

aptget update -qq
testsuccess aptget update
msgmsg "File: Test with compressed indexes"
testrun "compressed"

aptget update -qq -o Acquire::Pdiffs=1
testsuccess aptget update -o Acquire::Pdiffs=1
msgmsg "File: Test with compressed indexes (update unchanged with pdiffs)"
testrun "compressed"

aptget update -qq -o Acquire::Pdiffs=0
testsuccess aptget update -o Acquire::Pdiffs=0
msgmsg "File: Test with compressed indexes (update unchanged without pdiffs)"
testrun "compressed"

rm rootdir/etc/apt/apt.conf.d/02compressindex
changetowebserver
aptget update -qq
testsuccess aptget update
GOODPOLICY="$(aptcache policy testpkg)"
test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4
testequal "$GOODPOLICY" aptcache policy testpkg
@@ -106,11 +106,11 @@ testequal "$GOODPOLICY" aptcache policy testpkg
msgmsg "HTTP: Test with uncompressed indexes"
testrun

aptget update -qq -o Acquire::Pdiffs=1
testsuccess aptget update -o Acquire::Pdiffs=1
msgmsg "HTTP: Test with uncompressed indexes (update unchanged with pdiffs)"
testrun

aptget update -qq -o Acquire::Pdiffs=0
testsuccess aptget update -o Acquire::Pdiffs=0
msgmsg "HTTP: Test with uncompressed indexes (update unchanged without pdiffs)"
testrun

@@ -118,14 +118,14 @@ rm -rf rootdir/var/lib/apt/lists
echo 'Acquire::CompressionTypes::Order:: "gz";
Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex

aptget update -qq
testsuccess aptget update
msgmsg "HTTP: Test with compressed indexes"
testrun "compressed"

aptget update -qq -o Acquire::Pdiffs=1
testsuccess aptget update -o Acquire::Pdiffs=1
msgmsg "HTTP: Test with compressed indexes (update unchanged with pdiffs)"
testrun "compressed"

aptget update -qq -o Acquire::Pdiffs=0
testsuccess aptget update -o Acquire::Pdiffs=0
msgmsg "HTTP: Test with compressed indexes (update unchanged without pdiffs)"
testrun "compressed"

+ 1
- 1
test/integration/test-cve-2013-1051-InRelease-parsing View File

@@ -14,7 +14,7 @@ setupaptarchive
changetowebserver
ARCHIVE='http://localhost:8080/'
msgtest 'Initial apt-get update should work with' 'InRelease'
aptget update -qq && msgpass || msgfail
testsuccess --nomsg aptget update

# check that the setup is correct
testequal "good-pkg:


+ 1
- 1
test/integration/test-disappearing-packages View File

@@ -29,7 +29,7 @@ rm -rf "$BUILDDIR"

setupaptarchive

aptget install old-pkg=1.0 --trivial-only -qq 2>&1 > /dev/null
testsuccess aptget install old-pkg=1.0 --trivial-only

testmarkedauto # old-pkg is manual installed



+ 2
- 2
test/integration/test-pdiff-usage View File

@@ -11,7 +11,7 @@ buildaptarchive
setupflataptarchive
changetowebserver
signreleasefiles
aptget update -qq
testsuccess aptget update

testnopackage newstuff
PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')"
@@ -38,7 +38,7 @@ SHA1-Patches:
generatereleasefiles '+1hour'
signreleasefiles
find aptarchive -name 'Packages*' -type f -delete
aptget update -qq
testsuccess aptget update

testnopackage oldstuff
testequal "$(cat ${PKGFILE}-new)


+ 4
- 4
test/integration/test-policy-pinning View File

@@ -228,16 +228,16 @@ testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=ButAutomat
testequalpolicycoolstuff "" "1.0" 100 990 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades -t stable

rm rootdir/etc/apt/preferences
aptget install coolstuff -qq > /dev/null 2> /dev/null
testsuccess aptget install coolstuff -y
testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
aptget dist-upgrade -qq > /dev/null 2> /dev/null
testsuccess aptget dist-upgrade -y
testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
testequalpolicycoolstuff "1.0" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports

aptget install coolstuff -t backports -qq > /dev/null 2> /dev/null
testsuccess aptget install coolstuff -t backports -y
testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades
aptget dist-upgrade -qq > /dev/null 2> /dev/null
testsuccess aptget dist-upgrade -y
testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades
testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports


+ 16
- 16
test/integration/test-releasefile-valid-until View File

@@ -32,64 +32,64 @@ aptgetupdate() {

setupreleasefile
msgtest 'Release file is accepted as it has' 'no Until'
aptgetupdate && msgpass || msgfail
testsuccess --nomsg aptgetupdate

setupreleasefile
msgtest 'Release file is accepted as it has' 'no Until and good Max-Valid'
aptgetupdate -o Acquire::Max-ValidTime=3600 && msgpass || msgfail
testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600

setupreleasefile 'now - 2 days'
msgtest 'Release file is rejected as it has' 'no Until, but bad Max-Valid'
aptgetupdate -o Acquire::Max-ValidTime=3600 && msgfail || msgpass
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600

setupreleasefile 'now - 3 days' 'now + 1 day'
msgtest 'Release file is accepted as it has' 'good Until'
aptgetupdate && msgpass || msgfail
testsuccess --nomsg aptgetupdate

setupreleasefile 'now - 7 days' 'now - 4 days'
msgtest 'Release file is rejected as it has' 'bad Until'
aptgetupdate && msgfail || msgpass
testfailure --nomsg aptgetupdate

setupreleasefile 'now - 7 days' 'now - 4 days'
msgtest 'Release file is rejected as it has' 'bad Until (ignore good Max-Valid)'
aptgetupdate -o Acquire::Max-ValidTime=1209600 && msgfail || msgpass
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600

setupreleasefile 'now - 7 days' 'now - 4 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until)'
aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400

setupreleasefile 'now - 7 days' 'now + 4 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (good Until)'
aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400

setupreleasefile 'now - 7 days' 'now + 4 days'
msgtest 'Release file is accepted as it has' 'good labeled Max-Valid'
aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 && msgpass || msgfail
testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600

setupreleasefile 'now - 7 days' 'now + 4 days'
msgtest 'Release file is rejected as it has' 'bad labeled Max-Valid'
aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 && msgfail || msgpass
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400

setupreleasefile 'now - 7 days' 'now + 1 days'
msgtest 'Release file is accepted as it has' 'good Until (good Min-Valid, no Max-Valid)'
aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail
testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600

setupreleasefile 'now - 7 days' 'now - 4 days'
msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, no Max-Valid)'
aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail
testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600

setupreleasefile 'now - 7 days' 'now - 2 days'
msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, good Max-Valid) <'
aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 && msgpass || msgfail
testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200

setupreleasefile 'now - 7 days' 'now - 2 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, good Min-Valid) >'
aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 && msgfail || msgpass
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200

setupreleasefile 'now - 7 days' 'now - 2 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) <'
aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 && msgfail || msgpass
testfailure --nomsg aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920

setupreleasefile 'now - 7 days' 'now - 2 days'
msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) >'
aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 && msgfail || msgpass
testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920

+ 2
- 4
test/integration/test-ubuntu-bug-761175-remove-purge View File

@@ -18,12 +18,10 @@ setupaptarchive


testdpkgnotinstalled compiz-core
msgtest 'Install package' 'compiz-core'
aptget install compiz-core -qq 2>&1 >/dev/null && msgpass || msgfail
testsuccess aptget install compiz-core
testdpkginstalled compiz-core

msgtest 'Remove package' 'compiz-core'
aptget remove compiz-core -y -qq 2>&1 >/dev/null && msgpass || msgfail
testsuccess aptget remove compiz-core -y
testdpkgnotinstalled compiz-core

msgtest 'Check that conffiles are still around for' 'compiz-core'


+ 1
- 1
test/integration/test-ubuntu-bug-784473-InRelease-one-message-only View File

@@ -28,7 +28,7 @@ MD5Sum:
done

msgtest 'The unsigned garbage before signed block is' 'ignored'
aptget update -qq > /dev/null 2>&1 && msgpass || msgfail
testsuccess --nomsg aptget update

ROOTDIR="$(readlink -f .)"
testequal "Package files:


Loading…
Cancel
Save