break out default variables into their own file: defaultenv
[monkeysphere.git] / tests / common
1 # -*-shell-script-*-
2
3 failed_cleanup() {
4     # FIXME: can we be more verbose here?
5     echo 'FAILED!'
6     if [ "$MONKEYSPHERE_TEST_ALLOW_EXAMINATION" = prompt ] ; then
7         read -p "press enter to cleanup and remove tmp (or type bash for a subshell to examine): " XX
8         if [ "$XX" = bash ] ; then
9             echo "Entering subshell..."
10             cd "$TEMPDIR"
11             bash
12         fi
13     fi
14
15     cleanup
16 }
17
18 get_gpg_prng_arg() {
19     if (gpg --quick-random --version >/dev/null 2>&1) ; then
20         echo quick-random
21     elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then
22         echo debug-quick-random
23     fi
24 }
25
26 cleanup() {
27     echo "### removing temp dir..."
28     rm -rf "$TEMPDIR"
29
30     if [ "$SSHD_PID" ] ; then
31         echo "### killing off lingering sshd..."
32         kill "$SSHD_PID"
33     fi
34
35     wait
36 }