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.
 
 
 
 
 
 

112 lines
3.2 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386' 'amd64'
  7. generatelotsofnames() {
  8. for i in $(seq 0 10000); do
  9. printf ', this-is-a-long-pkg-name-%s (= 0.a.long.version)' "$i"
  10. done
  11. }
  12. DESCR='Some description
  13. That has multiple lines'
  14. insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
  15. insertpackage 'unstable' 'bar' 'i386,amd64' '1' '' '' "$DESCR"
  16. insertpackage 'unstable' 'big' 'i386,amd64' '1' 'Installed-Size: 4129421' '' "$DESCR"
  17. insertpackage 'unstable' 'large' 'all' '1' "Provides: pkga$(generatelotsofnames)" '' "$DESCR"
  18. insertpackage 'unstable' 'large2' 'all' '1' "Provides: foobar, pkga$(generatelotsofnames)" '' "$DESCR"
  19. insertinstalledpackage 'foo' 'all' '1.0'
  20. setupaptarchive
  21. APTARCHIVE=$(readlink -f ./aptarchive)
  22. # note that we do not display Description-md5 with the "apt" cmd
  23. # and also show some additional fields that are calculated
  24. testsuccessequal "Package: foo
  25. Version: 1.0
  26. Priority: optional
  27. Section: other
  28. Maintainer: Joe Sixpack <joe@example.org>
  29. Installed-Size: 43.0 kB
  30. Download-Size: unknown
  31. APT-Manual-Installed: yes
  32. APT-Sources: file:$APTARCHIVE unstable/main all Packages
  33. Description: Some description
  34. That has multiple lines
  35. " apt show foo
  36. testsuccessequal "Package: bar
  37. Version: 1
  38. Priority: optional
  39. Section: other
  40. Maintainer: Joe Sixpack <joe@example.org>
  41. Installed-Size: 43.0 kB
  42. Download-Size: unknown
  43. APT-Sources: file:$APTARCHIVE unstable/main i386 Packages
  44. Description: Some description
  45. That has multiple lines
  46. " apt show bar
  47. testsuccessequal "Package: bar:amd64
  48. Version: 1
  49. Priority: optional
  50. Section: other
  51. Maintainer: Joe Sixpack <joe@example.org>
  52. Installed-Size: 43.0 kB
  53. Download-Size: unknown
  54. APT-Sources: file:$APTARCHIVE unstable/main amd64 Packages
  55. Description: Some description
  56. That has multiple lines
  57. " apt show bar:amd64
  58. testsuccessequal "Package: big:amd64
  59. Version: 1
  60. Priority: optional
  61. Section: other
  62. Maintainer: Joe Sixpack <joe@example.org>
  63. Installed-Size: 4229 MB
  64. Download-Size: unknown
  65. APT-Sources: file:$APTARCHIVE unstable/main amd64 Packages
  66. Description: Some description
  67. That has multiple lines
  68. " apt show big:amd64
  69. testsuccessequal "Package: large
  70. Version: 1
  71. Priority: optional
  72. Section: other
  73. Maintainer: Joe Sixpack <joe@example.org>
  74. Installed-Size: 43.0 kB
  75. Provides: pkga$(generatelotsofnames)
  76. Download-Size: unknown
  77. APT-Sources: file:$APTARCHIVE unstable/main all Packages
  78. Description: Some description
  79. That has multiple lines
  80. " apt show large
  81. testsuccessequal "Package: large2
  82. Version: 1
  83. Priority: optional
  84. Section: other
  85. Maintainer: Joe Sixpack <joe@example.org>
  86. Installed-Size: 43.0 kB
  87. Provides: foobar, pkga$(generatelotsofnames)
  88. Download-Size: unknown
  89. APT-Sources: file:$APTARCHIVE unstable/main all Packages
  90. Description: Some description
  91. That has multiple lines
  92. " apt show large2
  93. # this is the default, but disabled by the testcases
  94. testsuccess apt show foo -o Apt::Cmd::Disable-Script-Warning=0
  95. cp rootdir/tmp/testsuccess.output aptshow.output
  96. testsuccess grep '^WARNING: ' aptshow.output
  97. if [ "$(id -u)" != '0' ]; then
  98. testsuccess apt install foo -s -o APT::Get::Show-User-Simulation-Note=1
  99. cp rootdir/tmp/testsuccess.output aptshow.output
  100. testsuccess grep '^NOTE: ' aptshow.output
  101. fi