this is an HTTP test, then the connection is closed by the server after this
response is sent. If not, the connection is kept persistent.
-If the data contains `swsbounce` anywhere within the start and end tag, the
-HTTP server detects if this is a second request using the same test and part
-number and then increases the part number with one. This is useful for auth
-tests and similar.
+If the data contains `swsbounce` anywhere within the start and end tag, then
+the HTTP server overrides the part number response returned for a subsequent
+request made by the same test to `previous part number + 1`. For example, if a
+test makes a request which causes the server to return `<data>` that contains
+keyword `swsbounce` then for the next response it ignores the requested part
+number and instead returns `<data1>`. And if `<data1>` contains keyword
+`swsbounce` then the next response is `<data2>` and so on. This is useful for
+auth tests and similar.
`sendzero=yes` means that the (FTP) server "sends" the data even if the size
is zero bytes. Used to verify curl's behavior on zero bytes transfers.
test3008 test3009 test3010 test3011 test3012 test3013 test3014 test3015 \
test3016 test3017 test3018 test3019 test3020 test3021 test3022 test3023 \
test3024 test3025 test3026 test3027 test3028 test3029 test3030 test3031 \
+test3032 \
\
test3100 test3101 test3102 test3103 test3104 test3105 \
test3200 \
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
# then this is returned when we get proxy-auth
<connect1000>
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
Server: no
\r
</connect1000>
Content-Length: 40000\r
X-tra-long-header: %repeat[16080 x a]%\r
\r
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
Server: no
\r
HTTP/1.1 200 OK
# then this is returned when we get proxy-auth
<connect1000>
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
Server: no
\r
</connect1000>
Transfer-Encoding: chunked\r
X-tra-long-header: %repeat[16080 x a]%\r
\r
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
Server: no
\r
HTTP/1.1 200 OK
# Server-side
<reply>
<data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
</data1000>
<datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
# Server-side
<reply>
<data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
</data1000>
<datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
# Server-side
<reply>
<data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth"\r
Content-Type: text/html; charset=iso-8859-1\r
</data1001>
<datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", qop="auth"\r
Content-Type: text/html; charset=iso-8859-1\r
<reply>
# the first request has NTLM type-1 included, and then the 1001 is returned
<data1001>
-HTTP/1.1 200 beng swsclose swsbounce\r
+HTTP/1.1 200 beng swsclose\r
Server: Microsoft-IIS/6.0\r
Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth\r
Content-Type: text/html; charset=iso-8859-1\r
</data>
<datacheck>
-HTTP/1.1 200 beng swsclose swsbounce\r
+HTTP/1.1 200 beng swsclose\r
Server: Microsoft-IIS/6.0\r
Authentication-Info: Passport1.4 tname=MSPAuth,tname=MSPProf,tname=MSPConsent,tname=MSPSecAuth\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144", userhash=true\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-256", nonce="1053604144", userhash=true\r
Content-Type: text/html; charset=iso-8859-1\r
# then this is returned when we get proxy-auth
<connect1000>
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
Server: no
\r
</connect1000>
Proxy-Authenticate: Digest realm="weirdorealm", nonce="12345"\r
Content-Length: 33\r
\r
-HTTP/1.1 200 OK swsbounce\r
+HTTP/1.1 200 OK\r
Server: no
\r
HTTP/1.1 200 OK
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-512-256", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", algorithm="SHA-512-256", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
# Server-side
<reply>
<data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256"\r
Content-Type: text/html; charset=iso-8859-1\r
</data1000>
<datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256"\r
Content-Type: text/html; charset=iso-8859-1\r
# Server-side
<reply>
<data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-512-256"\r
Content-Type: text/html; charset=iso-8859-1\r
</data1000>
<datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-512-256"\r
Content-Type: text/html; charset=iso-8859-1\r
# Server-side
<reply>
<data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256", userhash=true\r
Content-Type: text/html; charset=iso-8859-1\r
</data1000>
<datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144", algorithm="SHA-256", userhash=true\r
Content-Type: text/html; charset=iso-8859-1\r
# Server-side
<reply>
<data>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
</data1000>
<datacheck>
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
Date: Sun, 03 Apr 2005 14:57:45 GMT\r
X-Powered-By: ASP.NET\r
\r
-HTTP/1.1 401 authentication please swsbounce\r
+HTTP/1.1 401 authentication please\r
Server: Microsoft-IIS/6.0\r
WWW-Authenticate: Digest realm="testrealm", nonce="1053604144"\r
Content-Type: text/html; charset=iso-8859-1\r
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+--location
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+<data>
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data\r
+\r
+</data>
+
+<data1>
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data1\r
+\r
+</data1>
+
+<data2>
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data2\r
+\r
+</data2>
+
+<data3>
+HTTP/1.1 200 OK\r
+Content-Type: text/html\r
+Content-Length: 30\r
+Part: data3\r
+\r
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+</data3>
+
+<datacheck>
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data\r
+\r
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data1\r
+\r
+HTTP/1.1 301 redirect swsbounce\r
+Content-Length: 0\r
+Location: http://%HOSTIP:%HTTPPORT/%TESTNUMBER\r
+Part: data2\r
+\r
+HTTP/1.1 200 OK\r
+Content-Type: text/html\r
+Content-Length: 30\r
+Part: data3\r
+\r
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+</datacheck>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+http
+</server>
+# This is a test of the swsbounce keyword which is used during tests to
+# override the data response number for the next request to the previous
+# data response number + 1. eg data, data1, data2 etc.
+<name>
+HTTP redirect loop 3x swsbounce test
+</name>
+<command>
+--location http://%HOSTIP:%HTTPPORT/%TESTNUMBER
+</command>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+</verify>
+</testcase>
static long prevtestno = -1; /* previous test number we served */
static long prevpartno = -1; /* previous part number we served */
-static bool prevbounce = FALSE; /* instructs the server to increase the part
- number for a test in case the identical
- testno+partno request shows up again */
+static bool prevbounce = FALSE; /* instructs the server to override the
+ requested part number to prevpartno + 1 when
+ prevtestno and current test are the same */
#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
#define RCMD_IDLE 1 /* told to sit idle */
if(prevbounce) {
/* bounce treatment requested */
- if((req.testno == prevtestno) &&
- (req.partno == prevpartno)) {
- req.partno++;
+ if(req.testno == prevtestno) {
+ req.partno = prevpartno + 1;
logmsg("BOUNCE part number to %ld", req.partno);
}
else {
static long prevtestno = -1; /* previous test number we served */
static long prevpartno = -1; /* previous part number we served */
-static bool prevbounce = FALSE; /* instructs the server to increase the part
- number for a test in case the identical
- testno+partno request shows up again */
+static bool prevbounce = FALSE; /* instructs the server to override the
+ requested part number to prevpartno + 1 when
+ prevtestno and current test are the same */
#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
#define RCMD_IDLE 1 /* told to sit idle */
if(prevbounce) {
/* bounce treatment requested */
- if((req->testno == prevtestno) &&
- (req->partno == prevpartno)) {
- req->partno++;
+ if(req->testno == prevtestno) {
+ req->partno = prevpartno + 1;
logmsg("BOUNCE part number to %ld", req->partno);
}
else {