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
540e7454
Commit
540e7454
authored
6 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Ignore ubicast package test if no ubicast service is installed.
parent
9a749b35
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_ubicast_packages_access.py
+15
-1
15 additions, 1 deletion
tests/test_ubicast_packages_access.py
with
15 additions
and
1 deletion
tests/test_ubicast_packages_access.py
+
15
−
1
View file @
540e7454
...
...
@@ -7,14 +7,28 @@ Check that the updates server is reachable and that the system is still under su
import
os
import
re
import
requests
import
subprocess
import
sys
try
:
from
requests.packages.urllib3.exceptions
import
InsecureRequestWarning
requests
.
packages
.
urllib3
.
disable_warnings
(
InsecureRequestWarning
)
except
ImportError
:
requests
.
packages
.
urllib3
.
disable_warnings
()
# SkyReach APT file test
apt_source
=
'
/etc/apt/sources.list.d/skyreach.list
'
if
not
os
.
path
.
exists
(
apt_source
):
print
(
'
The file
"
%s
"
does not exists.
'
%
apt_source
)
sys
.
exit
(
1
)
# Check if the test should return an error (if a UbiCast service is installed)
for
package
in
(
'
python3-mediaserver
'
,
'
python3-mediaserver-monitor
'
,
'
campus-manager
'
,
'
skyreach
'
,
'
celerity-workers
'
):
p
=
subprocess
.
run
([
'
dpkg
'
,
'
-s
'
,
package
],
stdout
=
subprocess
.
DEVNULL
,
stderr
=
subprocess
.
DEVNULL
)
if
p
.
returncode
==
0
:
sys
.
exit
(
1
)
# No service installed, return non testable status
print
(
'
No UbiCast service is installed, ignoring test result.
'
)
sys
.
exit
(
2
)
with
open
(
apt_source
,
'
r
'
)
as
fo
:
content
=
fo
.
read
()
...
...
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