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