OSDN Git Service

trunk整理
[ultramonkey-l7/ultramonkey-l7-v3.git] / test / script / module-protocol-sessionless / sessionless-23.sh
diff --git a/test/script/module-protocol-sessionless/sessionless-23.sh b/test/script/module-protocol-sessionless/sessionless-23.sh
new file mode 100755 (executable)
index 0000000..ae4a501
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. ${SET_DEFAULT_CONF}
+
+#Run nc server
+nc -i 1 -l 9876 > ${TMP_DIR}/nc_tmp &
+NC_PID=$!
+
+#Add Service
+$L7VSD
+if [ $? -ne 0 ]
+then
+        echo "Test failed: $L7VSD"
+        exit 1
+fi
+
+usleep 100000
+$L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b 127.0.0.1:9876
+if [ $? -ne 0 ]
+then
+        echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless -b 127.0.0.1:9876"
+        exit 1
+fi
+
+#Connect
+echo -e -n "GET /real.html/pathinfo?query HTTP/1.0\r
+\r\n" | nc 127.0.0.1 40001
+wait $NC_PID
+
+echo -e -n "GET / HTTP/1.0\r
+\r\n" > $TMP_DIR/nc_expect_tmp
+
+if [ -n "`diff $TMP_DIR/nc_tmp $TMP_DIR/nc_expect_tmp`" ]
+then
+       echo "Test failed: diff $TMP_DIR/nc_tmp $TMP_DIR/nc_expect_tmp"
+        exit 1
+fi
+exit 0
+