diagnostics: Use new component based API for all diagnostic tests

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-12-30 11:37:46 -05:00
1 parent 1f14c42af5
commit 2ebb565c92
43 files changed
+334 -616

No files matched your search

+8 -16
View File
@@ -21,7 +21,7 @@ FreedomBox app for repro.
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from plinth import action_utils, actions
from plinth import actions
from plinth import app as app_module
from plinth import frontpage, menu
from plinth.daemon import Daemon
@@ -98,7 +98,13 @@ class ReproApp(app_module.App):
webserver = Webserver('webserver-repro', 'repro-plinth')
self.add(webserver)
daemon = Daemon('daemon-repro', managed_services[0])
daemon = Daemon(
'daemon-repro', managed_services[0], listen_ports=[(5060, 'udp4'),
(5060, 'udp6'),
(5060, 'tcp4'),
(5060, 'tcp6'),
(5061, 'tcp4'),
(5061, 'tcp6')])
self.add(daemon)
@@ -127,17 +133,3 @@ def setup(helper, old_version=None):
helper.install(managed_packages)
helper.call('post', actions.superuser_run, 'repro', ['setup'])
helper.call('post', app.enable)
def diagnose():
"""Run diagnostics and return the results."""
results = []
results.append(action_utils.diagnose_port_listening(5060, 'udp4'))
results.append(action_utils.diagnose_port_listening(5060, 'udp6'))
results.append(action_utils.diagnose_port_listening(5060, 'tcp4'))
results.append(action_utils.diagnose_port_listening(5060, 'tcp6'))
results.append(action_utils.diagnose_port_listening(5061, 'tcp4'))
results.append(action_utils.diagnose_port_listening(5061, 'tcp6'))
return results