diff options
Diffstat (limited to 'tests/common')
-rw-r--r-- | tests/common | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/common b/tests/common new file mode 100644 index 0000000..adc96a2 --- /dev/null +++ b/tests/common @@ -0,0 +1,29 @@ +# -*-shell-script-*- + +failed_cleanup() { + # FIXME: can we be more verbose here? + echo 'FAILED!' + read -p "press enter to cleanup and remove tmp:" + + cleanup +} + +get_gpg_prng_arg() { + if (gpg --quick-random --version >/dev/null 2>&1) ; then + echo quick-random + elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then + echo debug-quick-random + fi +} + +cleanup() { + echo "### removing temp dir..." + rm -rf "$TEMPDIR" + + if [ "$SSHD_PID" ] ; then + echo "### killing off lingering sshd..." + kill "$SSHD_PID" + fi + + wait +} |