test-apt-cli-show 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture "i386"
  7. if [ ! -x ${BUILDDIRECTORY}/apt ]; then
  8. msgmsg "No ${BUILDDIRECTORY}/apt"
  9. msgskip
  10. exit 0
  11. fi
  12. DESCR='Some description
  13. That has multiple lines'
  14. insertpackage 'unstable' 'foo' 'all' '1.0' '' '' "$DESCR"
  15. insertinstalledpackage 'foo' 'all' '1.0'
  16. setupaptarchive
  17. APTARCHIVE=$(readlink -f ./aptarchive)
  18. # note that we do not display Description-md5 with the "apt" cmd
  19. # and also show some additional fields that are calculated
  20. testsuccessequal "Package: foo
  21. Version: 1.0
  22. Priority: optional
  23. Section: other
  24. Maintainer: Joe Sixpack <joe@example.org>
  25. Installed-Size: 43.0 kB
  26. Download-Size: unknown
  27. APT-Manual-Installed: yes
  28. APT-Sources: file:$APTARCHIVE unstable/main all Packages
  29. Description: Some description
  30. That has multiple lines
  31. " apt show foo
  32. # this is the default, but disabled by the testcases
  33. testsuccess apt show foo -o Apt::Cmd::Disable-Script-Warning=0
  34. cp rootdir/tmp/testsuccess.output aptshow.output
  35. testsuccess grep '^WARNING: ' aptshow.output
  36. if [ "$(id -u)" != '0' ]; then
  37. testsuccess apt install foo -s -o APT::Get::Show-User-Simulation-Note=1
  38. cp rootdir/tmp/testsuccess.output aptshow.output
  39. testsuccess grep '^NOTE: ' aptshow.output
  40. fi