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
b3095c1c
Commit
b3095c1c
authored
7 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Changed worker test (refs
#21016
).
parent
01b5ad33
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_mediaworker.py
+20
-6
20 additions, 6 deletions
tests/test_mediaworker.py
with
20 additions
and
6 deletions
tests/test_mediaworker.py
+
20
−
6
View file @
b3095c1c
...
...
@@ -4,10 +4,11 @@
Criticality: High
Checks that MediaWorker can be reached using SSH and that it can reach the tasks server
'''
import
os
import
imp
import
sys
import
os
import
re
import
subprocess
import
sys
GREEN
=
'
\033
[92m
'
RED
=
'
\033
[91m
'
...
...
@@ -46,7 +47,7 @@ def check_ssh(ip):
def
run_tests
(
ip
):
print
(
'
Updating envsetup tests on MediaWorker.
'
)
cmd
=
'
ssh -t %s
cd
/root/envsetup
&& git pull
'
%
ip
cmd
=
'
ssh -t %s /root/envsetup
/update_envsetup.py
'
%
ip
os
.
system
(
cmd
)
print
(
'
Running envsetup tests on MediaWorker.
'
)
cmd
=
'
ssh -t %s /root/envsetup/tester.py
'
%
ip
...
...
@@ -61,9 +62,22 @@ def run_tests(ip):
def
check_celerity_connectivity
(
ip
):
h
=
conf
.
get
(
'
MS_SERVER_NAME
'
)
cmd
=
'
ssh %s curl -k https://%s:6200
'
%
(
ip
,
h
)
print
(
'
Checking celerity connectivity: %s
'
%
cmd
)
print
(
'
Getting celerity server url.
'
)
cmd
=
'
ssh -t %s cat /etc/celerity/config.py
'
%
ip
print
(
cmd
)
try
:
d
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
timeout
=
5
,
universal_newlines
=
True
)
except
subprocess
.
CalledProcessError
:
m
=
None
else
:
m
=
re
.
search
(
r
'
\nSERVER_URL\s*=\s*([:\/\'\"\-\_\.\w]+)
'
,
d
)
if
not
m
:
print
(
'
%sFailed to get celerity tasks server url from configuration in MediaWorker
"
%s
"
.%s
'
%
(
RED
,
ip
,
DEF
))
return
False
server_url
=
m
.
groups
()[
0
].
strip
(
'"
\'
'
)
print
(
'
Checking celerity connectivity.
'
)
cmd
=
'
ssh -t %s curl -k %s
'
%
(
ip
,
server_url
)
print
(
cmd
)
try
:
d
=
subprocess
.
check_output
(
cmd
,
shell
=
True
,
timeout
=
5
,
universal_newlines
=
True
)
except
subprocess
.
CalledProcessError
:
...
...
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