Skip to content

Commit

Permalink
Debug CI: Avoid DNS resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Feb 25, 2021
1 parent ce336be commit e5e69d0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/functional_test_ssh_command_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_fingerprint_will_be_fetched_first_time(self):
known_hosts_file = NamedTemporaryFile(delete=False)

result = run_check('ssh-command', {
'HOST': 'localhost',
'HOST': '127.0.0.1',
'PORT': 3223,
'USER': 'root',
'PASSWORD': 'root',
Expand All @@ -41,7 +41,7 @@ def test_success_case(self):
"""

result = run_check('ssh-command', {
'HOST': 'localhost',
'HOST': '127.0.0.1',
'PORT': 3223,
'USER': 'root',
'PASSWORD': 'root',
Expand All @@ -56,7 +56,7 @@ def test_success_case(self):

def test_invalid_password(self):
result = run_check('ssh-command', {
'HOST': 'localhost',
'HOST': '127.0.0.1',
'PORT': 3223,
'USER': 'root',
'PASSWORD': 'invalid-password',
Expand Down
4 changes: 2 additions & 2 deletions tests/functional_test_ssh_files_checksum_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_not_passed_host_raises_human_readable_message(self):

def test_success_case(self):
result = run_check('ssh-files-checksum', {
'HOST': 'localhost',
'HOST': '127.0.0.1',
'PORT': 3223,
'USER': 'root',
'PASSWORD': 'root',
Expand All @@ -31,7 +31,7 @@ def test_success_case(self):

def test_at_least_one_checksum_not_matching(self):
result = run_check('ssh-files-checksum', {
'HOST': 'localhost',
'HOST': '127.0.0.1',
'PORT': 3223,
'USER': 'root',
'PASSWORD': 'root',
Expand Down
4 changes: 2 additions & 2 deletions tests/functional_test_ssh_fingerprint_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_success_case(self):
current_expected_fingerprint = self.get_current_ssh_server_fingerprint()

result = run_check('ssh-fingerprint', {
'HOST': 'localhost',
'HOST': '127.0.0.1',
'PORT': 3223,
'EXPECTED_FINGERPRINT': current_expected_fingerprint
}, {})
Expand All @@ -23,7 +23,7 @@ def test_success_case(self):

def test_invalid_fingerprint(self):
result = run_check('ssh-fingerprint', {
'HOST': 'localhost',
'HOST': '127.0.0.1',
'PORT': 3223,
'EXPECTED_FINGERPRINT': 'SOME FINGERPRINT THAT DOES NOT MATCH SERVER FINGERPRINT'
}, {})
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/ssh_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _wait_for_container_to_be_ready():

for i in range(1, 600):
try:
out += str(subprocess.check_output('echo "ttttt\n\n" | nc -w 1 "localhost" "3223"',
out += str(subprocess.check_output('echo "ttttt\n\n" | nc -w 1 "127.0.0.1" "3223"',
shell=True, stderr=subprocess.STDOUT))

if "SSH-2.0-OpenSSH" in out:
Expand All @@ -30,7 +30,7 @@ def _wait_for_container_to_be_ready():
def get_current_ssh_server_fingerprint():
try:
return subprocess.check_output(
'ssh-keyscan -t rsa -p 3223 localhost', stderr=subprocess.PIPE, shell=True
'ssh-keyscan -t rsa -p 3223 127.0.0.1', stderr=subprocess.PIPE, shell=True
).decode('utf-8')
except subprocess.CalledProcessError as err:
return err.stderr.decode('utf-8') + "\n" + err.stdout.decode('utf-8')
Expand Down

0 comments on commit e5e69d0

Please sign in to comment.