test1028 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. followlocation
  7. FTP
  8. PASV
  9. FILE
  10. </keywords>
  11. </info>
  12. #
  13. # Server-side
  14. <reply>
  15. <data1>
  16. HTTP/1.1 302 OK
  17. Date: Thu, 09 Nov 2010 14:49:00 GMT
  18. Server: test-server/fake swsclose
  19. Content-Type: text/html
  20. Funny-head: yesyes
  21. Location: ftp://127.0.0.1:8992/10280002
  22. Content-Length: 0
  23. Connection: close
  24. </data1>
  25. <data2>
  26. data
  27. to
  28. see
  29. that FTP
  30. works
  31. so does it?
  32. </data2>
  33. </reply>
  34. #
  35. # Client-side
  36. <client>
  37. <server>
  38. http
  39. ftp
  40. </server>
  41. <name>
  42. HTTP Location: redirect to FTP URL
  43. </name>
  44. <command>
  45. http://%HOSTIP:%HTTPPORT/10280001 -L
  46. </command>
  47. # The data section doesn't do variable substitution, so we must assert this
  48. <precheck>
  49. perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );"
  50. </precheck>
  51. </client>
  52. #
  53. # Verify data after the test has been "shot"
  54. <verify>
  55. <strip>
  56. ^User-Agent:.*
  57. </strip>
  58. <protocol>
  59. GET /10280001 HTTP/1.1
  60. Host: %HOSTIP:%HTTPPORT
  61. Accept: */*
  62. USER anonymous
  63. PASS ftp@example.com
  64. PWD
  65. EPSV
  66. TYPE I
  67. SIZE 10280002
  68. RETR 10280002
  69. QUIT
  70. </protocol>
  71. <stdout>
  72. HTTP/1.1 302 OK
  73. Date: Thu, 09 Nov 2010 14:49:00 GMT
  74. Server: test-server/fake swsclose
  75. Content-Type: text/html
  76. Funny-head: yesyes
  77. Location: ftp://%HOSTIP:%FTPPORT/10280002
  78. Content-Length: 0
  79. Connection: close
  80. data
  81. to
  82. see
  83. that FTP
  84. works
  85. so does it?
  86. </stdout>
  87. </verify>
  88. </testcase>