test428 1.4 KB

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