tests/test-ssh-repoerror.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 17 Jan 2022 18:51:47 +0100
changeset 48598 a6f16ec07ed7
parent 47921 0c92cd9286ee
child 50292 adecb1ab4a0d
permissions -rw-r--r--
stream-clone: add a explicit test for format change during stream clone They are different kind of requirements, the one which impact the data storage and are relevant to the files being streamed and the one which does not. For example some requirements are only relevant to the working copy, like sparse, or dirstate-v2. Since they are irrelevant to the content being streamed, they do not prevent the receiving side to use streaming clone and mercurial skip adverting them over the wire and, ideally, within the bundle. In addition, this let the client decide to use whichever format it desire for the part that does not affect the store itself. So the configuration related to these format are used as normal when doing a streaming clone. In practice, the feature was not really tested and is badly broken with bundle-2, since the requirements are not filtered out from the stream bundle. So we start with adding simple tests as a good base before the fix and adjust the feature. Differential Revision: https://phab.mercurial-scm.org/D12029
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47587
be496e3489b9 tests: blacklist a handful of test with `rhg` or `chg`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45906
diff changeset
     1
#require unix-permissions no-root no-windows no-rhg
be496e3489b9 tests: blacklist a handful of test with `rhg` or `chg`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45906
diff changeset
     2
be496e3489b9 tests: blacklist a handful of test with `rhg` or `chg`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45906
diff changeset
     3
XXX-RHG this test hangs if `hg` is really `rhg`. This was hidden by the use of
be496e3489b9 tests: blacklist a handful of test with `rhg` or `chg`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45906
diff changeset
     4
`alias hg=rhg` by run-tests.py. With such alias removed, this test is revealed
be496e3489b9 tests: blacklist a handful of test with `rhg` or `chg`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 45906
diff changeset
     5
buggy. This need to be resolved sooner than later.
39382
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     6
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     7
repository itself is non-readable
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     8
---------------------------------
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     9
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    10
  $ hg init no-read
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    11
  $ hg id ssh://user@dummy/no-read
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    12
  000000000000
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    13
  $ chmod a-rx no-read
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    14
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    15
  $ hg id ssh://user@dummy/no-read
40227
f4893b59230f py3: more globing of things to make output compatible between py2 and py3
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39707
diff changeset
    16
  remote: abort: Permission denied: *$TESTTMP/no-read/.hg* (glob)
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 41420
diff changeset
    17
  abort: no suitable response from remote hg
39382
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    18
  [255]
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    19
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    20
special case files are visible, but unreadable
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    21
----------------------------------------------
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    22
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    23
This is "similar" to the test above, but the directory is "traversable". This
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    24
seems an unexpected case in real life, but we test it anyway.
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    25
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    26
  $ hg init other
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    27
  $ hg id ssh://user@dummy/other
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    28
  000000000000
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    29
  $ for item in `find other | sort -r` ; do
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    30
  >     chmod a-r $item
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    31
  > done
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    32
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    33
  $ hg id ssh://user@dummy/other
41420
b6673e9bdcf6 dispatch: quote filename in IOError as well
Yuya Nishihara <yuya@tcha.org>
parents: 40227
diff changeset
    34
  remote: abort: Permission denied: '$TESTTMP/other/.hg/requires'
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 41420
diff changeset
    35
  abort: no suitable response from remote hg
39382
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    36
  [255]
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    37
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    38
directory toward the repository is read only
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    39
--------------------------------------------
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    40
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    41
  $ mkdir deep
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    42
  $ hg init deep/nested
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    43
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    44
  $ hg id ssh://user@dummy/deep/nested
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    45
  000000000000
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    46
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    47
  $ chmod a-rx deep
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    48
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    49
  $ hg id ssh://user@dummy/deep/nested
40227
f4893b59230f py3: more globing of things to make output compatible between py2 and py3
Pulkit Goyal <pulkit@yandex-team.ru>
parents: 39707
diff changeset
    50
  remote: abort: Permission denied: *$TESTTMP/deep/nested/.hg* (glob)
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 41420
diff changeset
    51
  abort: no suitable response from remote hg
39382
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    52
  [255]
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    53
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    54
repository has wrong requirement
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    55
--------------------------------
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    56
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    57
  $ hg init repo-future
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    58
  $ hg id ssh://user@dummy/repo-future
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    59
  000000000000
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    60
  $ echo flying-car >> repo-future/.hg/requires
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    61
  $ hg id ssh://user@dummy/repo-future
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 41420
diff changeset
    62
  remote: abort: repository requires features unknown to this Mercurial: flying-car
39382
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    63
  remote: (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 41420
diff changeset
    64
  abort: no suitable response from remote hg
39382
a7e22dd31f54 test: add a test file that displays ssh behavior in front of various errors
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    65
  [255]