• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂a284804ed4ccb5c074984999f298daff7d833ed5 (tree)
時間2010-10-14 17:12:01
作者6638678 <6638678@1ed6...>
Commiter6638678

Log Message

add test scripts

git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10371 1ed66053-1c2d-0410-8867-f7571e6e31d3

Change Summary

差異

--- /dev/null
+++ b/test/script/module-protocol-sessionless/materials/sessionless-12.pl
@@ -0,0 +1,20 @@
1+#!/usr/bin/perl
2+
3+use strict;
4+use warnings;
5+use IO::Socket::INET;
6+
7+$| = 1;
8+
9+my $socket = IO::Socket::INET->new(
10+ PeerAddr => "127.0.0.1:40001"
11+);
12+
13+print $socket "POST / HTTP/1.0\r\nContent-length: 10\r\nX-Forwarded-For: proxy1,proxy2\r\n\r\n";
14+print $socket "0123456789";
15+
16+while (<$socket>) {
17+ print STDOUT $_;
18+}
19+
20+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/materials/sessionless-14.pl
@@ -0,0 +1,20 @@
1+#!/usr/bin/perl
2+
3+use strict;
4+use warnings;
5+use IO::Socket::INET;
6+
7+$| = 1;
8+
9+my $socket = IO::Socket::INET->new(
10+ PeerAddr => "127.0.0.1:40001"
11+);
12+
13+print $socket "POST / HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-length: 10\r\nX-Forwarded-For: proxy1,proxy2\r\n\r\n";
14+print $socket "0123456789";
15+
16+while (<$socket>) {
17+ print STDOUT $_;
18+}
19+
20+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/materials/sessionless-15.pl
@@ -0,0 +1,20 @@
1+#!/usr/bin/perl
2+
3+use strict;
4+use warnings;
5+use IO::Socket::INET;
6+
7+$| = 1;
8+
9+my $socket = IO::Socket::INET->new(
10+ PeerAddr => "127.0.0.1:40001"
11+);
12+
13+print $socket "GET / HTTP/1.0\r\nX-Forwar";
14+print $socket "ded-For: proxy1,proxy2\r\n\r\n";
15+
16+while (<$socket>) {
17+ print STDOUT $_;
18+}
19+
20+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/materials/sessionless-6.pl
@@ -0,0 +1,20 @@
1+#!/usr/bin/perl
2+
3+use strict;
4+use warnings;
5+use IO::Socket::INET;
6+
7+$| = 1;
8+
9+my $socket = IO::Socket::INET->new(
10+ PeerAddr => "127.0.0.1:40001"
11+);
12+
13+print $socket "POST / HTTP/1.0\r\nContent-length: 10\r\n\r\n";
14+print $socket "0123456789";
15+
16+while (<$socket>) {
17+ print STDOUT $_;
18+}
19+
20+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/materials/sessionless-8.pl
@@ -0,0 +1,20 @@
1+#!/usr/bin/perl
2+
3+use strict;
4+use warnings;
5+use IO::Socket::INET;
6+
7+$| = 1;
8+
9+my $socket = IO::Socket::INET->new(
10+ PeerAddr => "127.0.0.1:40001"
11+);
12+
13+print $socket "POST / HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-length: 10\r\n\r\n";
14+print $socket "0123456789";
15+
16+while (<$socket>) {
17+ print STDOUT $_;
18+}
19+
20+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/materials/sessionless-9.pl
@@ -0,0 +1,20 @@
1+#!/usr/bin/perl
2+
3+use strict;
4+use warnings;
5+use IO::Socket::INET;
6+
7+$| = 1;
8+
9+my $socket = IO::Socket::INET->new(
10+ PeerAddr => "127.0.0.1:40001"
11+);
12+
13+print $socket "GET / HT";
14+print $socket "TP/1.0\r\n\r\n";
15+
16+while (<$socket>) {
17+ print STDOUT $_;
18+}
19+
20+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/sessionless-12.sh
@@ -0,0 +1,49 @@
1+#!/bin/bash
2+
3+. ${SET_DEFAULT_CONF}
4+
5+nc -i 1 -l 9876 > ${TMP_DIR}/nc_tmp &
6+NC_PID=$!
7+
8+#Add Service
9+$L7VSD
10+if [ $? -ne 0 ]
11+then
12+ echo "Test failed: $L7VSD"
13+ exit 1
14+fi
15+
16+usleep 100000
17+$L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for
18+if [ $? -ne 0 ]
19+then
20+ echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for"
21+ exit 1
22+fi
23+
24+$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876
25+if [ $? -ne 0 ]
26+then
27+ echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876"
28+ exit 1
29+fi
30+
31+#Connect
32+
33+./materials/sessionless-12.pl
34+wait $NC_PID
35+
36+echo -e -n "POST / HTTP/1.0\r
37+Content-length: 10\r
38+X-Forwarded-For: proxy1,proxy2, 127.0.0.1\r
39+\r
40+0123456789" > $TMP_DIR/expect_tmp
41+
42+if [ -n "`diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp`" ]
43+then
44+ echo "Test failed: diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp"
45+ exit 1
46+fi
47+
48+exit 0
49+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/sessionless-14.sh
@@ -0,0 +1,50 @@
1+#!/bin/bash
2+
3+. ${SET_DEFAULT_CONF}
4+
5+nc -i 1 -l 9876 > ${TMP_DIR}/nc_tmp &
6+NC_PID=$!
7+
8+#Add Service
9+$L7VSD
10+if [ $? -ne 0 ]
11+then
12+ echo "Test failed: $L7VSD"
13+ exit 1
14+fi
15+
16+usleep 100000
17+$L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for
18+if [ $? -ne 0 ]
19+then
20+ echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for"
21+ exit 1
22+fi
23+
24+$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876
25+if [ $? -ne 0 ]
26+then
27+ echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876"
28+ exit 1
29+fi
30+
31+#Connect
32+
33+./materials/sessionless-14.pl
34+wait $NC_PID
35+
36+echo -e -n "POST / HTTP/1.1\r
37+Host: 127.0.0.1\r
38+Content-length: 10\r
39+X-Forwarded-For: proxy1,proxy2, 127.0.0.1\r
40+\r
41+0123456789" > $TMP_DIR/expect_tmp
42+
43+if [ -n "`diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp`" ]
44+then
45+ echo "Test failed: diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp"
46+ exit 1
47+fi
48+
49+exit 0
50+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/sessionless-15.sh
@@ -0,0 +1,46 @@
1+#!/bin/bash
2+
3+. ${SET_DEFAULT_CONF}
4+
5+nc -i 1 -l 9876 > ${TMP_DIR}/nc_tmp &
6+NC_PID=$!
7+
8+#Add Service
9+$L7VSD
10+if [ $? -ne 0 ]
11+then
12+ echo "Test failed: $L7VSD"
13+ exit 1
14+fi
15+
16+usleep 100000
17+$L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for
18+if [ $? -ne 0 ]
19+then
20+ echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for"
21+ exit 1
22+fi
23+
24+$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876
25+if [ $? -ne 0 ]
26+then
27+ echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876"
28+ exit 1
29+fi
30+
31+#Connect
32+
33+./materials/sessionless-15.pl
34+wait $NC_PID
35+
36+echo -e -n "GET / HTTP/1.0\r
37+X-Forwarded-For: proxy1,proxy2, 127.0.0.1\r\n\r\n" > $TMP_DIR/expect_tmp
38+
39+if [ -n "`diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp`" ]
40+then
41+ echo "Test failed: diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp"
42+ exit 1
43+fi
44+
45+exit 0
46+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/sessionless-2.sh
@@ -0,0 +1,40 @@
1+#!/bin/bash
2+
3+. ${SET_DEFAULT_CONF}
4+
5+chkconfig daytime-stream on
6+
7+#Add Service
8+$L7VSD
9+if [ $? -ne 0 ]
10+then
11+ echo "Test failed: $L7VSD"
12+ exit 1
13+fi
14+
15+usleep 100000
16+$L7VSADM -A -t 127.0.0.1:40001 -m sessionless
17+if [ $? -ne 0 ]
18+then
19+ echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless"
20+ exit 1
21+fi
22+
23+$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:13
24+if [ $? -ne 0 ]
25+then
26+ echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:13"
27+ exit 1
28+fi
29+
30+#Connect
31+
32+RET=`nc 127.0.0.1 40001`
33+if [ -z "$RET" ]
34+then
35+ echo "Test failed: nc 127.0.0.1 40001"
36+ exit 1
37+fi
38+
39+exit 0
40+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/sessionless-6.sh
@@ -0,0 +1,49 @@
1+#!/bin/bash
2+
3+. ${SET_DEFAULT_CONF}
4+
5+nc -i 1 -l 9876 > ${TMP_DIR}/nc_tmp &
6+NC_PID=$!
7+
8+#Add Service
9+$L7VSD
10+if [ $? -ne 0 ]
11+then
12+ echo "Test failed: $L7VSD"
13+ exit 1
14+fi
15+
16+usleep 100000
17+$L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for
18+if [ $? -ne 0 ]
19+then
20+ echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for"
21+ exit 1
22+fi
23+
24+$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876
25+if [ $? -ne 0 ]
26+then
27+ echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876"
28+ exit 1
29+fi
30+
31+#Connect
32+
33+./materials/sessionless-6.pl
34+wait $NC_PID
35+
36+echo -e -n "POST / HTTP/1.0\r
37+X-Forwarded-For: 127.0.0.1\r
38+Content-length: 10\r
39+\r
40+0123456789" > $TMP_DIR/expect_tmp
41+
42+if [ -n "`diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp`" ]
43+then
44+ echo "Test failed: diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp"
45+ exit 1
46+fi
47+
48+exit 0
49+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/sessionless-8.sh
@@ -0,0 +1,50 @@
1+#!/bin/bash
2+
3+. ${SET_DEFAULT_CONF}
4+
5+nc -i 1 -l 9876 > ${TMP_DIR}/nc_tmp &
6+NC_PID=$!
7+
8+#Add Service
9+$L7VSD
10+if [ $? -ne 0 ]
11+then
12+ echo "Test failed: $L7VSD"
13+ exit 1
14+fi
15+
16+usleep 100000
17+$L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for
18+if [ $? -ne 0 ]
19+then
20+ echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for"
21+ exit 1
22+fi
23+
24+$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876
25+if [ $? -ne 0 ]
26+then
27+ echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876"
28+ exit 1
29+fi
30+
31+#Connect
32+
33+./materials/sessionless-8.pl
34+wait $NC_PID
35+
36+echo -e -n "POST / HTTP/1.1\r
37+X-Forwarded-For: 127.0.0.1\r
38+Host: 127.0.0.1\r
39+Content-length: 10\r
40+\r
41+0123456789" > $TMP_DIR/expect_tmp
42+
43+if [ -n "`diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp`" ]
44+then
45+ echo "Test failed: diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp"
46+ exit 1
47+fi
48+
49+exit 0
50+
--- /dev/null
+++ b/test/script/module-protocol-sessionless/sessionless-9.sh
@@ -0,0 +1,47 @@
1+#!/bin/bash
2+
3+. ${SET_DEFAULT_CONF}
4+
5+nc -i 1 -l 9876 > ${TMP_DIR}/nc_tmp &
6+NC_PID=$!
7+
8+#Add Service
9+$L7VSD
10+if [ $? -ne 0 ]
11+then
12+ echo "Test failed: $L7VSD"
13+ exit 1
14+fi
15+
16+usleep 100000
17+$L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for
18+if [ $? -ne 0 ]
19+then
20+ echo "Test failed: $L7VSADM -A -t 127.0.0.1:40001 -m sessionless --forwarded-for"
21+ exit 1
22+fi
23+
24+$L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876
25+if [ $? -ne 0 ]
26+then
27+ echo "Test failed: $L7VSADM -a -t 127.0.0.1:40001 -m sessionless -r 127.0.0.1:9876"
28+ exit 1
29+fi
30+
31+#Connect
32+
33+./materials/sessionless-9.pl
34+wait $NC_PID
35+
36+echo -e -n "GET / HTTP/1.0\r
37+X-Forwarded-For: 127.0.0.1\r
38+\r\n" > $TMP_DIR/expect_tmp
39+
40+if [ -n "`diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp`" ]
41+then
42+ echo "Test failed: diff $TMP_DIR/nc_tmp $TMP_DIR/expect_tmp"
43+ exit 1
44+fi
45+
46+exit 0
47+