tests/test-ssh-proto.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 05 Feb 2018 09:14:32 -0800
changeset 35938 80a2b8ae42a1
parent 35930 83d67257ba90
child 35940 556218e08e25
permissions -rw-r--r--
sshpeer: move handshake outside of sshpeer With the handshake now performed before a peer class is instantiated, we can now instantiate a different peer class depending on the results of the handshake. Our test extension had to change to cope with the new API. Because we now issue the command via raw I/O calls and don't call _callstream(), we no longer have to register the fake command. (_callstream() uses the command registration to see what args to send). Differential Revision: https://phab.mercurial-scm.org/D2034
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
  > [ui]
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
  > ssh = $PYTHON "$TESTDIR/dummyssh"
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
  > [devel]
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
  > debug.peer-request = true
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
  > [extensions]
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
  > sshprotoext = $TESTDIR/sshprotoext.py
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
  $ hg init server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  $ cd server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
  $ echo 0 > foo
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
  $ hg -q add foo
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
  $ hg commit -m initial
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
  $ cd ..
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
Test a normal behaving server, for sanity
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
  $ hg --debug debugpeer ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
  running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
  devel-peer-request: hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
  sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
  devel-peer-request: between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
  devel-peer-request:   pairs: 81 bytes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
  sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
  remote: 384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
  remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
  remote: 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
  url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
  local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
  pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
Server should answer the "hello" command in isolation
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    34
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
>=0.9.1 clients send a "hello" + "between" for the null range as part of handshake.
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
Server should reply with capabilities and should send "1\n\n" as a successful
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
reply with empty response to the "between".
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    45
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    46
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    48
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    49
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
SSH banner is not printed by default, ignored by clients
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
  $ SSHSERVERMODE=banner hg debugpeer ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
  url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
  local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
  pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    62
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    63
--debug will print the banner
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
  $ SSHSERVERMODE=banner hg --debug debugpeer ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
  running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
  devel-peer-request: hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
  sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
  devel-peer-request: between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
  devel-peer-request:   pairs: 81 bytes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
  sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
  remote: banner: line 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
  remote: banner: line 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
  remote: banner: line 2
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
  remote: banner: line 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
  remote: banner: line 4
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
  remote: banner: line 5
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
  remote: banner: line 6
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
  remote: banner: line 7
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    80
  remote: banner: line 8
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
  remote: banner: line 9
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    82
  remote: 384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    83
  remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    84
  remote: 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    85
  url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    86
  local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    87
  pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    88
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    89
And test the banner with the raw protocol
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    90
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    91
  $ SSHSERVERMODE=banner hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    92
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    93
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    94
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    95
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    96
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    97
  banner: line 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    98
  banner: line 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    99
  banner: line 2
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   100
  banner: line 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   101
  banner: line 4
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   102
  banner: line 5
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   103
  banner: line 6
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   104
  banner: line 7
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   105
  banner: line 8
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   106
  banner: line 9
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   107
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   108
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   109
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   110
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   111
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   112
Connecting to a <0.9.1 server that doesn't support the hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   113
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   114
  $ SSHSERVERMODE=no-hello hg --debug debugpeer ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   115
  running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   116
  devel-peer-request: hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   117
  sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   118
  devel-peer-request: between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   119
  devel-peer-request:   pairs: 81 bytes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   120
  sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   121
  remote: 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   122
  remote: 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   123
  url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   124
  local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   125
  pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   126
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   127
The client should interpret this as no capabilities
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   128
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   129
  $ SSHSERVERMODE=no-hello hg debugcapabilities ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   130
  Main capabilities:
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   131
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   132
Sending an unknown command to the server results in an empty response to that command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   133
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   134
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   135
  > pre-hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   136
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   137
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   138
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   139
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   140
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   141
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   142
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   143
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   144
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   145
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   146
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   147
  $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-no-args --debug debugpeer ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   148
  running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   149
  sending no-args command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   150
  devel-peer-request: hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   151
  sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   152
  devel-peer-request: between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   153
  devel-peer-request:   pairs: 81 bytes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   154
  sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   155
  remote: 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   156
  remote: 384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   157
  remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   158
  remote: 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   159
  url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   160
  local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   161
  pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   162
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   163
Send multiple unknown commands before hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   164
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   165
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   166
  > unknown1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   167
  > unknown2
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   168
  > unknown3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   169
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   170
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   171
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   172
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   173
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   174
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   175
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   176
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   177
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   178
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   179
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   180
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   181
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   182
  $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-multiple-no-args --debug debugpeer ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   183
  running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob)
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   184
  sending unknown1 command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   185
  sending unknown2 command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   186
  sending unknown3 command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   187
  devel-peer-request: hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   188
  sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   189
  devel-peer-request: between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   190
  devel-peer-request:   pairs: 81 bytes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   191
  sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   192
  remote: 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   193
  remote: 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   194
  remote: 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   195
  remote: 384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   196
  remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   197
  remote: 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   198
  url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   199
  local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   200
  pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   201
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   202
Send an unknown command before hello that has arguments
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   203
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   204
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   205
  > with-args
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   206
  > foo 13
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   207
  > value for foo
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   208
  > bar 13
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   209
  > value for bar
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   210
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   211
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   212
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   213
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   214
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   215
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   216
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   217
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   218
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   219
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   220
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   221
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   222
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   223
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   224
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   225
Send an unknown command having an argument that looks numeric
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   226
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   227
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   228
  > unknown
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   229
  > foo 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   230
  > 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   231
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   232
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   233
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   234
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   235
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   236
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   237
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   238
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   239
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   240
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   241
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   242
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   243
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   244
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   245
  > unknown
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   246
  > foo 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   247
  > 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   248
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   249
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   250
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   251
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   252
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   253
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   254
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   255
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   256
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   257
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   258
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   259
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   260
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   261
When sending a dict argument value, it is serialized to
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   262
"<arg> <item count>" followed by "<key> <len>\n<value>" for each item
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   263
in the dict.
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   264
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   265
Dictionary value for unknown command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   266
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   267
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   268
  > unknown
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   269
  > dict 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   270
  > key1 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   271
  > foo
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   272
  > key2 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   273
  > bar
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   274
  > key3 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   275
  > baz
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   276
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   277
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   278
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   279
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   280
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   281
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   282
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   283
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   284
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   285
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   286
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   287
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   288
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   289
Incomplete dictionary send
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   290
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   291
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   292
  > unknown
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   293
  > dict 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   294
  > key1 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   295
  > foo
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   296
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   297
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   298
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   299
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   300
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   301
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   302
Incomplete value send
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   303
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   304
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   305
  > unknown
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   306
  > dict 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   307
  > key1 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   308
  > fo
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   309
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   310
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   311
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   312
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   313
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   314
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   315
Send a command line with spaces
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   316
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   317
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   318
  > unknown withspace
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   319
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   320
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   321
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   322
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   323
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   324
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   325
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   326
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   327
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   328
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   329
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   330
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   331
  > unknown with multiple spaces
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   332
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   333
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   334
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   335
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   336
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   337
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   338
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   339
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   340
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   341
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   342
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   343
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   344
  > unknown with spaces
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   345
  > key 10
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   346
  > some value
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   347
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   348
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   349
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   350
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   351
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   352
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   353
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   354
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   355
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   356
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   357
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   358
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   359
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   360
Send an unknown command after the "between"
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   361
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   362
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   363
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   364
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   365
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   366
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   367
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   368
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   369
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   370
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   371
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   372
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   373
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   374
And one with arguments
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   375
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   376
  $ hg -R server serve --stdio << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   377
  > hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   378
  > between
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   379
  > pairs 81
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   380
  > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   381
  > foo 5
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   382
  > value
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   383
  > bar 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   384
  > baz
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   385
  > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   386
  384
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   387
  capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   388
  1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   389
  
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   390
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   391
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   392
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   393
  0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   394
  0