test435 1.3 KB

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