about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-11-15 15:09:21 -0800
committerEric Wong <normalperson@yhbt.net>2011-11-15 15:13:06 -0800
commitaab850780f9ff0d74c346d7fd62ac588f4d5879b (patch)
tree4ac64f331a45aafd31b7ce62e97c366478c9fa94 /t
parentc7ba76a21c5d00fb5c173cd6aa847442bbc652cb (diff)
downloadunicorn-aab850780f9ff0d74c346d7fd62ac588f4d5879b.tar.gz
We throw up some fake SSL certs for testing
Diffstat (limited to 't')
-rw-r--r--t/.gitignore1
-rw-r--r--t/GNUmakefile6
-rwxr-xr-xt/sslgen.sh10
3 files changed, 15 insertions, 2 deletions
diff --git a/t/.gitignore b/t/.gitignore
index 2312321..1ba7e52 100644
--- a/t/.gitignore
+++ b/t/.gitignore
@@ -2,3 +2,4 @@
 /.dep+*
 /*.crt
 /*.key
+/ssl-stamp
diff --git a/t/GNUmakefile b/t/GNUmakefile
index 8f2668c..bac50a6 100644
--- a/t/GNUmakefile
+++ b/t/GNUmakefile
@@ -45,7 +45,11 @@ random_blob:
         dd if=/dev/urandom bs=1M count=30 of=$@.$(pid)
         mv $@.$(pid) $@
 
-$(T): random_blob
+ssl-stamp:
+        ./sslgen.sh
+        > $@
+
+$(T): random_blob ssl-stamp
 
 dependencies := socat curl
 deps := $(addprefix .dep+,$(dependencies))
diff --git a/t/sslgen.sh b/t/sslgen.sh
index 3fd070a..eb259bb 100755
--- a/t/sslgen.sh
+++ b/t/sslgen.sh
@@ -1,6 +1,14 @@
 #!/bin/sh
 set -e
-set -x
+
+lock=$0.lock
+while ! mkdir $lock 2>/dev/null
+do
+        echo >&2 "PID=$$ waiting for $lock"
+        sleep 1
+done
+pid=$$
+trap 'if test $$ -eq $pid; then rmdir $lock; fi' EXIT
 
 certinfo() {
         echo US