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.
 
 
 
 
 
 

41 lines
909 B

  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'native'
  7. configdpkgnoopchroot
  8. setupsimplenativepackage "fdleaks" 'native' '1.0' 'unstable'
  9. BUILDDIR="incoming/fdleaks-1.0"
  10. for script in 'preinst' 'postinst' 'prerm' 'postrm'; do
  11. echo '#!/bin/sh
  12. ls -l /proc/self/fd/' > ${BUILDDIR}/debian/$script
  13. done
  14. buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
  15. rm -rf "$BUILDDIR"
  16. setupaptarchive
  17. testsuccess aptget install -y fdleaks
  18. msgtest 'Check if fds were not' 'leaked'
  19. if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = '8' ]; then
  20. msgpass
  21. else
  22. echo
  23. cat rootdir/tmp/testsuccess.output
  24. msgfail
  25. fi
  26. testsuccess aptget purge -y fdleaks
  27. msgtest 'Check if fds were not' 'leaked'
  28. if [ "$(grep 'root root' rootdir/tmp/testsuccess.output | wc -l)" = '12' ]; then
  29. msgpass
  30. else
  31. echo
  32. cat rootdir/tmp/testsuccess.output
  33. msgfail
  34. fi