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
43636ecb
Commit
43636ecb
authored
4 years ago
by
Antoine SCHILDKNECHT
Browse files
Options
Downloads
Patches
Plain Diff
Update wowza test | refs
#33160
parent
730c535a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/pkgs_envsetup.py
+2
-0
2 additions, 0 deletions
tests/pkgs_envsetup.py
tests/scripts/test_wowza.py
+42
-11
42 additions, 11 deletions
tests/scripts/test_wowza.py
with
44 additions
and
11 deletions
tests/pkgs_envsetup.py
+
2
−
0
View file @
43636ecb
...
...
@@ -9,6 +9,8 @@ PACKAGES = [
"
python3-dnspython
"
,
# for: test_caches
"
python3-openssl
"
,
# for: test_ssl
"
python3-psutil
"
,
# for: test_wowza
"
python3-packaging
"
,
# for: test_wowza
"
python3-lxml
"
,
# for: test_wowza
"
python3-psycopg2
"
,
# for: test_postgresql
"
python3-pydbus
"
,
# for: test_dns_records
"
python3-requests
"
,
# for: test_nginx_status, test_nginx_vhosts, test_ssl, test_apt_proxy, test_ubicast_packages_access
...
...
This diff is collapsed.
Click to expand it.
tests/scripts/test_wowza.py
+
42
−
11
View file @
43636ecb
...
...
@@ -9,16 +9,20 @@ from pathlib import Path
import
re
import
subprocess
# nosec: B404
import
sys
import
psutil
from
defusedxml.ElementTree
import
parse
from
psutil
import
net_connections
from
packaging.version
import
parse
as
parse_version
from
lxml
import
etree
sys
.
path
.
append
(
str
(
Path
(
__file__
).
parents
[
1
].
resolve
()))
# pylint: disable=wrong-import-position
from
utilities
import
logging
as
lg
# noqa: E402
LATEST_VERSION
=
"
4.7.7
"
LATEST_VERSION
=
"
4.8.5
"
WOWZA_TUNE_FILE
=
"
/usr/local/WowzaStreamingEngine/conf/Tune.xml
"
def
main
():
...
...
@@ -108,14 +112,21 @@ def check_version() -> tuple:
version
=
"
.
"
.
join
(
re
.
findall
(
r
"
\d
"
,
line
))
if
not
version
:
lg
.
error
(
"
cannot find
w
Wowza version
"
)
lg
.
error
(
"
cannot find Wowza version
"
)
errors
+=
1
if
version
!=
LATEST_VERSION
:
lg
.
warning
(
"
using outdated version: {}
"
.
format
(
version
))
warnings
+=
1
if
parse_version
(
version
)
<
parse_version
(
LATEST_VERSION
):
lg
.
info
(
"
using outdated version: {0} < {1} (recommended)
"
.
format
(
version
,
LATEST_VERSION
)
)
elif
parse_version
(
version
)
>
parse_version
(
LATEST_VERSION
):
lg
.
success
(
"
using newer version than the recommended: {0} > {1} (recommended)
"
.
format
(
version
,
LATEST_VERSION
)
)
else
:
lg
.
success
(
"
using recommended version: {}
"
.
format
(
LATEST_VERSION
))
lg
.
success
(
"
using
the
recommended version: {
0
}
"
.
format
(
version
))
return
warnings
,
errors
...
...
@@ -130,13 +141,33 @@ def check_heap_size() -> tuple:
warnings
=
0
errors
=
0
cmd
=
"
grep
'
<HeapSize>2000M</HeapSize>
'
/usr/local/WowzaStreamingEngine/conf/Tune.xml
"
check_heap
,
_
=
subprocess
.
getstatusoutput
(
cmd
)
if
check_heap
!=
0
:
lg
.
warning
(
"
not using recommended heap size
"
)
# Current total RAM extraction (in MB)
svmem
=
psutil
.
virtual_memory
()
total_ram
=
round
(
svmem
.
total
/
1024
/
1024
)
# Configuration of the recommended wowza heap size regarding available RAM
if
total_ram
>=
15000
:
recommended_heap_size
=
8000
elif
total_ram
>=
7000
:
recommended_heap_size
=
4000
else
:
recommended_heap_size
=
2000
# Configured wowza heap size extraction
tune_xml
=
etree
.
parse
(
WOWZA_TUNE_FILE
)
heap_size
=
tune_xml
.
find
(
'
Tune/HeapSize
'
).
text
[
0
:
-
1
]
if
int
(
heap_size
)
<
recommended_heap_size
:
lg
.
warning
(
"
not using recommended heap size: {0}M < {1}M (recommended)
"
.
format
(
int
(
heap_size
),
recommended_heap_size
)
)
warnings
+=
1
else
:
lg
.
success
(
"
using recommended heap size
"
)
lg
.
success
(
"
using recommended heap size or above: {0}M
"
.
format
(
int
(
heap_size
))
)
return
warnings
,
errors
...
...
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