1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
HTTP
HTTP GET
Content-Range
Resume
retry
</keywords>
</info>
# Server-side
<reply>
# the first chunk
<data crlf="headers" nocheck="yes" nonewline="yes">
HTTP/1.1 200 OK swsbounce swsclose
Accept-Ranges: bytes
Content-Type: text/html
Content-Length: 26
abcde
</data>
# the second chunk
<data1 crlf="headers" nocheck="yes" nonewline="yes">
HTTP/1.1 206 Partial Content swsbounce swsclose
Content-Type: text/html
Content-Length: 21
Content-Range: bytes 5-25/26
fghijk
</data1>
# some nonsense that curl should ignore as unresumable
<data2 crlf="headers" nocheck="yes">
HTTP/1.1 404 Not Found swsbounce
Content-Type: text/html
Content-Length: 5
body
</data2>
# some more nonsense that curl should ignore as unresumable
<data3 crlf="headers" nocheck="yes">
HTTP/1.1 200 OK swsbounce
Accept-Ranges: bytes
Content-Type: text/html
Content-Length: 30
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
</data3>
# the third chunk
<data4 nocheck="yes" nonewline="yes">
HTTP/1.1 206 Partial Content swsbounce swsclose
Content-Type: text/html
Content-Length: 15
Content-Range: bytes 11-25/26
lmnopqrstuvwxyz
</data4>
</reply>
# Client-side
<client>
<server>
http
</server>
<name>
HTTP retry failed download with keep data and auto-resume
</name>
<command option="no-output,no-include">
--continue-at - --retry 4 --retry-delay 1 --retry-all-errors -o %LOGDIR/outfile%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Range: bytes=5-
User-Agent: curl/%VERSION
Accept: */*
GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Range: bytes=11-
User-Agent: curl/%VERSION
Accept: */*
GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Range: bytes=11-
User-Agent: curl/%VERSION
Accept: */*
GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Range: bytes=11-
User-Agent: curl/%VERSION
Accept: */*
</protocol>
<file1 name="%LOGDIR/outfile%TESTNUMBER" nonewline="yes">
abcdefghijklmnopqrstuvwxyz
</file1>
</verify>
</testcase>
|