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.
 
 
 
 
 
 

51 lines
1.9 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. testsuccess aptconfig dump
  8. testsuccessequal 'APT::Architecture "amd64";' aptconfig dump APT::Architecture
  9. testempty aptconfig dump config::which::does::not::exist
  10. testsuccessequal 'APT::Architectures "";
  11. APT::Architectures:: "amd64";' aptconfig dump APT::Architectures
  12. testsuccessequal 'APT::Architectures:: "amd64";' aptconfig dump --no-empty APT::Architectures
  13. testsuccessequal 'amd64' aptconfig dump --no-empty --format='%v%n' APT::Architectures
  14. testempty aptconfig shell
  15. testfailureequal 'E: Arguments not in pairs' aptconfig shell APT::Architecture
  16. testempty aptconfig shell APT::Architecture ARCH # incorrect order
  17. testsuccessequal "ARCH='amd64'" aptconfig shell ARCH APT::Architecture
  18. ROOTDIR="$(readlink -f rootdir)"
  19. testsuccessequal "CONFIG='apt.conf'" aptconfig shell CONFIG Dir::Etc::main
  20. testsuccessequal "CONFIG='${ROOTDIR}/etc/apt/apt.conf'" aptconfig shell CONFIG Dir::Etc::main/f
  21. testsuccessequal "CONFIG='etc/apt'" aptconfig shell CONFIG Dir::Etc
  22. testsuccessequal "CONFIG='${ROOTDIR}/etc/apt/'" aptconfig shell CONFIG Dir::Etc/ # old style
  23. testsuccessequal "CONFIG='${ROOTDIR}/etc/apt/'" aptconfig shell CONFIG Dir::Etc/d
  24. testempty aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
  25. export DEB_BUILD_PROFILES='nodoc stage1'
  26. testsuccessequal 'nodoc
  27. stage1' aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
  28. unset DEB_BUILD_PROFILES
  29. testempty aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
  30. cat > spaces.conf <<EOF
  31. Spaces::Test::"Foo Bar" "1 1";
  32. Spaces::Test2::" Bar Baz " "B B" {
  33. A%20B "C C";
  34. "B C" "A A";
  35. };
  36. EOF
  37. testsuccessequal 'Spaces::Test "";
  38. Spaces::Test::Foo%20Bar "1 1";
  39. Spaces::Test2 "";
  40. Spaces::Test2::%20Bar%20Baz%20 "B B";
  41. Spaces::Test2::%20Bar%20Baz%20::A%20B "C C";
  42. Spaces::Test2::%20Bar%20Baz%20::B%20C "A A";' aptconfig dump -c spaces.conf Spaces::Test Spaces::Test2