diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-11-15 15:09:21 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-11-15 15:13:06 -0800 |
commit | aab850780f9ff0d74c346d7fd62ac588f4d5879b (patch) | |
tree | 4ac64f331a45aafd31b7ce62e97c366478c9fa94 | |
parent | c7ba76a21c5d00fb5c173cd6aa847442bbc652cb (diff) | |
download | unicorn-aab850780f9ff0d74c346d7fd62ac588f4d5879b.tar.gz |
We throw up some fake SSL certs for testing
-rw-r--r-- | t/.gitignore | 1 | ||||
-rw-r--r-- | t/GNUmakefile | 6 | ||||
-rwxr-xr-x | t/sslgen.sh | 10 |
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 |