Skip to content

Commit 4c9245a

Browse files
authored
tests: remove real SSH (#4200)
* tests: remove real SSH No longer needed, all tests are using mocked ssh already. * travis: don't setup ssh
1 parent c4b2f68 commit 4c9245a

File tree

3 files changed

+0
-44
lines changed

3 files changed

+0
-44
lines changed

scripts/ci/before_install.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@ fi
1616
echo >env.sh
1717

1818
if [[ "$TRAVIS_BUILD_STAGE_NAME" == "test" ]]; then
19-
if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
20-
# NOTE: ssh keys for ssh test to be able to ssh to the localhost
21-
ssh-keygen -t rsa -N "" -f mykey
22-
mkdir -p ~/.ssh
23-
cp mykey ~/.ssh/id_rsa
24-
cp mykey.pub ~/.ssh/id_rsa.pub
25-
cat mykey.pub >>~/.ssh/authorized_keys
26-
ssh-keyscan localhost >>~/.ssh/known_hosts
27-
ssh localhost ls &>/dev/null
28-
ssh-keyscan 127.0.0.1 >>~/.ssh/known_hosts
29-
ssh 127.0.0.1 ls &>/dev/null
30-
ssh-keyscan 0.0.0.0 >>~/.ssh/known_hosts
31-
ssh 0.0.0.0 ls &>/dev/null
32-
fi
33-
3419
if [[ "$TRAVIS_OS_NAME" == "osx" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
3520
brew install openssl
3621
$scriptdir/retry.sh brew cask install google-cloud-sdk

tests/remotes/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
gs,
3030
)
3131
from .ssh import ( # noqa: F401; noqa: F401
32-
SSH,
3332
SSHMocked,
3433
ssh,
3534
ssh_connection,

tests/remotes/ssh.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
import getpass
21
import locale
32
import os
43
from contextlib import contextmanager
5-
from subprocess import CalledProcessError, check_output
64

75
import pytest
86
from funcy import cached_property
97

108
from dvc.path_info import URLInfo
11-
from dvc.utils import env2bool
129

1310
from .base import Base
1411
from .local import Local
@@ -19,31 +16,6 @@
1916
)
2017

2118

22-
class SSH:
23-
@staticmethod
24-
def should_test():
25-
do_test = env2bool("DVC_TEST_SSH", undefined=None)
26-
if do_test is not None:
27-
return do_test
28-
29-
# FIXME: enable on windows
30-
if os.name == "nt":
31-
return False
32-
33-
try:
34-
check_output(["ssh", "-o", "BatchMode=yes", "127.0.0.1", "ls"])
35-
except (CalledProcessError, OSError):
36-
return False
37-
38-
return True
39-
40-
@staticmethod
41-
def get_url():
42-
return "ssh://{}@127.0.0.1:22{}".format(
43-
getpass.getuser(), Local.get_storagepath()
44-
)
45-
46-
4719
class SSHMocked(Base, URLInfo):
4820
@staticmethod
4921
def get_url(user, port): # pylint: disable=arguments-differ

0 commit comments

Comments
 (0)