File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / curl / tests / data / test2009
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Jun 3 10:01:16 2020 UTC (5 years ago) by misho
Branches: curl, MAIN
CVS tags: v7_70_0p4, HEAD
curl

    1: <testcase>
    2: <info>
    3: <keywords>
    4: Metalink
    5: HTTP
    6: HTTP GET
    7: -J
    8: FILE
    9: </keywords>
   10: </info>
   11: 
   12: #
   13: # Server-side
   14: <reply>
   15: <data nocheck="yes">
   16: HTTP/1.1 200 OK
   17: Date: Thu, 21 Jun 2012 16:27:17 GMT
   18: Server: test-server/fake
   19: Content-Length: 46
   20: Connection: close
   21: Content-Type: text/html
   22: Content-Disposition: filename=name2009; charset=funny; option=strange
   23: Funny-head: yesyes
   24: 
   25: Some contents delivered from an HTTP resource
   26: </data>
   27: </reply>
   28: 
   29: #
   30: # Client-side
   31: <client>
   32: <features>
   33: file
   34: Metalink
   35: </features>
   36: <server>
   37: http
   38: </server>
   39:  <name>
   40: Metalink local XML file, HTTP resource, using -o fname -J -D file
   41:  </name>
   42: <command option="no-output,no-include">
   43: --metalink file://%PWD/log/test2009.metalink -J -o log/outfile2009 -D log/heads2009
   44: </command>
   45: # local metalink file written before test command runs
   46: <file name="log/test2009.metalink">
   47: <?xml version="1.0" encoding="utf-8"?>
   48: <metalink version="3.0" xmlns="http://www.metalinker.org/">
   49:  <files>
   50:   <file name="log/download2009">
   51:    <verification>
   52:     <hash type="md5">we-only-check-the-strongest-hash-provided</hash>
   53:     <hash type="sha256">e4c5b83384ba7d5f8e201d61747a14f29baacd7dfadce0fbd56661db4bba72b2</hash>
   54:    </verification>
   55:    <resources maxconnections="1">
   56:     <url type="http" preference="90">http://%HOSTIP:%HTTPPORT/2009</url>
   57:    </resources>
   58:   </file>
   59:  </files>
   60: </metalink>
   61: </file>
   62: <postcheck>
   63: perl %SRCDIR/libtest/notexists.pl log/2009 log/name2009 log/outfile2009
   64: </postcheck>
   65: </client>
   66: 
   67: #
   68: # Verify data after the test has been "shot"
   69: <verify>
   70: <strip>
   71: ^User-Agent:.*
   72: </strip>
   73: <protocol>
   74: GET /2009 HTTP/1.1
   75: Host: %HOSTIP:%HTTPPORT
   76: Accept: */*
   77: 
   78: </protocol>
   79: <file1 name="log/download2009">
   80: Some contents delivered from an HTTP resource
   81: </file1>
   82: # The Content-Length replace here is to handle with 4/5 digit port number in
   83: # the content
   84: <stripfile2>
   85: s/Last-Modified:.*//
   86: s/Content-Length: 49[67]/Content-Length: yeps/
   87: </stripfile2>
   88: <file2 name="log/heads2009">
   89: Content-Length: yeps
   90: Accept-ranges: bytes
   91: 
   92: 
   93: HTTP/1.1 200 OK
   94: Date: Thu, 21 Jun 2012 16:27:17 GMT
   95: Server: test-server/fake
   96: Content-Length: 46
   97: Connection: close
   98: Content-Type: text/html
   99: Content-Disposition: filename=name2009; charset=funny; option=strange
  100: Funny-head: yesyes
  101: 
  102: </file2>
  103: <file3 name="log/stdout2009">
  104: </file3>
  105: <file4 name="log/stderr2009" mode="text">
  106: Metalink: parsing (file://%PWD/log/test2009.metalink) metalink/XML...
  107: Metalink: parsing (file://%PWD/log/test2009.metalink) OK
  108: Metalink: fetching (log/download2009) from (http://%HOSTIP:%HTTPPORT/2009)...
  109: Metalink: fetching (log/download2009) from (http://%HOSTIP:%HTTPPORT/2009) OK
  110: Metalink: validating (log/download2009)...
  111: Metalink: validating (log/download2009) [sha-256] OK
  112: </file4>
  113: <stripfile4>
  114: $_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
  115: </stripfile4>
  116: </verify>
  117: </testcase>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>