curl/tests/data/test173
Viktor Szakats 68c358619f
tests: replace hard-coded /dev/null with variable
- add variable for the null device filename and use that in Perl code.
- initialize this variable with `NUL` on native Windows.
- add `%DEV_NULL` variable and use it in tests.

Fixes `The system cannot find the path specified.` messages seen when
running `runtests.pl` with native Windows Perl.

Also adjust code to not break mcedit syntax highlighting.

Cherry-picked from #14949
Closes #15098
2024-10-01 12:07:19 +02:00

83 lines
1.3 KiB
Plaintext

<testcase>
<info>
<keywords>
HTTP
HTTP POST
</keywords>
</info>
# Server-side
<reply>
<data>
HTTP/1.1 200 OK swsclose
Date: Tue, 09 Nov 2010 14:49:00 GMT
Server: test-server/fake
Content-Length: 11
blablabla
</data>
</reply>
# Client-side
<client>
<features>
Mime
</features>
<server>
http
</server>
<name>
HTTP RFC1867-formpost a file from stdin with "faked" filename
</name>
<command>
http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F field1=contents1 -F "fileupload=@-;filename=%DEV_NULL;type=text/x-null;format=x-curl"
</command>
<stdin>
line1
line2
line3
line4
line5
line6
line7
line8
</stdin>
</client>
# Verify data after the test has been "shot"
<verify>
<strip>
^(Content-Type: multipart/form-data;|------------).*
</strip>
<protocol>
POST /we/want/%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
Content-Length: 378
Content-Type: multipart/form-data; boundary=----------------------------5dbea401cd8c
------------------------------5dbea401cd8c
Content-Disposition: form-data; name="field1"
contents1
------------------------------5dbea401cd8c
Content-Disposition: form-data; name="fileupload"; filename="%DEV_NULL"
Content-Type: text/x-null;format=x-curl
line1
line2
line3
line4
line5
line6
line7
line8
------------------------------5dbea401cd8c--
</protocol>
</verify>
</testcase>