move keytrans test to a separate test script, and move functions common to all test...
[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:"
7
8     cleanup
9 }
10
11 get_gpg_prng_arg() {
12     if (gpg --quick-random --version >/dev/null 2>&1) ; then
13         echo quick-random
14     elif (gpg --debug-quick-random --version >/dev/null 2>&1) ; then
15         echo debug-quick-random
16     fi
17 }
18
19 cleanup() {
20     echo "### removing temp dir..."
21     rm -rf "$TEMPDIR"
22
23     if [ "$SSHD_PID" ] ; then
24         echo "### killing off lingering sshd..."
25         kill "$SSHD_PID"
26     fi
27
28     wait
29 }