test1683 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. --no-clobber
  7. </keywords>
  8. </info>
  9. #
  10. # Server-side
  11. <reply>
  12. <data nocheck="yes">
  13. HTTP/1.0 200 OK
  14. Connection: close
  15. Content-Type: text/plain
  16. Content-Length: 4
  17. foo
  18. </data>
  19. </reply>
  20. #
  21. # Client-side
  22. <client>
  23. <name>
  24. HTTP GET without clobber when 100 files already exist
  25. </name>
  26. <server>
  27. http
  28. </server>
  29. <features>
  30. http
  31. </features>
  32. <command option="no-output">
  33. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -o log/exist%TESTNUMBER --no-clobber
  34. </command>
  35. <file name="log/exist%TESTNUMBER">
  36. to stay the same
  37. </file>
  38. <precheck>
  39. perl -e 'for my $i ((1..100)) { my $filename = "log/exist%TESTNUMBER.$i"; open(FH, ">", $filename) or die $!; print FH "to stay the same" ; close(FH) }'
  40. # python3 -c 'for i in range(1, 101): open("log/exist%TESTNUMBER.{}".format(i), mode="w").write("to stay the same")'
  41. </precheck>
  42. <postcheck>
  43. perl -e 'for my $i ((1..100)) { my $filename = "log/exist%TESTNUMBER.$i"; open(FH, "<", $filename) or die $!; (<FH> eq "to stay the same" and <FH> eq "") or die "incorrect $filename" ; close(FH) }'
  44. # python3 -c 'for i in range(1, 101): assert open("log/exist%TESTNUMBER.{}".format(i), mode="r").read(17) == "to stay the same"'
  45. </postcheck>
  46. </client>
  47. #
  48. # Verify data after the test has been "shot"
  49. <verify>
  50. <errorcode>
  51. 23
  52. </errorcode>
  53. <file name="log/exist%TESTNUMBER">
  54. to stay the same
  55. </file>
  56. </verify>
  57. </testcase>