test-apt-progress-fd-conffile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'native'
  7. # old conffile
  8. setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable'
  9. BUILDDIR='incoming/compiz-core-1.0'
  10. mkdir -p "${BUILDDIR}/debian/compiz-core/etc"
  11. echo 'foo=bar;' > "${BUILDDIR}/compiz.conf"
  12. echo 'compiz.conf /etc/compiz.conf' >> "${BUILDDIR}/debian/install"
  13. buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
  14. rm -rf "$BUILDDIR"
  15. # new conffile
  16. setupsimplenativepackage 'compiz-core' 'native' '2.0' 'unstable'
  17. BUILDDIR='incoming/compiz-core-2.0'
  18. mkdir -p "${BUILDDIR}/debian/compiz-core/etc"
  19. echo 'foo2=bar2;' > "${BUILDDIR}/compiz.conf"
  20. echo 'compiz.conf /etc/compiz.conf' >> "${BUILDDIR}/debian/install"
  21. buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
  22. rm -rf "$BUILDDIR"
  23. setupaptarchive
  24. testsuccess aptget install compiz-core=1.0
  25. # fake conffile change
  26. echo 'meep' >> rootdir/etc/compiz.conf/compiz.conf
  27. # FIXME: Is there really no way to see if dpkg actually prompts?
  28. msgtest 'Test for successful execution of' 'apt-get install compiz-core=2.0'
  29. exec 3> apt-progress.log
  30. testsuccess --nomsg aptget install compiz-core=2.0 -o APT::Status-Fd=3 -o Dpkg::Use-Pty=false -o dpkg::options::='--force-confold'
  31. # and ensure there is a conffile message in the file
  32. msgtest 'Test status fd for an included' 'pmconffile msg'
  33. testsuccess --nomsg grep "pmconffile:/etc/compiz.conf/compiz.conf" apt-progress.log