making entry into subshell after failed test run more explicit (thanks for the sugges...
[monkeysphere.git] / tests / common
1 # -*-shell-script-*-
2
3 failed_cleanup() {
4     # FIXME: can we be more verbose here?
5     echo 'FAILED!'
6     read -p "press enter to cleanup and remove tmp (or type bash for a subshell to examine): " XX
7     if [ "$XX" = bash ] ; then
8         echo "Entering subshell..."
9         cd "$TEMPDIR"
10         bash
11     fi
12
13     cleanup
14 }
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
24 cleanup() {
25     echo "### removing temp dir..."
26     rm -rf "$TEMPDIR"
27
28     if [ "$SSHD_PID" ] ; then
29         echo "### killing off lingering sshd..."
30         kill "$SSHD_PID"
31     fi
32
33     wait
34 }