summaryrefslogtreecommitdiff
path: root/tests/common
blob: 727ad0f33cec5cad0502ad0b6089f5447811408b (plain)
  1. # -*-shell-script-*-
  2. failed_cleanup() {
  3. # FIXME: can we be more verbose here?
  4. echo 'FAILED!'
  5. if [ -z "$MONKEYSPHERE_TEST_NO_EXAMINE" ] ; then
  6. printf "press enter to cleanup and remove tmp (or type 'bash' for a subshell to examine): " >&2
  7. read XX
  8. if [ "$XX" = bash ] ; then
  9. echo "Entering subshell..."
  10. cd "$TEMPDIR"
  11. bash
  12. fi
  13. fi
  14. cleanup
  15. }
  16. get_gpg_prng_arg() {
  17. if (gpg --quick-random --version >/dev/null 2>&1) ; then
  18. echo quick-random
  19. elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then
  20. echo debug-quick-random
  21. fi
  22. }
  23. cleanup() {
  24. echo "### removing temp dir..."
  25. rm -rf "$TEMPDIR"
  26. if [ "$SSHD_PID" ] ; then
  27. echo "### killing off lingering sshd..."
  28. kill "$SSHD_PID"
  29. fi
  30. wait
  31. }