summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorJameson Graef Rollins <jrollins@finestructure.net>2009-02-04 01:12:02 -0500
committerJameson Graef Rollins <jrollins@finestructure.net>2009-02-04 01:12:02 -0500
commitee3660b61a72c0fd17f7841c1d0c67df6e9f9164 (patch)
treed4132e0dac35497e9dee5843b5316df3c712a4b0 /tests/common
parent227436f2a5a839d85e76f1ad1d823de2137b8cbb (diff)
move keytrans test to a separate test script, and move functions common to all test to a common file
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common29
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
+}