# HG changeset patch # User Gregory Szorc # Date 1518052707 28800 # Node ID 4658584513474b042ab544224be5ec5636a6f061 # Parent ac33dc94e1d53cf3fae22fd7e7c07805300ab42a tests: add tests for sending recognized command before handshake Rounding out our test coverage for the SSH server. Differential Revision: https://phab.mercurial-scm.org/D2093 diff -r ac33dc94e1d5 -r 465858451347 tests/test-ssh-proto.t --- a/tests/test-ssh-proto.t Wed Feb 07 20:37:51 2018 -0800 +++ b/tests/test-ssh-proto.t Wed Feb 07 17:18:27 2018 -0800 @@ -394,6 +394,33 @@ 0 0 +Send a valid command before the handshake + + $ hg -R server serve --stdio << EOF + > heads + > hello + > between + > pairs 81 + > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 + > EOF + 41 + 68986213bd4485ea51533535e3fc9e78007a711f + 384 + capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN + 1 + + +And a variation that doesn't send the between command + + $ hg -R server serve --stdio << EOF + > heads + > hello + > EOF + 41 + 68986213bd4485ea51533535e3fc9e78007a711f + 384 + capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN + Send an upgrade request to a server that doesn't support that command $ hg -R server serve --stdio << EOF