Skip to content
Snippets Groups Projects
Commit 540e7454 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

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
...@@ -7,14 +7,28 @@ Check that the updates server is reachable and that the system is still under su ...@@ -7,14 +7,28 @@ Check that the updates server is reachable and that the system is still under su
import os import os
import re import re
import requests import requests
import subprocess
import sys 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 # SkyReach APT file test
apt_source = '/etc/apt/sources.list.d/skyreach.list' apt_source = '/etc/apt/sources.list.d/skyreach.list'
if not os.path.exists(apt_source): if not os.path.exists(apt_source):
print('The file "%s" does not 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: with open(apt_source, 'r') as fo:
content = fo.read() content = fo.read()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment