113498266Sopenharmony_ci<testcase>
213498266Sopenharmony_ci<info>
313498266Sopenharmony_ci<keywords>
413498266Sopenharmony_ciHTTP
513498266Sopenharmony_ciHTTP GET
613498266Sopenharmony_ciHTTP Basic auth
713498266Sopenharmony_ci</keywords>
813498266Sopenharmony_ci</info>
913498266Sopenharmony_ci# Server-side
1013498266Sopenharmony_ci<reply>
1113498266Sopenharmony_ci
1213498266Sopenharmony_ci<!-- First request has Basic auth, wrong password -->
1313498266Sopenharmony_ci<data100>
1413498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password
1513498266Sopenharmony_ciServer: Microsoft-IIS/5.0
1613498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
1713498266Sopenharmony_ciContent-Length: 29
1813498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
1913498266Sopenharmony_ci
2013498266Sopenharmony_ciThis is a bad password page!
2113498266Sopenharmony_ci</data100>
2213498266Sopenharmony_ci
2313498266Sopenharmony_ci<!-- Second request has Basic auth, right password -->
2413498266Sopenharmony_ci<data200>
2513498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land
2613498266Sopenharmony_ciServer: Microsoft-IIS/5.0
2713498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
2813498266Sopenharmony_ciContent-Length: 32
2913498266Sopenharmony_ci
3013498266Sopenharmony_ciFinally, this is the real page!
3113498266Sopenharmony_ci</data200>
3213498266Sopenharmony_ci
3313498266Sopenharmony_ci<!-- Third request has Basic auth, wrong password -->
3413498266Sopenharmony_ci<data300>
3513498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (2)
3613498266Sopenharmony_ciServer: Microsoft-IIS/5.0
3713498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
3813498266Sopenharmony_ciContent-Length: 29
3913498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
4013498266Sopenharmony_ci
4113498266Sopenharmony_ciThis is a bad password page!
4213498266Sopenharmony_ci</data300>
4313498266Sopenharmony_ci
4413498266Sopenharmony_ci<!-- Fourth request has Basic auth, wrong password -->
4513498266Sopenharmony_ci<data400>
4613498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (3)
4713498266Sopenharmony_ciServer: Microsoft-IIS/5.0
4813498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
4913498266Sopenharmony_ciContent-Length: 29
5013498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
5113498266Sopenharmony_ci
5213498266Sopenharmony_ciThis is a bad password page!
5313498266Sopenharmony_ci</data400>
5413498266Sopenharmony_ci
5513498266Sopenharmony_ci<!-- Fifth request has Basic auth, right password -->
5613498266Sopenharmony_ci<data500>
5713498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land (2)
5813498266Sopenharmony_ciServer: Microsoft-IIS/5.0
5913498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
6013498266Sopenharmony_ciContent-Length: 32
6113498266Sopenharmony_ci
6213498266Sopenharmony_ciFinally, this is the real page!
6313498266Sopenharmony_ci</data500>
6413498266Sopenharmony_ci
6513498266Sopenharmony_ci<datacheck>
6613498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password
6713498266Sopenharmony_ciServer: Microsoft-IIS/5.0
6813498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
6913498266Sopenharmony_ciContent-Length: 29
7013498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
7113498266Sopenharmony_ci
7213498266Sopenharmony_ciThis is a bad password page!
7313498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land
7413498266Sopenharmony_ciServer: Microsoft-IIS/5.0
7513498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
7613498266Sopenharmony_ciContent-Length: 32
7713498266Sopenharmony_ci
7813498266Sopenharmony_ciFinally, this is the real page!
7913498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (2)
8013498266Sopenharmony_ciServer: Microsoft-IIS/5.0
8113498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
8213498266Sopenharmony_ciContent-Length: 29
8313498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
8413498266Sopenharmony_ci
8513498266Sopenharmony_ciThis is a bad password page!
8613498266Sopenharmony_ciHTTP/1.1 401 Sorry wrong password (3)
8713498266Sopenharmony_ciServer: Microsoft-IIS/5.0
8813498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
8913498266Sopenharmony_ciContent-Length: 29
9013498266Sopenharmony_ciWWW-Authenticate: Basic realm="testrealm"
9113498266Sopenharmony_ci
9213498266Sopenharmony_ciThis is a bad password page!
9313498266Sopenharmony_ciHTTP/1.1 200 Things are fine in server land (2)
9413498266Sopenharmony_ciServer: Microsoft-IIS/5.0
9513498266Sopenharmony_ciContent-Type: text/html; charset=iso-8859-1
9613498266Sopenharmony_ciContent-Length: 32
9713498266Sopenharmony_ci
9813498266Sopenharmony_ciFinally, this is the real page!
9913498266Sopenharmony_ci</datacheck>
10013498266Sopenharmony_ci
10113498266Sopenharmony_ci</reply>
10213498266Sopenharmony_ci
10313498266Sopenharmony_ci# Client-side
10413498266Sopenharmony_ci<client>
10513498266Sopenharmony_ci<server>
10613498266Sopenharmony_cihttp
10713498266Sopenharmony_ci</server>
10813498266Sopenharmony_ci<tool>
10913498266Sopenharmony_cilibauthretry
11013498266Sopenharmony_ci</tool>
11113498266Sopenharmony_ci
11213498266Sopenharmony_ci<name>
11313498266Sopenharmony_ciHTTP authorization retry (Basic)
11413498266Sopenharmony_ci</name>
11513498266Sopenharmony_ci <setenv>
11613498266Sopenharmony_ci# we force our own host name, in order to make the test machine independent
11713498266Sopenharmony_ciCURL_GETHOSTNAME=curlhost
11813498266Sopenharmony_ci# we try to use the LD_PRELOAD hack, if not a debug build
11913498266Sopenharmony_ciLD_PRELOAD=%PWD/libtest/.libs/libhostname.so
12013498266Sopenharmony_ci </setenv>
12113498266Sopenharmony_ci<command>
12213498266Sopenharmony_cihttp://%HOSTIP:%HTTPPORT/%TESTNUMBER basic basic
12313498266Sopenharmony_ci</command>
12413498266Sopenharmony_ci<precheck>
12513498266Sopenharmony_cichkhostname curlhost
12613498266Sopenharmony_ci</precheck>
12713498266Sopenharmony_ci</client>
12813498266Sopenharmony_ci
12913498266Sopenharmony_ci# Verify data after the test has been "shot"
13013498266Sopenharmony_ci<verify>
13113498266Sopenharmony_ci<protocol>
13213498266Sopenharmony_ciGET /%TESTNUMBER0100 HTTP/1.1
13313498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
13413498266Sopenharmony_ciAuthorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
13513498266Sopenharmony_ciAccept: */*
13613498266Sopenharmony_ci
13713498266Sopenharmony_ciGET /%TESTNUMBER0200 HTTP/1.1
13813498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
13913498266Sopenharmony_ciAuthorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
14013498266Sopenharmony_ciAccept: */*
14113498266Sopenharmony_ci
14213498266Sopenharmony_ciGET /%TESTNUMBER0300 HTTP/1.1
14313498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
14413498266Sopenharmony_ciAuthorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
14513498266Sopenharmony_ciAccept: */*
14613498266Sopenharmony_ci
14713498266Sopenharmony_ciGET /%TESTNUMBER0400 HTTP/1.1
14813498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
14913498266Sopenharmony_ciAuthorization: Basic dGVzdHVzZXI6d3JvbmdwYXNz
15013498266Sopenharmony_ciAccept: */*
15113498266Sopenharmony_ci
15213498266Sopenharmony_ciGET /%TESTNUMBER0500 HTTP/1.1
15313498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
15413498266Sopenharmony_ciAuthorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
15513498266Sopenharmony_ciAccept: */*
15613498266Sopenharmony_ci
15713498266Sopenharmony_ci</protocol>
15813498266Sopenharmony_ci</verify>
15913498266Sopenharmony_ci</testcase>
160