test-apt-get-install-deb 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. # regression test for #754904
  8. testfailureequal 'E: Unable to locate package /dev/null' aptget install -qq /dev/null
  9. # only consider .deb files
  10. cat > foo.rpm <<EOF
  11. I'm not a deb, I'm a teapot.
  12. EOF
  13. testfailureequal "E: Unable to locate package ./foo.rpm
  14. E: Couldn't find any package by glob './foo.rpm'
  15. E: Couldn't find any package by regex './foo.rpm'" aptget install -qq ./foo.rpm
  16. # and ensure we fail for invalid debs
  17. mv foo.rpm foo.deb
  18. testfailure aptget install ./foo.deb
  19. testsuccess grep '^E: Sub-process Popen returned an error code' rootdir/tmp/testfailure.output
  20. testequal "E: Encountered a section with no Package: header
  21. E: Problem with MergeList ${TMPWORKINGDIRECTORY}/foo.deb
  22. E: The package lists or status file could not be parsed or opened." tail -n 3 rootdir/tmp/testfailure.output
  23. # fakeroot is currently not found, framwork needs updating
  24. buildsimplenativepackage 'foo' 'i386,amd64' '1.0'
  25. testfailureequal "Reading package lists...
  26. Building dependency tree...
  27. Note, selecting 'foo:i386' instead of './incoming/foo_1.0_i386.deb'
  28. Note, selecting 'foo' instead of './incoming/foo_1.0_amd64.deb'
  29. Some packages could not be installed. This may mean that you have
  30. requested an impossible situation or if you are using the unstable
  31. distribution that some required packages have not yet been created
  32. or been moved out of Incoming.
  33. The following information may help to resolve the situation:
  34. The following packages have unmet dependencies:
  35. foo:i386 : Conflicts: foo but 1.0 is to be installed
  36. foo : Conflicts: foo:i386 but 1.0 is to be installed
  37. E: Unable to correct problems, you have held broken packages." aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s -q=0
  38. testdpkgnotinstalled 'foo'
  39. testsuccess aptget install ./incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1
  40. testdpkginstalled 'foo:i386'
  41. testsuccessequal "Reading package lists...
  42. Building dependency tree...
  43. Reading state information...
  44. Note, selecting 'foo' instead of './incoming/foo_1.0_amd64.deb'
  45. The following packages will be REMOVED:
  46. foo:i386
  47. The following NEW packages will be installed:
  48. foo
  49. 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  50. Remv foo:i386 [1.0]
  51. Inst foo (1.0 local-deb [amd64])
  52. Conf foo (1.0 local-deb [amd64])" aptget install ./incoming/foo_1.0_amd64.deb -s -q=0
  53. # Check that installing the local deb works if it is not the candidate
  54. echo "Package: foo
  55. Pin: version 1.0
  56. Pin-Priority: -1" > rootdir/etc/apt/preferences
  57. testsuccessequal "Reading package lists...
  58. Building dependency tree...
  59. Reading state information...
  60. Note, selecting 'foo' instead of './incoming/foo_1.0_amd64.deb'
  61. The following packages will be REMOVED:
  62. foo:i386
  63. The following NEW packages will be installed:
  64. foo
  65. 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  66. Remv foo:i386 [1.0]
  67. Inst foo (1.0 local-deb [amd64])
  68. Conf foo (1.0 local-deb [amd64])" aptget install ./incoming/foo_1.0_amd64.deb -s -q=0