Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
701fd2e8
Commit
701fd2e8
authored
6 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
test_backup: add ssh diag on failure
parent
20fc2074
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_backup.py
+7
-0
7 additions, 0 deletions
tests/test_backup.py
with
7 additions
and
0 deletions
tests/test_backup.py
+
7
−
0
View file @
701fd2e8
...
...
@@ -34,6 +34,13 @@ def test_ssh(ip):
subprocess
.
check_output
(
cmd
,
shell
=
True
,
timeout
=
2
)
print
(
'
%sLogged in successfully%s
'
%
(
GREEN
,
DEF
))
except
subprocess
.
CalledProcessError
:
# do some diagnostics
try
:
cmd_port
=
'
nc -z -w2 {} 22
'
.
format
(
ip
)
subprocess
.
check_output
(
cmd_port
,
shell
=
True
,
timeout
=
5
)
except
subprocess
.
CalledProcessError
:
cmd_ping
=
'
ping -c2 -w4 {}
'
.
format
(
ip
)
subprocess
.
check_output
(
cmd_ping
,
shell
=
True
,
timeout
=
5
)
print
(
'
%sFailed to login using SSH, run ssh-copy-id %s %s
'
%
(
RED
,
ip
,
DEF
))
return
False
return
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment