You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

97 lines
2.5 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture "i386"
  7. buildsimplenativepackage "peace-dpkg" "all" "1.0" "stable"
  8. buildsimplenativepackage "a" "all" "1.0" "stable" "Depends: b"
  9. buildsimplenativepackage "b" "all" "1.0" "stable"
  10. buildsimplenativepackage "c" "all" "1.0" "stable" "Depends: b"
  11. setupaptarchive
  12. # dpkg freaks out if the last package is removed so keep one around
  13. testsuccess aptget install peace-dpkg -y
  14. testdpkginstalled peace-dpkg
  15. testmarkedauto
  16. testsuccess aptget install a -y
  17. testdpkginstalled a b
  18. testdpkgnotinstalled c
  19. testmarkedauto 'b'
  20. testsuccess aptget remove a -y
  21. testdpkgnotinstalled a c
  22. testdpkginstalled b
  23. testmarkedauto 'b'
  24. testsuccess aptget install c -y
  25. testdpkgnotinstalled a
  26. testdpkginstalled b c
  27. testmarkedauto 'b'
  28. testsuccessequal 'Reading package lists...
  29. Building dependency tree...
  30. Reading state information...
  31. b is already the newest version (1.0).
  32. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b --only-upgrade
  33. testmarkedauto 'b'
  34. testsuccessequal 'Reading package lists...
  35. Building dependency tree...
  36. Reading state information...
  37. b is already the newest version (1.0).
  38. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d
  39. testmarkedauto 'b'
  40. rm rootdir/var/log/apt/history.log
  41. testsuccess aptget install b --reinstall -y
  42. testdpkgnotinstalled a
  43. testdpkginstalled b c
  44. testmarkedauto 'b'
  45. sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
  46. if [ -n "$SUDO_USER" ] && [ "$(id -u "$SUDO_USER")" -gt 0 ]; then
  47. testfileequal 'rootdir/var/log/apt/history.log' "
  48. Requested-By: $SUDO_USER ($(id -u "$SUDO_USER"))
  49. Reinstall: b:i386 (1.0)"
  50. else
  51. testfileequal 'rootdir/var/log/apt/history.log' '
  52. Reinstall: b:i386 (1.0)'
  53. fi
  54. testsuccessequal 'Reading package lists...
  55. Building dependency tree...
  56. Reading state information...
  57. b is already the newest version (1.0).
  58. b set to manually installed.
  59. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b
  60. testmarkedauto
  61. testsuccess aptget remove b -y
  62. testdpkgnotinstalled a b c
  63. testmarkedauto
  64. testsuccess aptget install a b -y
  65. testdpkginstalled a b
  66. testdpkgnotinstalled c
  67. testmarkedauto
  68. testsuccess aptget purge a b -y
  69. testdpkgnotinstalled a b c
  70. testmarkedauto
  71. testsuccess aptget install b c -y
  72. testdpkgnotinstalled a
  73. testdpkginstalled b c
  74. testmarkedauto
  75. testsuccess aptget install a -y
  76. testdpkginstalled a b c
  77. testmarkedauto