annotate tests/test-ssh-proto.t @ 49487:e8481625c582

rust: add Debug constraint to Matcher trait This makes sure we can easily debug which Matcher we're looking at when using trait objects, and is just generally useful. Effort to make the debugging output nicer has been kept to a minimum, please feel free to improve.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 11 Jul 2022 11:59:13 +0200
parents a746d13987a6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38021
538e850ae737 tests: mark tests that fail when using chg as #require no-chg
Kyle Lippincott <spectral@google.com>
parents: 37813
diff changeset
1 #require no-chg
538e850ae737 tests: mark tests that fail when using chg as #require no-chg
Kyle Lippincott <spectral@google.com>
parents: 37813
diff changeset
2
46879
a0d152e5ac17 persistent-nodemap: disable it unconditionally for test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
3 persistent-nodemap is not enabled by default. It is not relevant for this test so disable it.
a0d152e5ac17 persistent-nodemap: disable it unconditionally for test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
4
a0d152e5ac17 persistent-nodemap: disable it unconditionally for test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
5 $ cat << EOF >> $HGRCPATH
a0d152e5ac17 persistent-nodemap: disable it unconditionally for test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
6 > [format]
a0d152e5ac17 persistent-nodemap: disable it unconditionally for test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
7 > use-persistent-nodemap = no
a0d152e5ac17 persistent-nodemap: disable it unconditionally for test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
8 > EOF
a0d152e5ac17 persistent-nodemap: disable it unconditionally for test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46633
diff changeset
9
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
10 Helper function to run protocol tests against multiple protocol versions.
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
11 This is easier than using #testcases because managing differences between
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
12 protocols with inline conditional output is hard to read.
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
13
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
14 $ debugwireproto() {
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
15 > commands=`cat -`
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
16 > echo 'testing ssh1'
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
17 > echo "${commands}" | hg --verbose debugwireproto --localssh
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
18 > }
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
19
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
20 $ cat >> $HGRCPATH << EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
21 > [devel]
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
22 > debug.peer-request = true
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
23 > [extensions]
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
24 > sshprotoext = $TESTDIR/sshprotoext.py
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
25 > EOF
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
26
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
27 $ hg init server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
28 $ cd server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
29 $ echo 0 > foo
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
30 $ hg -q add foo
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
31 $ hg commit -m initial
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
32
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
33 A no-op connection performs a handshake
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
34
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
35 $ hg debugwireproto --localssh << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
36 > EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
37 creating ssh peer from handshake results
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
38
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
39 Raw peers don't perform any activity
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
40
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
41 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
42 > EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
43 using raw connection to peer
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
44 $ hg debugwireproto --localssh --peer ssh1 << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
45 > EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
46 creating ssh peer for wire protocol version 1
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
47
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
48 Test a normal behaving server, for sanity
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
49
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
50 $ cd ..
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
51
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
52 $ hg --debug debugpeer ssh://user@dummy/server
47923
c89ddef6474d tests: normalize the way some debug output it matched
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 47921
diff changeset
53 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R server serve --stdio['"] (re)
37813
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
54 devel-peer-request: hello+between
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
55 devel-peer-request: pairs: 81 bytes
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
56 sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
57 sending between command
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
58 remote: \d+ (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
59 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
60 remote: 1
37393
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
61 devel-peer-request: protocaps
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
62 devel-peer-request: caps: * bytes (glob)
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
63 sending protocaps command
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
64 url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
65 local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
66 pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
67
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
68 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
69
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
70 $ hg -R server debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
71 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
72 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
73 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
74 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
75 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
76 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
77 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
78 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
79 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
80 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
81 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
82 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
83
36527
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
84 `hg debugserve --sshstdio` works
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
85
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
86 $ cd server
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
87 $ hg debugserve --sshstdio << EOF
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
88 > hello
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
89 > EOF
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
90 \d+ (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
91 capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
36527
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
92
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
93 I/O logging works
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
94
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
95 $ hg debugserve --sshstdio --logiofd 1 << EOF
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
96 > hello
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
97 > EOF
42896
7e19b640c53e sshserver: flush stream after command dispatch
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
98 e> flush() -> None
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
99 o> write(4) -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
100 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
101 o> write\(\d+\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
102 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
103 \d+ (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
104 capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
36527
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
105 o> flush() -> None
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
106
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
107 $ hg debugserve --sshstdio --logiofile $TESTTMP/io << EOF
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
108 > hello
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
109 > EOF
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
110 \d+ (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
111 capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
36527
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
112
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
113 $ cat $TESTTMP/io
42896
7e19b640c53e sshserver: flush stream after command dispatch
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40919
diff changeset
114 e> flush() -> None
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
115 o> write(4) -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
116 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
117 o> write\(\d+\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
118 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36527
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
119 o> flush() -> None
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
120
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
121 $ cd ..
44dc34b8d17b debugcommands: add debugserve command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36368
diff changeset
122
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
123 >=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
124 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
125 reply with empty response to the "between".
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
126
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
127 $ hg -R server debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
128 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
129 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
130 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
131 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
132 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
133 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
134 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
135 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
136 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
137 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
138 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
139 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
140 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
141 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
142 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
143 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
144 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
145 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
146 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
147 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
148 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
149 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
150 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
151 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
152 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
153 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
154
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
155 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
156
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
157 $ 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
158 url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
159 local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
160 pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
161
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
162 --debug will print the banner
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
163
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
164 $ SSHSERVERMODE=banner hg --debug debugpeer ssh://user@dummy/server
47923
c89ddef6474d tests: normalize the way some debug output it matched
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 47921
diff changeset
165 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R server serve --stdio['"] (re)
37813
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
166 devel-peer-request: hello+between
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
167 devel-peer-request: pairs: 81 bytes
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
168 sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
169 sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
170 remote: banner: line 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
171 remote: banner: line 1
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
172 remote: banner: line 2
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
173 remote: banner: line 3
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
174 remote: banner: line 4
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
175 remote: banner: line 5
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
176 remote: banner: line 6
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
177 remote: banner: line 7
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
178 remote: banner: line 8
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
179 remote: banner: line 9
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
180 remote: \d+ (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
181 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
182 remote: 1
37393
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
183 devel-peer-request: protocaps
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
184 devel-peer-request: caps: * bytes (glob)
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
185 sending protocaps command
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
186 url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
187 local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
188 pushable: yes
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
189
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
190 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
191
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
192 $ SSHSERVERMODE=banner hg -R server debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
193 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
194 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
195 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
196 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
197 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
198 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
199 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
200 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
201 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
202 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
203 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
204 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
205 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
206 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
207 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
208 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
209 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
210 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
211 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
212 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
213 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
214 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
215 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
216 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
217 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
218 o> banner: line 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
219 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
220 o> banner: line 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
221 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
222 o> banner: line 2\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
223 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
224 o> banner: line 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
225 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
226 o> banner: line 4\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
227 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
228 o> banner: line 5\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
229 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
230 o> banner: line 6\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
231 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
232 o> banner: line 7\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
233 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
234 o> banner: line 8\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
235 o> readline() -> 15:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
236 o> banner: line 9\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
237 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
238 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
239 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
240 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
241 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
242 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
243 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
244 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
245 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
246 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
247 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
248 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
249
35940
556218e08e25 sshpeer: remove support for connecting to <0.9.1 servers (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35938
diff changeset
250 Connecting to a <0.9.1 server that doesn't support the hello command.
556218e08e25 sshpeer: remove support for connecting to <0.9.1 servers (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35938
diff changeset
251 The client should refuse, as we dropped support for connecting to such
556218e08e25 sshpeer: remove support for connecting to <0.9.1 servers (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35938
diff changeset
252 servers.
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
253
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
254 $ SSHSERVERMODE=no-hello hg --debug debugpeer ssh://user@dummy/server
47923
c89ddef6474d tests: normalize the way some debug output it matched
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 47921
diff changeset
255 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R server serve --stdio['"] (re)
37813
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
256 devel-peer-request: hello+between
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
257 devel-peer-request: pairs: 81 bytes
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
258 sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
259 sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
260 remote: 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
261 remote: 1
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 44412
diff changeset
262 abort: no suitable response from remote hg
35940
556218e08e25 sshpeer: remove support for connecting to <0.9.1 servers (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35938
diff changeset
263 [255]
35930
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 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
266
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
267 $ hg -R server debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
268 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
269 > pre-hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
270 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
271 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
272 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
273 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
274 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
275 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
276 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
277 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
278 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
279 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
280 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
281 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
282 i> write(10) -> 10:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
283 i> pre-hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
284 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
285 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
286 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
287 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
288 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
289 o> \d+\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
290 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
291 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
292 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
293 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
294 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
295 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
296 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
297 o> 1\n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
298
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
299 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-no-args --debug debugpeer ssh://user@dummy/server
47923
c89ddef6474d tests: normalize the way some debug output it matched
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 47921
diff changeset
300 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R server serve --stdio['"] (re)
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
301 sending no-args command
37813
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
302 devel-peer-request: hello+between
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
303 devel-peer-request: pairs: 81 bytes
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
304 sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
305 sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
306 remote: 0
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
307 remote: \d+ (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
308 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
309 remote: 1
37393
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
310 devel-peer-request: protocaps
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
311 devel-peer-request: caps: * bytes (glob)
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
312 sending protocaps command
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
313 url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
314 local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
315 pushable: yes
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 Send multiple unknown commands before hello
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
318
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
319 $ hg -R server debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
320 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
321 > unknown1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
322 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
323 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
324 > unknown2\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
325 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
326 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
327 > unknown3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
328 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
329 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
330 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
331 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
332 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
333 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
334 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
335 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
336 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
337 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
338 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
339 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
340 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
341 i> write(9) -> 9:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
342 i> unknown1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
343 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
344 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
345 i> write(9) -> 9:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
346 i> unknown2\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
347 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
348 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
349 i> write(9) -> 9:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
350 i> unknown3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
351 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
352 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
353 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
354 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
355 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
356 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
357 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
358 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
359 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
360 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
361 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
362 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
363 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
364 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
365 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
366 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
367
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
368 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-multiple-no-args --debug debugpeer ssh://user@dummy/server
47923
c89ddef6474d tests: normalize the way some debug output it matched
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 47921
diff changeset
369 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R server serve --stdio['"] (re)
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
370 sending unknown1 command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
371 sending unknown2 command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
372 sending unknown3 command
37813
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
373 devel-peer-request: hello+between
58bbd14b0c62 sshpeer: reflect actual command activity one handshake
Boris Feld <boris.feld@octobus.net>
parents: 37652
diff changeset
374 devel-peer-request: pairs: 81 bytes
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
375 sending hello command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
376 sending between command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
377 remote: 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
378 remote: 0
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
379 remote: 0
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
380 remote: \d+ (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
381 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
382 remote: 1
37393
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
383 devel-peer-request: protocaps
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
384 devel-peer-request: caps: * bytes (glob)
afcfdf53e4b5 wireproto: provide accessors for client capabilities
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
385 sending protocaps command
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
386 url: ssh://user@dummy/server
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
387 local: no
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
388 pushable: yes
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 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
391
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
392 $ cd server
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
393
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
394 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
395 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
396 > with-args\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
397 > foo 13\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
398 > value for foo\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
399 > bar 13\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
400 > value for bar\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
401 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
402 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
403 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
404 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
405 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
406 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
407 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
408 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
409 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
410 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
411 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
412 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
413 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
414 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
415 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
416 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
417 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
418 i> write(52) -> 52:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
419 i> with-args\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
420 i> foo 13\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
421 i> value for foo\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
422 i> bar 13\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
423 i> value for bar\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
424 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
425 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
426 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
427 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
428 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
429 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
430 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
431 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
432 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
433 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
434 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
435 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
436 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
437 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
438 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
439 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
440 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
441 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
442 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
443 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
444 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
445 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
446 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
447 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
448
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
449 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
450
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
451 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
452 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
453 > unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
454 > foo 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
455 > 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
456 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
457 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
458 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
459 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
460 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
461 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
462 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
463 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
464 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
465 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
466 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
467 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
468 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
469 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
470 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
471 i> write(16) -> 16:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
472 i> unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
473 i> foo 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
474 i> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
475 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
476 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
477 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
478 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
479 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
480 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
481 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
482 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
483 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
484 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
485 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
486 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
487 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
488 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
489 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
490 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
491 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
492 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
493 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
494 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
495
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
496 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
497 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
498 > unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
499 > foo 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
500 > 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
501 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
502 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
503 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
504 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
505 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
506 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
507 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
508 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
509 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
510 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
511 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
512 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
513 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
514 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
515 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
516 i> write(16) -> 16:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
517 i> unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
518 i> foo 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
519 i> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
520 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
521 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
522 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
523 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
524 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
525 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
526 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
527 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
528 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
529 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
530 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
531 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
532 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
533 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
534 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
535 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
536 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
537 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
538 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
539 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
540
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
541 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
542 "<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
543 in the dict.
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
544
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
545 Dictionary value for unknown command
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
546
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
547 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
548 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
549 > unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
550 > dict 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
551 > key1 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
552 > foo\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
553 > key2 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
554 > bar\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
555 > key3 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
556 > baz\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
557 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
558 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
559 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
560 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
561 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
562 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
563 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
564 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
565 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
566 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
567 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
568 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
569 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
570 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
571 i> write(48) -> 48:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
572 i> unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
573 i> dict 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
574 i> key1 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
575 i> foo\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
576 i> key2 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
577 i> bar\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
578 i> key3 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
579 i> baz\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
580 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
581 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
582 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
583 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
584 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
585 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
586 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
587 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
588 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
589 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
590 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
591 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
592 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
593 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
594 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
595 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
596 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
597 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
598 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
599 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
600 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
601 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
602
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
603 Incomplete dictionary send
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
604
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
605 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
606 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
607 > unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
608 > dict 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
609 > key1 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
610 > foo\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
611 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
612 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
613 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
614 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
615 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
616 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
617 i> write(26) -> 26:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
618 i> unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
619 i> dict 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
620 i> key1 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
621 i> foo\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
622 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
623 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
624 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
625 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
626 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
627 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
628 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
629 o> 0\n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
630
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
631 Incomplete value send
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
632
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
633 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
634 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
635 > unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
636 > dict 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
637 > key1 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
638 > fo
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
639 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
640 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
641 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
642 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
643 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
644 i> write(24) -> 24:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
645 i> unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
646 i> dict 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
647 i> key1 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
648 i> fo
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
649 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
650 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
651 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
652 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
653 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
654 o> 0\n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
655
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
656 Send a command line with spaces
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
657
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
658 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
659 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
660 > unknown withspace\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
661 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
662 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
663 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
664 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
665 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
666 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
667 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
668 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
669 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
670 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
671 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
672 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
673 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
674 i> write(18) -> 18:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
675 i> unknown withspace\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
676 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
677 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
678 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
679 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
680 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
681 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
682 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
683 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
684 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
685 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
686 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
687 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
688 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
689 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
690 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
691 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
692
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
693 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
694 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
695 > unknown with multiple spaces\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
696 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
697 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
698 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
699 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
700 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
701 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
702 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
703 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
704 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
705 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
706 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
707 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
708 i> write(29) -> 29:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
709 i> unknown with multiple spaces\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
710 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
711 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
712 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
713 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
714 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
715 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
716 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
717 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
718 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
719 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
720 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
721 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
722 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
723 o> 1\n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
724
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
725 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
726 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
727 > unknown with spaces\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
728 > key 10\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
729 > some value\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
730 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
731 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
732 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
733 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
734 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
735 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
736 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
737 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
738 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
739 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
740 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
741 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
742 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
743 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
744 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
745 i> write(38) -> 38:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
746 i> unknown with spaces\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
747 i> key 10\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
748 i> some value\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
749 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
750 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
751 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
752 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
753 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
754 o> 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
755 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
756 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
757 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
758 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
759 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
760 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
761 i> write(98) -> 98:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
762 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
763 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
764 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
765 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
766 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
767 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
768 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
769 Send an unknown command after the "between"
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
770
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
771 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
772 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
773 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
774 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
775 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
776 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
777 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
778 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
779 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
780 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
781 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
782 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
783 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
784 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
785 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
786 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
787 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
788 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
789 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
790 i> write(105) -> 105:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
791 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
792 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
793 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
794 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
795 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
796 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
797 o> \n
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
798
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
799 And one with arguments
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
800
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
801 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
802 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
803 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
804 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
805 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
806 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
807 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
808 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
809 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
810 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
811 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
812 > unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
813 > foo 5\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
814 > \nvalue\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
815 > bar 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
816 > baz\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
817 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
818 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
819 > readline
35930
83d67257ba90 tests: add low-level SSH protocol tests
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
820 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
821 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
822 i> write(104) -> 104:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
823 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
824 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
825 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
826 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
827 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
828 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
829 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
830 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
831 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
832 o> 1\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
833 o> readline() -> 1:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
834 o> \n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
835 i> write(31) -> 31:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
836 i> unknown\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
837 i> foo 5\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
838 i> \n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
839 i> value\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
840 i> bar 3\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
841 i> baz\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
842 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
843 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
844 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
845 o> 0\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
846 o> readline() -> 0:
35976
48a3a9283f09 sshpeer: initial definition and implementation of new SSH protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35940
diff changeset
847
36076
465858451347 tests: add tests for sending recognized command before handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35989
diff changeset
848 Send a valid command before the handshake
465858451347 tests: add tests for sending recognized command before handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35989
diff changeset
849
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
850 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
851 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
852 > heads\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
853 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
854 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
855 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
856 > between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
857 > pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
858 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
859 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
860 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
861 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
862 > readline
36076
465858451347 tests: add tests for sending recognized command before handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35989
diff changeset
863 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
864 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
865 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
866 i> heads\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
867 o> readline() -> 3:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
868 o> 41\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
869 i> write(104) -> 104:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
870 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
871 i> between\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
872 i> pairs 81\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
873 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
874 o> readline() -> 41:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
875 o> 68986213bd4485ea51533535e3fc9e78007a711f\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
876 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
877 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
878 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
879 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
880 o> readline() -> 2:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
881 o> 1\n
36076
465858451347 tests: add tests for sending recognized command before handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35989
diff changeset
882
465858451347 tests: add tests for sending recognized command before handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35989
diff changeset
883 And a variation that doesn't send the between command
465858451347 tests: add tests for sending recognized command before handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35989
diff changeset
884
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
885 $ hg debugwireproto --localssh --peer raw << EOF
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
886 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
887 > heads\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
888 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
889 > raw
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
890 > hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
891 > readline
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
892 > readline
36076
465858451347 tests: add tests for sending recognized command before handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35989
diff changeset
893 > EOF
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
894 using raw connection to peer
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
895 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
896 i> heads\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
897 o> readline() -> 3:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
898 o> 41\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
899 i> write(6) -> 6:
36528
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
900 i> hello\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
901 o> readline() -> 41:
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
902 o> 68986213bd4485ea51533535e3fc9e78007a711f\n
72e487851a53 debugcommands: add debugwireproto command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36527
diff changeset
903 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
904 o> \d+\\n (re)
36076
465858451347 tests: add tests for sending recognized command before handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35989
diff changeset
905
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
906 $ cd ..
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
907
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
908 Test listkeys for listing namespaces
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
909
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
910 $ hg init empty
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
911 $ cd empty
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
912 $ debugwireproto << EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
913 > command listkeys
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
914 > namespace namespaces
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
915 > EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
916 testing ssh1
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
917 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
918 i> write(104) -> 104:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
919 i> hello\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
920 i> between\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
921 i> pairs 81\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
922 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
923 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
924 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
925 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
926 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
927 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
928 o> readline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
929 o> 1\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
930 o> readline() -> 1:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
931 o> \n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
932 sending listkeys command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
933 i> write(9) -> 9:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
934 i> listkeys\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
935 i> write(13) -> 13:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
936 i> namespace 10\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
937 i> write(10) -> 10: namespaces
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
938 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
939 o> bufferedreadline() -> 3:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
940 o> 30\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
941 o> bufferedread(30) -> 30:
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
942 o> bookmarks\t\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
943 o> namespaces\t\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
944 o> phases\t
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
945 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
946 b'bookmarks': b'',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
947 b'namespaces': b'',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
948 b'phases': b''
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
949 }
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
950
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
951 $ cd ..
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
952
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
953 Test listkeys for bookmarks
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
954
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
955 $ hg init bookmarkrepo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
956 $ cd bookmarkrepo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
957 $ echo 0 > foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
958 $ hg add foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
959 $ hg -q commit -m initial
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
960 $ echo 1 > foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
961 $ hg commit -m second
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
962
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
963 With no bookmarks set
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
964
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
965 $ debugwireproto << EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
966 > command listkeys
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
967 > namespace bookmarks
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
968 > EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
969 testing ssh1
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
970 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
971 i> write(104) -> 104:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
972 i> hello\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
973 i> between\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
974 i> pairs 81\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
975 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
976 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
977 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
978 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
979 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
980 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
981 o> readline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
982 o> 1\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
983 o> readline() -> 1:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
984 o> \n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
985 sending listkeys command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
986 i> write(9) -> 9:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
987 i> listkeys\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
988 i> write(12) -> 12:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
989 i> namespace 9\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
990 i> write(9) -> 9: bookmarks
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
991 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
992 o> bufferedreadline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
993 o> 0\n
37652
fe8c6f9f2914 debugcommands: use command executor for invoking commands
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
994 response: {}
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
995
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
996 With a single bookmark set
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
997
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
998 $ hg book -r 0 bookA
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
999 $ debugwireproto << EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1000 > command listkeys
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1001 > namespace bookmarks
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1002 > EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1003 testing ssh1
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1004 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1005 i> write(104) -> 104:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1006 i> hello\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1007 i> between\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1008 i> pairs 81\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1009 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1010 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1011 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1012 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1013 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1014 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1015 o> readline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1016 o> 1\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1017 o> readline() -> 1:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1018 o> \n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1019 sending listkeys command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1020 i> write(9) -> 9:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1021 i> listkeys\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1022 i> write(12) -> 12:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1023 i> namespace 9\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1024 i> write(9) -> 9: bookmarks
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1025 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1026 o> bufferedreadline() -> 3:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1027 o> 46\n
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1028 o> bufferedread(46) -> 46: bookA\t68986213bd4485ea51533535e3fc9e78007a711f
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1029 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1030 b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1031 }
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1032
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1033 With multiple bookmarks set
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1034
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1035 $ hg book -r 1 bookB
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1036 $ debugwireproto << EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1037 > command listkeys
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1038 > namespace bookmarks
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1039 > EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1040 testing ssh1
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1041 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1042 i> write(104) -> 104:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1043 i> hello\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1044 i> between\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1045 i> pairs 81\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1046 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1047 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1048 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1049 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1050 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1051 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1052 o> readline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1053 o> 1\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1054 o> readline() -> 1:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1055 o> \n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1056 sending listkeys command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1057 i> write(9) -> 9:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1058 i> listkeys\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1059 i> write(12) -> 12:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1060 i> namespace 9\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1061 i> write(9) -> 9: bookmarks
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1062 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1063 o> bufferedreadline() -> 3:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1064 o> 93\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1065 o> bufferedread(93) -> 93:
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1066 o> bookA\t68986213bd4485ea51533535e3fc9e78007a711f\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1067 o> bookB\t1880f3755e2e52e3199e0ee5638128b08642f34d
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1068 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1069 b'bookA': b'68986213bd4485ea51533535e3fc9e78007a711f',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1070 b'bookB': b'1880f3755e2e52e3199e0ee5638128b08642f34d'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1071 }
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1072
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1073 Test pushkey for bookmarks
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1074
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1075 $ debugwireproto << EOF
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1076 > command pushkey
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1077 > namespace bookmarks
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1078 > key remote
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1079 > old
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1080 > new 68986213bd4485ea51533535e3fc9e78007a711f
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1081 > EOF
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1082 testing ssh1
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1083 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1084 i> write(104) -> 104:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1085 i> hello\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1086 i> between\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1087 i> pairs 81\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1088 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1089 i> flush() -> None
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1090 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1091 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1092 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1093 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1094 o> readline() -> 2:
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1095 o> 1\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1096 o> readline() -> 1:
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1097 o> \n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1098 sending pushkey command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1099 i> write(8) -> 8:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1100 i> pushkey\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1101 i> write(6) -> 6:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1102 i> key 6\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1103 i> write(6) -> 6: remote
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1104 i> write(12) -> 12:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1105 i> namespace 9\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1106 i> write(9) -> 9: bookmarks
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1107 i> write(7) -> 7:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1108 i> new 40\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1109 i> write(40) -> 40: 68986213bd4485ea51533535e3fc9e78007a711f
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1110 i> write(6) -> 6:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1111 i> old 0\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1112 i> flush() -> None
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1113 o> bufferedreadline() -> 2:
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1114 o> 2\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1115 o> bufferedread(2) -> 2:
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1116 o> 1\n
37652
fe8c6f9f2914 debugcommands: use command executor for invoking commands
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
1117 response: True
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1118
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1119 $ hg bookmarks
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1120 bookA 0:68986213bd44
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1121 bookB 1:1880f3755e2e
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1122 remote 0:68986213bd44
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1123
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1124 $ cd ..
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1125
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1126 Test listkeys for phases
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1127
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1128 $ hg init phasesrepo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1129 $ cd phasesrepo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1130
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1131 Phases on empty repo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1132
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1133 $ debugwireproto << EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1134 > command listkeys
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1135 > namespace phases
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1136 > EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1137 testing ssh1
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1138 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1139 i> write(104) -> 104:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1140 i> hello\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1141 i> between\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1142 i> pairs 81\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1143 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1144 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1145 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1146 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1147 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1148 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1149 o> readline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1150 o> 1\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1151 o> readline() -> 1:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1152 o> \n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1153 sending listkeys command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1154 i> write(9) -> 9:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1155 i> listkeys\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1156 i> write(12) -> 12:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1157 i> namespace 6\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1158 i> write(6) -> 6: phases
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1159 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1160 o> bufferedreadline() -> 3:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1161 o> 15\n
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1162 o> bufferedread(15) -> 15: publishing\tTrue
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1163 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1164 b'publishing': b'True'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1165 }
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1166
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1167 Create some commits
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1168
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1169 $ echo 0 > foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1170 $ hg add foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1171 $ hg -q commit -m initial
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1172 $ hg phase --public
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1173 $ echo 1 > foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1174 $ hg commit -m 'head 1 commit 1'
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1175 $ echo 2 > foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1176 $ hg commit -m 'head 1 commit 2'
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1177 $ hg -q up 0
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1178 $ echo 1a > foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1179 $ hg commit -m 'head 2 commit 1'
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1180 created new head
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1181 $ echo 2a > foo
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1182 $ hg commit -m 'head 2 commit 2'
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1183
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1184 Two draft heads
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1185
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1186 $ debugwireproto << EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1187 > command listkeys
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1188 > namespace phases
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1189 > EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1190 testing ssh1
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1191 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1192 i> write(104) -> 104:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1193 i> hello\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1194 i> between\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1195 i> pairs 81\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1196 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1197 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1198 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1199 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1200 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1201 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1202 o> readline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1203 o> 1\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1204 o> readline() -> 1:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1205 o> \n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1206 sending listkeys command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1207 i> write(9) -> 9:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1208 i> listkeys\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1209 i> write(12) -> 12:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1210 i> namespace 6\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1211 i> write(6) -> 6: phases
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1212 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1213 o> bufferedreadline() -> 4:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1214 o> 101\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1215 o> bufferedread(101) -> 101:
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1216 o> 20b8a89289d80036e6c4e87c2083e3bea1586637\t1\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1217 o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1218 o> publishing\tTrue
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1219 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1220 b'20b8a89289d80036e6c4e87c2083e3bea1586637': b'1',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1221 b'c4750011d906c18ea2f0527419cbc1a544435150': b'1',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1222 b'publishing': b'True'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1223 }
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1224
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1225 Single draft head
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1226
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1227 $ hg phase --public -r 2
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1228 $ debugwireproto << EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1229 > command listkeys
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1230 > namespace phases
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1231 > EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1232 testing ssh1
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1233 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1234 i> write(104) -> 104:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1235 i> hello\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1236 i> between\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1237 i> pairs 81\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1238 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1239 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1240 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1241 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1242 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1243 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1244 o> readline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1245 o> 1\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1246 o> readline() -> 1:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1247 o> \n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1248 sending listkeys command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1249 i> write(9) -> 9:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1250 i> listkeys\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1251 i> write(12) -> 12:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1252 i> namespace 6\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1253 i> write(6) -> 6: phases
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1254 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1255 o> bufferedreadline() -> 3:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1256 o> 58\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1257 o> bufferedread(58) -> 58:
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1258 o> c4750011d906c18ea2f0527419cbc1a544435150\t1\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1259 o> publishing\tTrue
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1260 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1261 b'c4750011d906c18ea2f0527419cbc1a544435150': b'1',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1262 b'publishing': b'True'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1263 }
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1264
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1265 All public heads
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1266
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1267 $ hg phase --public -r 4
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1268 $ debugwireproto << EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1269 > command listkeys
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1270 > namespace phases
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1271 > EOF
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1272 testing ssh1
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1273 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1274 i> write(104) -> 104:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1275 i> hello\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1276 i> between\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1277 i> pairs 81\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1278 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1279 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1280 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1281 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1282 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1283 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1284 o> readline() -> 2:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1285 o> 1\n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1286 o> readline() -> 1:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1287 o> \n
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1288 sending listkeys command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1289 i> write(9) -> 9:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1290 i> listkeys\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1291 i> write(12) -> 12:
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1292 i> namespace 6\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1293 i> write(6) -> 6: phases
36530
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1294 i> flush() -> None
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1295 o> bufferedreadline() -> 3:
bde0bd50f368 debugcommands: allow sending of simple commands with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36528
diff changeset
1296 o> 15\n
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1297 o> bufferedread(15) -> 15: publishing\tTrue
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1298 response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1299 b'publishing': b'True'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38314
diff changeset
1300 }
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1301
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1302 Setting public phase via pushkey
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1303
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1304 $ hg phase --draft --force -r .
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1305
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1306 $ debugwireproto << EOF
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1307 > command pushkey
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1308 > namespace phases
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1309 > key 7127240a084fd9dc86fe8d1f98e26229161ec82b
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1310 > old 1
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1311 > new 0
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1312 > EOF
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1313 testing ssh1
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1314 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1315 i> write(104) -> 104:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1316 i> hello\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1317 i> between\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1318 i> pairs 81\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1319 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1320 i> flush() -> None
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1321 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1322 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1323 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1324 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1325 o> readline() -> 2:
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1326 o> 1\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1327 o> readline() -> 1:
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1328 o> \n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1329 sending pushkey command
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1330 i> write(8) -> 8:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1331 i> pushkey\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1332 i> write(7) -> 7:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1333 i> key 40\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1334 i> write(40) -> 40: 7127240a084fd9dc86fe8d1f98e26229161ec82b
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1335 i> write(12) -> 12:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1336 i> namespace 6\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1337 i> write(6) -> 6: phases
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1338 i> write(6) -> 6:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1339 i> new 1\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1340 i> write(1) -> 1: 0
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1341 i> write(6) -> 6:
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1342 i> old 1\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1343 i> write(1) -> 1: 1
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1344 i> flush() -> None
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1345 o> bufferedreadline() -> 2:
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1346 o> 2\n
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1347 o> bufferedread(2) -> 2:
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1348 o> 1\n
37652
fe8c6f9f2914 debugcommands: use command executor for invoking commands
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37533
diff changeset
1349 response: True
36532
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1350
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1351 $ hg phase .
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1352 4: public
1138e5c0fbc9 tests: add wire protocol tests for pushkey
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36531
diff changeset
1353
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1354 $ cd ..
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1355
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1356 Test batching of requests
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1357
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1358 $ hg init batching
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1359 $ cd batching
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1360 $ echo 0 > foo
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1361 $ hg add foo
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1362 $ hg -q commit -m initial
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1363 $ hg phase --public
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1364 $ echo 1 > foo
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1365 $ hg commit -m 'commit 1'
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1366 $ hg -q up 0
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1367 $ echo 2 > foo
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1368 $ hg commit -m 'commit 2'
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1369 created new head
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1370 $ hg book -r 1 bookA
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1371 $ hg book -r 2 bookB
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1372
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1373 $ debugwireproto << EOF
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1374 > batchbegin
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1375 > command heads
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1376 > command listkeys
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1377 > namespace bookmarks
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1378 > command listkeys
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1379 > namespace phases
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1380 > batchsubmit
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1381 > EOF
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1382 testing ssh1
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1383 creating ssh peer from handshake results
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1384 i> write(104) -> 104:
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1385 i> hello\n
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1386 i> between\n
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1387 i> pairs 81\n
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1388 i> 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1389 i> flush() -> None
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1390 o> readline() -> 4:
48649
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1391 o> \d+\\n (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1392 o> readline\(\) -> \d+: (re)
a746d13987a6 stream-requirements: smoother matching in test-ssh-proto.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48526
diff changeset
1393 o> capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash\\n (re)
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1394 o> readline() -> 2:
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1395 o> 1\n
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1396 o> readline() -> 1:
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1397 o> \n
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1398 sending batch with 3 sub-commands
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1399 i> write(6) -> 6:
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1400 i> batch\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1401 i> write(4) -> 4:
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1402 i> * 0\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1403 i> write(8) -> 8:
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1404 i> cmds 61\n
36631
8395fddde46c util: report integer result from write()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36612
diff changeset
1405 i> write(61) -> 61: heads ;listkeys namespace=bookmarks;listkeys namespace=phases
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1406 i> flush() -> None
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1407 o> bufferedreadline() -> 4:
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1408 o> 278\n
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1409 o> bufferedread(278) -> 278:
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1410 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1411 o> ;bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1412 o> bookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6;4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1413 o> bfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1414 o> publishing\tTrue
36531
097ad1079192 debugcommands: support for sending "batch" requests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36530
diff changeset
1415 response #0: bfebe6bd38eebc6f8202e419c1171268987ea6a6 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\n
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1416 response #1: bookA\t4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\nbookB\tbfebe6bd38eebc6f8202e419c1171268987ea6a6
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
1417 response #2: 4ee3fcef1c800fa2bf23e20af7c83ff111d9c7ab\t1\nbfebe6bd38eebc6f8202e419c1171268987ea6a6\t1\npublishing\tTrue