tests/test-wireproto-command-heads.t
changeset 40048 a732d70253b0
parent 40034 393e44324037
equal deleted inserted replaced
40047:8e398628a3f2 40048:a732d70253b0
    33   $ sendhttpv2peer << EOF
    33   $ sendhttpv2peer << EOF
    34   > command heads
    34   > command heads
    35   > EOF
    35   > EOF
    36   creating http peer for wire protocol version 2
    36   creating http peer for wire protocol version 2
    37   sending heads command
    37   sending heads command
    38   s>     POST /api/exp-http-v2-0002/ro/heads HTTP/1.1\r\n
       
    39   s>     Accept-Encoding: identity\r\n
       
    40   s>     accept: application/mercurial-exp-framing-0005\r\n
       
    41   s>     content-type: application/mercurial-exp-framing-0005\r\n
       
    42   s>     content-length: 20\r\n
       
    43   s>     host: $LOCALIP:$HGPORT\r\n (glob)
       
    44   s>     user-agent: Mercurial debugwireproto\r\n
       
    45   s>     \r\n
       
    46   s>     \x0c\x00\x00\x01\x00\x01\x01\x11\xa1DnameEheads
       
    47   s> makefile('rb', None)
       
    48   s>     HTTP/1.1 200 OK\r\n
       
    49   s>     Server: testing stub value\r\n
       
    50   s>     Date: $HTTP_DATE$\r\n
       
    51   s>     Content-Type: application/mercurial-exp-framing-0005\r\n
       
    52   s>     Transfer-Encoding: chunked\r\n
       
    53   s>     \r\n
       
    54   s>     13\r\n
       
    55   s>     \x0b\x00\x00\x01\x00\x02\x011
       
    56   s>     \xa1FstatusBok
       
    57   s>     \r\n
       
    58   received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
       
    59   s>     48\r\n
       
    60   s>     @\x00\x00\x01\x00\x02\x001
       
    61   s>     \x83T\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0bT\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^T)Dm-\xc5A\x9c_\x97Dz\x8b\xc0b\xe4\xcc2\x8b\xf2A
       
    62   s>     \r\n
       
    63   received frame(size=64; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
       
    64   s>     8\r\n
       
    65   s>     \x00\x00\x00\x01\x00\x02\x002
       
    66   s>     \r\n
       
    67   s>     0\r\n
       
    68   s>     \r\n
       
    69   received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
       
    70   response: [
    38   response: [
    71     b'\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0b',
    39     b'\x1dok\x91\xd4J\xab\xa6\xd5\xe5\x80\xbc0\xa9\x94\x850\xdb\xe0\x0b',
    72     b'\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^',
    40     b'\xaeI.6\xb0\xc83\x9f\xfa\xf3(\xd0\x0b\x85\xb4R]\xe1\x16^',
    73     b')Dm-\xc5A\x9c_\x97Dz\x8b\xc0b\xe4\xcc2\x8b\xf2A'
    41     b')Dm-\xc5A\x9c_\x97Dz\x8b\xc0b\xe4\xcc2\x8b\xf2A'
    74   ]
    42   ]
    75   (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
       
    76 
    43 
    77 Requesting just the public heads works
    44 Requesting just the public heads works
    78 
    45 
    79   $ sendhttpv2peer << EOF
    46   $ sendhttpv2peer << EOF
    80   > command heads
    47   > command heads
    81   >     publiconly 1
    48   >     publiconly 1
    82   > EOF
    49   > EOF
    83   creating http peer for wire protocol version 2
    50   creating http peer for wire protocol version 2
    84   sending heads command
    51   sending heads command
    85   s>     POST /api/exp-http-v2-0002/ro/heads HTTP/1.1\r\n
       
    86   s>     Accept-Encoding: identity\r\n
       
    87   s>     accept: application/mercurial-exp-framing-0005\r\n
       
    88   s>     content-type: application/mercurial-exp-framing-0005\r\n
       
    89   s>     content-length: 39\r\n
       
    90   s>     host: $LOCALIP:$HGPORT\r\n (glob)
       
    91   s>     user-agent: Mercurial debugwireproto\r\n
       
    92   s>     \r\n
       
    93   s>     \x1f\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa1JpubliconlyA1DnameEheads
       
    94   s> makefile('rb', None)
       
    95   s>     HTTP/1.1 200 OK\r\n
       
    96   s>     Server: testing stub value\r\n
       
    97   s>     Date: $HTTP_DATE$\r\n
       
    98   s>     Content-Type: application/mercurial-exp-framing-0005\r\n
       
    99   s>     Transfer-Encoding: chunked\r\n
       
   100   s>     \r\n
       
   101   s>     13\r\n
       
   102   s>     \x0b\x00\x00\x01\x00\x02\x011
       
   103   s>     \xa1FstatusBok
       
   104   s>     \r\n
       
   105   received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
       
   106   s>     1e\r\n
       
   107   s>     \x16\x00\x00\x01\x00\x02\x001
       
   108   s>     \x81Tx\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc
       
   109   s>     \r\n
       
   110   received frame(size=22; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
       
   111   s>     8\r\n
       
   112   s>     \x00\x00\x00\x01\x00\x02\x002
       
   113   s>     \r\n
       
   114   s>     0\r\n
       
   115   s>     \r\n
       
   116   received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
       
   117   response: [
    52   response: [
   118     b'x\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc'
    53     b'x\xd2\xdc\xa46\xb2\xf5\xb1\x88\xac&~)\xb8\x1e\x07&m8\xfc'
   119   ]
    54   ]
   120   (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob)
       
   121 
    55 
   122   $ cat error.log
    56   $ cat error.log