summaryrefslogtreecommitdiffstats
path: root/smoketests
diff options
context:
space:
mode:
authorSoren Hansen <soren@linux2go.dk>2011-03-18 11:27:38 +0100
committerSoren Hansen <soren@linux2go.dk>2011-03-18 11:27:38 +0100
commit9eb64af0d7182f19fd7eda75371e202022f79891 (patch)
tree97d2a3f8e87e2ac92c85864dd88904e8847012b6 /smoketests
parent9608ef7d49dd5181f45bd458cea676f79116c39f (diff)
downloadnova-9eb64af0d7182f19fd7eda75371e202022f79891.tar.gz
nova-9eb64af0d7182f19fd7eda75371e202022f79891.tar.xz
nova-9eb64af0d7182f19fd7eda75371e202022f79891.zip
Make proxy.sh work with both openbsd and traditional variants of netcat.
Diffstat (limited to 'smoketests')
-rwxr-xr-xsmoketests/proxy.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/smoketests/proxy.sh b/smoketests/proxy.sh
index 9b3f3108a..b9057fe9d 100755
--- a/smoketests/proxy.sh
+++ b/smoketests/proxy.sh
@@ -11,12 +11,19 @@
mkfifo backpipe1
mkfifo backpipe2
+if nc -h 2>&1 | grep -i openbsd
+then
+ NC_LISTEN="nc -l"
+else
+ NC_LISTEN="nc -l -p"
+fi
+
# NOTE(vish): proxy metadata on port 80
while true; do
- nc -l -p 80 0<backpipe1 | nc 169.254.169.254 80 1>backpipe1
+ $NC_LISTEN 80 0<backpipe1 | nc 169.254.169.254 80 1>backpipe1
done &
# NOTE(vish): proxy google on port 8080
while true; do
- nc -l -p 8080 0<backpipe2 | nc 74.125.19.99 80 1>backpipe2
+ $NC_LISTEN 8080 0<backpipe2 | nc 74.125.19.99 80 1>backpipe2
done &