mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
diagnostics: Implement diagnostics for Plinth
- Note that while Plinth is running or not running, diagnostics can be run on the command line with --diagnose option to Plinth binary. That makes these tests just as useful as freedombox-setup testsuite.
This commit is contained in:
parent
c2e85a872e
commit
6b7de75b62
@ -21,7 +21,19 @@ Plinth module for system diagnostics
|
|||||||
|
|
||||||
from . import diagnostics
|
from . import diagnostics
|
||||||
from .diagnostics import init
|
from .diagnostics import init
|
||||||
|
from plinth import action_utils
|
||||||
|
|
||||||
__all__ = ['diagnostics', 'init']
|
__all__ = ['diagnostics', 'init']
|
||||||
|
|
||||||
depends = ['plinth.modules.system']
|
depends = ['plinth.modules.system']
|
||||||
|
|
||||||
|
|
||||||
|
def diagnose():
|
||||||
|
"""Run diagnostics and return the results."""
|
||||||
|
results = []
|
||||||
|
results.append(action_utils.diagnose_port_listening(8000, 'tcp4'))
|
||||||
|
results.append(action_utils.diagnose_port_listening(8000, 'tcp6'))
|
||||||
|
results.extend(action_utils.diagnose_url_on_all(
|
||||||
|
'http://{host}/plinth/', extra_options=['--no-check-certificate']))
|
||||||
|
|
||||||
|
return results
|
||||||
|
|||||||
@ -25,7 +25,6 @@ from django.conf.urls import patterns, url
|
|||||||
urlpatterns = patterns( # pylint: disable-msg=C0103
|
urlpatterns = patterns( # pylint: disable-msg=C0103
|
||||||
'plinth.modules.diagnostics.diagnostics',
|
'plinth.modules.diagnostics.diagnostics',
|
||||||
url(r'^sys/diagnostics/$', 'index', name='index'),
|
url(r'^sys/diagnostics/$', 'index', name='index'),
|
||||||
url(r'^sys/diagnostics/test/$', 'test', name='test'),
|
url(r'^sys/diagnostics/(?P<module_name>[a-z\-]+)/$', 'module',
|
||||||
url(r'^sys/diagnostics/module/(?P<module_name>[a-z\-]+)/$', 'module',
|
|
||||||
name='module'),
|
name='module'),
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user