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
9853b7cc
Commit
9853b7cc
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Added some messages in SSH test.
parent
bc8f0ac9
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
+9
-5
9 additions, 5 deletions
tests/test_backup.py
with
9 additions
and
5 deletions
tests/test_backup.py
+
9
−
5
View file @
9853b7cc
...
...
@@ -5,11 +5,12 @@
Criticality: Medium
Checks that the server backups are not older than a day.
'''
from
datetime
import
datetime
import
imp
import
os
import
sys
import
subprocess
import
imp
from
datetime
import
datetime
import
sys
GREEN
=
'
\033
[92m
'
RED
=
'
\033
[91m
'
...
...
@@ -42,6 +43,8 @@ def test_last_backup_is_recent(server, client):
print
(
'
There is a backup that is less than 2 days old, this is fine
'
)
return
True
else
:
out
=
out
or
'
No output.
'
print
(
'
SSH access is not working (code: %s):
\n
%s
'
%
(
status
,
out
))
return
False
...
...
@@ -50,7 +53,7 @@ if os.path.isfile('../utils.py'):
es_utils
=
imp
.
load_source
(
'
es_utils
'
,
'
../utils.py
'
)
conf
=
es_utils
.
load_conf
()
BURP_SERVER
=
conf
.
get
(
'
BURP_SERVER
'
)
BURP_CLIENT_NAME
=
conf
.
get
(
'
BURP_CLIENT_NAME
'
,
'
localhost
'
)
BURP_CLIENT_NAME
=
conf
.
get
(
'
BURP_CLIENT_NAME
'
)
or
'
localhost
'
if
BURP_SERVER
:
if
not
test_ssh
(
BURP_SERVER
):
print
(
'
Failed to ssh into backup server
'
)
...
...
@@ -61,7 +64,8 @@ if os.path.isfile('../utils.py'):
else
:
sys
.
exit
(
0
)
else
:
print
(
'
No BURP_SERVER defined in config, untestable
'
)
sys
.
exit
(
2
)
else
:
print
(
'
No BURP_SERVER defined in
config, untestable
'
)
print
(
'
Unable to load
config, untestable
'
)
sys
.
exit
(
2
)
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