xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP GET |
| 6 | </keywords> |
| 7 | </info> |
| 8 | |
| 9 | # |
| 10 | # Server-side |
| 11 | <reply> |
| 12 | <data nocheck="yes"> |
| 13 | HTTP/1.1 200 OK
|
| 14 | Content-Length: 0
|
| 15 |
|
| 16 | </data> |
| 17 | </reply> |
| 18 | |
| 19 | # |
| 20 | # Client-side |
| 21 | <client> |
| 22 | <server> |
| 23 | http |
| 24 | </server> |
| 25 | <name> |
| 26 | verify -w local/remote port+ip after connection re-use |
| 27 | </name> |
| 28 | <command> |
| 29 | http://%HOSTIP:%HTTPPORT/%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w 'local port == %{local_port}\nlocal ip == %{local_ip}\nremote_ip == %{remote_ip}\nremote_port == %{remote_port}\n' |
| 30 | </command> |
| 31 | </client> |
| 32 | |
| 33 | # |
| 34 | # Verify data after the test has been "shot" |
| 35 | <verify> |
| 36 | <protocol> |
| 37 | GET /%TESTNUMBER HTTP/1.1
|
| 38 | Host: %HOSTIP:%HTTPPORT
|
| 39 | User-Agent: curl/%VERSION
|
| 40 | Accept: */*
|
| 41 |
|
| 42 | GET /%TESTNUMBER HTTP/1.1
|
| 43 | Host: %HOSTIP:%HTTPPORT
|
| 44 | User-Agent: curl/%VERSION
|
| 45 | Accept: */*
|
| 46 |
|
| 47 | </protocol> |
| 48 | |
| 49 | # replace the number with a fixed string since the port number is not |
| 50 | # known to the test script but it should always be a decimal number |
| 51 | <stripfile> |
| 52 | s/local port == (\d+)/local port == [digits]/ |
| 53 | </stripfile> |
| 54 | <stdout> |
| 55 | HTTP/1.1 200 OK
|
| 56 | Content-Length: 0
|
| 57 |
|
| 58 | local port == [digits] |
| 59 | local ip == 127.0.0.1 |
| 60 | remote_ip == %HOSTIP |
| 61 | remote_port == %HTTPPORT |
| 62 | HTTP/1.1 200 OK
|
| 63 | Content-Length: 0
|
| 64 |
|
| 65 | local port == [digits] |
| 66 | local ip == 127.0.0.1 |
| 67 | remote_ip == %HOSTIP |
| 68 | remote_port == %HTTPPORT |
| 69 | </stdout> |
| 70 | </verify> |
| 71 | </testcase> |