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
9169af74
Commit
9169af74
authored
6 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Added Wowza test (refs
#27237
).
parent
3260de67
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_wowza.py
+75
-0
75 additions, 0 deletions
tests/test_wowza.py
with
75 additions
and
0 deletions
tests/test_wowza.py
0 → 100755
+
75
−
0
View file @
9169af74
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017, Florent Thiery
'''
Criticality: Normal
Checks that the streaming server (Wowza) is running correctly.
'''
import
re
import
subprocess
import
sys
YELLOW
=
'
\033
[93m
'
GREEN
=
'
\033
[92m
'
RED
=
'
\033
[91m
'
DEF
=
'
\033
[0m
'
LATEST_VERSION
=
'
4.7.7
'
def
check_wowza
():
# check if wowza is installed
print
(
'
Getting installed Wowza packages...
'
)
cmd
=
"
dpkg --get-selections
'
wowza*
'"
print
(
cmd
)
out
=
subprocess
.
getoutput
(
cmd
)
out
=
re
.
sub
(
r
'
\s+
'
,
'
'
,
out
)
print
(
out
)
if
'
install
'
not
in
out
:
print
(
'
Wowza is not installed, skipping test.
'
)
return
2
else
:
print
(
'
Wowza is installed.
'
)
# check wowza version
version
=
None
for
line
in
out
.
split
(
'
\n
'
):
if
'
install
'
in
line
:
if
version
:
print
(
'
%sMultiple versions of Wowza are installed.%s
'
%
(
RED
,
DEF
))
print
(
'
%sPlease remove unused versions.%s
'
%
(
RED
,
DEF
))
return
1
version
=
'
.
'
.
join
(
re
.
findall
(
r
'
\d
'
,
line
))
if
not
version
:
print
(
'
%sWowza version not found.%s
'
%
(
RED
,
DEF
))
return
1
code
=
0
if
version
!=
LATEST_VERSION
:
print
(
'
%sWowza is not using recommended version (current version: %s, recommended version: %s).%s
'
%
(
YELLOW
,
version
,
LATEST_VERSION
,
DEF
))
code
=
3
else
:
print
(
'
%sWowza is using the recommended version: %s.%s
'
%
(
GREEN
,
LATEST_VERSION
,
DEF
))
# check wowza heap size
print
(
'
Checking Wowza heap size...
'
)
p
=
subprocess
.
run
(
"
grep
'
<HeapSize>2000M</HeapSize>
'
/usr/local/WowzaStreamingEngine/conf/Tune.xml
"
,
shell
=
True
)
if
p
.
returncode
!=
0
:
print
(
'
%sWowza is not using recommended heap size (2000M) in configuration file
"
/usr/local/WowzaStreamingEngine/conf/Tune.xml
"
.%s
'
%
(
YELLOW
,
DEF
))
code
=
3
else
:
print
(
'
%sWowza is using recommended heap size (2000M).%s
'
%
(
GREEN
,
DEF
))
# check that wowza is running
print
(
'
Checking that Wowza is running...
'
)
out
=
subprocess
.
getoutput
(
'
systemctl status WowzaStreamingEngine
'
)
print
(
out
)
if
'
Active: active (running)
'
not
in
out
:
print
(
'
%sWowza is not running.%s
'
%
(
RED
,
DEF
))
code
=
1
else
:
print
(
'
%sWowza is running.%s
'
%
(
GREEN
,
DEF
))
return
code
if
__name__
==
'
__main__
'
:
sys
.
exit
(
check_wowza
())
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