test451 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. <name>
  32. Variable from file that is JSON and URL encoded (with null byte)
  33. </name>
  34. <file name="%LOGDIR/junk">
  35. %hex[%01%02%03%00%04%05%06]hex%
  36. </file>
  37. <command>
  38. http://%HOSTIP:%HTTPPORT/%TESTNUMBER --variable what@%LOGDIR/junk --variable second=hello --variable second=again --expand-data "--{{what:trim:json}}22{{none}}--{{second}}{{what:trim:url}}"
  39. </command>
  40. </client>
  41. #
  42. # Verify data after the test has been "shot"
  43. <verify>
  44. <protocol crlf="yes" nonewline="yes">
  45. POST /%TESTNUMBER HTTP/1.1
  46. Host: %HOSTIP:%HTTPPORT
  47. User-Agent: curl/%VERSION
  48. Accept: */*
  49. Content-Length: 74
  50. Content-Type: application/x-www-form-urlencoded
  51. --\u0001\u0002\u0003\u0000\u0004\u0005\u000622--again%01%02%03%00%04%05%06
  52. </protocol>
  53. </verify>
  54. </testcase>