tests/test-wireproto-command-capabilities.t
changeset 37645 72b0982cd509
parent 37557 734515aca84d
child 37653 b2fa1591fb44
equal deleted inserted replaced
37644:77c9ee77687c 37645:72b0982cd509
   188   s> makefile('rb', None)
   188   s> makefile('rb', None)
   189   s>     HTTP/1.1 200 OK\r\n
   189   s>     HTTP/1.1 200 OK\r\n
   190   s>     Server: testing stub value\r\n
   190   s>     Server: testing stub value\r\n
   191   s>     Date: $HTTP_DATE$\r\n
   191   s>     Date: $HTTP_DATE$\r\n
   192   s>     Content-Type: application/mercurial-cbor\r\n
   192   s>     Content-Type: application/mercurial-cbor\r\n
   193   s>     Content-Length: 879\r\n
   193   s>     Content-Length: *\r\n (glob)
   194   s>     \r\n
   194   s>     \r\n
   195   s>     \xa3Dapis\xa1Pexp-http-v2-0001\xa2Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibGapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
   195   s>     \xa3Dapis\xa1Pexp-http-v2-0001\xa2Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibGapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
   196   cbor> {b'apibase': b'api/', b'apis': {b'exp-http-v2-0001': {b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}]}}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'}
   196   cbor> {b'apibase': b'api/', b'apis': {b'exp-http-v2-0001': {b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}]}}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'}
   197 
   197 
   198 capabilities command returns expected info
   198 capabilities command returns expected info
   199 
   199 
   200   $ sendhttpv2peer << EOF
   200   $ sendhttpv2peer << EOF
   201   > command capabilities
   201   > command capabilities
   202   > EOF
   202   > EOF
   203   creating http peer for wire protocol version 2
   203   creating http peer for wire protocol version 2
       
   204   s>     *\r\n (glob)
       
   205   s>     Accept-Encoding: identity\r\n
       
   206   s>     vary: X-HgProto-1,X-HgUpgrade-1\r\n
       
   207   s>     x-hgproto-1: cbor\r\n
       
   208   s>     x-hgupgrade-1: exp-http-v2-0001\r\n
       
   209   s>     accept: application/mercurial-0.1\r\n
       
   210   s>     host: $LOCALIP:$HGPORT\r\n (glob)
       
   211   s>     user-agent: Mercurial debugwireproto\r\n
       
   212   s>     \r\n
       
   213   s> makefile('rb', None)
       
   214   s>     HTTP/1.1 200 OK\r\n
       
   215   s>     Server: testing stub value\r\n
       
   216   s>     Date: $HTTP_DATE$\r\n
       
   217   s>     Content-Type: application/mercurial-cbor\r\n
       
   218   s>     Content-Length: *\r\n (glob)
       
   219   s>     \r\n
       
   220   s>     \xa3Dapis\xa1Pexp-http-v2-0001\xa2Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibGapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
   204   sending capabilities command
   221   sending capabilities command
   205   s>     POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n
   222   s>     POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n
   206   s>     Accept-Encoding: identity\r\n
   223   s>     Accept-Encoding: identity\r\n
   207   s>     accept: application/mercurial-exp-framing-0003\r\n
   224   s>     accept: application/mercurial-exp-framing-0003\r\n
   208   s>     content-type: application/mercurial-exp-framing-0003\r\n
   225   s>     content-type: application/mercurial-exp-framing-0003\r\n