test428 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. variables
  6. </keywords>
  7. </info>
  8. #
  9. # Server-side
  10. <reply>
  11. <data crlf="yes">
  12. HTTP/1.1 200 OK
  13. Date: Tue, 09 Nov 2010 14:49:00 GMT
  14. Server: test-server/fake
  15. Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
  16. ETag: "21025-dc7-39462498"
  17. Accept-Ranges: bytes
  18. Content-Length: 6
  19. Connection: close
  20. Content-Type: text/html
  21. Funny-head: yesyes
  22. -foo-
  23. </data>
  24. </reply>
  25. #
  26. # Client-side
  27. <client>
  28. <server>
  29. http
  30. </server>
  31. <setenv>
  32. FUNVALUE=contents
  33. VALUE2=curl
  34. BLANK=
  35. </setenv>
  36. <name>
  37. Expand environment variables within config file
  38. </name>
  39. <file name="%LOGDIR/cmd">
  40. --variable %FUNVALUE
  41. --variable %VALUE2
  42. --variable %BLANK
  43. --variable %curl_NOT_SET=default
  44. --expand-data 1{{FUNVALUE}}2{{VALUE2}}3{{curl_NOT_SET}}4{{BLANK}}5\{{verbatim}}6{{not.good}}7{{}}
  45. </file>
  46. <command>
  47. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -K %LOGDIR/cmd
  48. </command>
  49. </client>
  50. #
  51. # Verify data after the test has been "shot"
  52. <verify>
  53. <protocol crlf="yes" nonewline="yes">
  54. POST /%TESTNUMBER HTTP/1.1
  55. Host: %HOSTIP:%HTTPPORT
  56. User-Agent: curl/%VERSION
  57. Accept: */*
  58. Content-Length: 54
  59. Content-Type: application/x-www-form-urlencoded
  60. 1contents2curl3default45{{verbatim}}6{{not.good}}7{{}}
  61. </protocol>
  62. </verify>
  63. </testcase>