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.
 
 
 
 
 
 

94 lines
3.2 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386' 'armel'
  7. insertpackage 'unstable' 'foo' 'all' '1.0'
  8. insertinstalledpackage 'bar' 'i386' '1.0'
  9. insertinstalledpackage 'foobar' 'i386' '1.0'
  10. insertpackage 'unstable' 'foobar' 'i386' '2.0'
  11. insertinstalledpackage 'baz' 'all' '0.1'
  12. insertpackage 'testing' 'baz' 'all' '1.0'
  13. insertpackage 'unstable' 'baz' 'all' '2.0'
  14. insertinstalledpackage 'foreign' 'armel' '1.0' 'Multi-Arch: foreign'
  15. insertpackage 'unstable' 'foreign' 'i386,armel' '2.0' 'Multi-Arch: foreign'
  16. insertpackage 'unstable' 'lib' 'i386,armel' '2.0' 'Multi-Arch: same'
  17. setupaptarchive
  18. testsuccessequal "Listing...
  19. bar/now 1.0 i386 [installed,local]
  20. baz/unstable 2.0 all [upgradable from: 0.1]
  21. dpkg/now 1.16.2+fake all [installed,local]
  22. foo/unstable 1.0 all
  23. foobar/unstable 2.0 i386 [upgradable from: 1.0]
  24. foreign/unstable 2.0 armel [upgradable from: 1.0]
  25. foreign/unstable 2.0 i386
  26. lib/unstable 2.0 armel
  27. lib/unstable 2.0 i386" apt list
  28. testsuccessequal "Listing...
  29. foo/unstable 1.0 all
  30. foobar/unstable 2.0 i386 [upgradable from: 1.0]" apt list "foo*"
  31. testsuccessequal "Listing...
  32. baz/unstable 2.0 all [upgradable from: 0.1]
  33. foobar/unstable 2.0 i386 [upgradable from: 1.0]
  34. foreign/unstable 2.0 armel [upgradable from: 1.0]" apt list --upgradable
  35. # FIXME: hm, hm - does it make sense to have this different? shouldn't
  36. # we use "installed,upgradable" consistently?
  37. testsuccessequal "Listing...
  38. bar/now 1.0 i386 [installed,local]
  39. baz/now 0.1 all [installed,upgradable to: 2.0]
  40. dpkg/now 1.16.2+fake all [installed,local]
  41. foobar/now 1.0 i386 [installed,upgradable to: 2.0]
  42. foreign/now 1.0 armel [installed,upgradable to: 2.0]" apt list --installed
  43. testsuccessequal "Listing...
  44. bar/now 1.0 i386 [installed,local]
  45. foobar/unstable 2.0 i386 [upgradable from: 1.0]
  46. foobar/now 1.0 i386 [installed,upgradable to: 2.0]
  47. " apt list bar foobar --all-versions
  48. testsuccessequal "Listing...
  49. bar/now 1.0 i386 [installed,local]
  50. an autogenerated dummy bar=1.0/installed
  51. " apt list bar --verbose
  52. # test for dpkg ^rc state
  53. insertinstalledpackage 'conf-only' 'i386' '1.0' '' '' 'deinstall ok config-files'
  54. testsuccessequal "Listing...
  55. conf-only/now 1.0 i386 [residual-config]" apt list conf-only
  56. # ensure that the users learns about multiple versions too
  57. testsuccessequal "Listing...
  58. baz/unstable 2.0 all [upgradable from: 0.1]
  59. N: There are 2 additional versions. Please use the '-a' switch to see them." apt list baz -o quiet=0
  60. testsuccessequal 'Listing...
  61. baz/unstable 2.0 all [upgradable from: 0.1]
  62. baz/testing 1.0 all
  63. baz/now 0.1 all [installed,upgradable to: 2.0]
  64. ' apt list baz -o quiet=0 -a
  65. # test format strings for machine parseable output
  66. testsuccessequal 'bar - 1.0 - 1.0
  67. 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}"
  68. insertinstalledpackage 'lib' 'i386,armel' '1.0' 'Multi-Arch: same'
  69. testsuccessequal 'Listing...
  70. baz/unstable 2.0 all [upgradable from: 0.1]
  71. foobar/unstable 2.0 i386 [upgradable from: 1.0]
  72. foreign/unstable 2.0 armel [upgradable from: 1.0]
  73. lib/unstable 2.0 armel [upgradable from: 1.0]
  74. lib/unstable 2.0 i386 [upgradable from: 1.0]' apt list --upgradeable