mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
ejabberd: Set hostname for test that relies on it
The test uses freedombox.local as the domain. This requires that Avahi is enabled, and the hostname is set to freedombox. Fixes #2232. Test: - ejabberd functional tests pass even after running tests for config and avahi. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
18a79e1420
commit
fd3166442f
@ -20,7 +20,7 @@ def fixture_background(session_browser):
|
||||
|
||||
def test_change_hostname(session_browser):
|
||||
"""Test changing the hostname."""
|
||||
_set_hostname(session_browser, 'mybox')
|
||||
functional.set_hostname(session_browser, 'mybox')
|
||||
assert _get_hostname(session_browser) == 'mybox'
|
||||
|
||||
|
||||
@ -49,13 +49,6 @@ def _get_hostname(browser):
|
||||
return browser.find_by_id('id_hostname').value
|
||||
|
||||
|
||||
def _set_hostname(browser, hostname):
|
||||
functional.nav_to_module(browser, 'config')
|
||||
browser.find_by_id('id_hostname').fill(hostname)
|
||||
update_setup = browser.find_by_css('.btn-primary')
|
||||
functional.submit(browser, element=update_setup)
|
||||
|
||||
|
||||
def _get_domain_name(browser):
|
||||
functional.nav_to_module(browser, 'config')
|
||||
return browser.find_by_id('id_domainname').value
|
||||
|
||||
@ -29,6 +29,8 @@ class TestEjabberdApp(functional.BaseAppTests):
|
||||
def test_add_remove_domain(self, session_browser):
|
||||
"""Test adding and removing a domain."""
|
||||
functional.app_enable(session_browser, 'ejabberd')
|
||||
functional.app_enable(session_browser, 'avahi')
|
||||
functional.set_hostname(session_browser, 'freedombox')
|
||||
_enable_domain(session_browser, 'freedombox.local')
|
||||
|
||||
_disable_domain(session_browser, 'freedombox.local')
|
||||
|
||||
@ -463,6 +463,13 @@ def running_inside_container():
|
||||
##############################
|
||||
# System -> Config utilities #
|
||||
##############################
|
||||
def set_hostname(browser, hostname):
|
||||
nav_to_module(browser, 'config')
|
||||
browser.find_by_id('id_hostname').fill(hostname)
|
||||
update_setup = browser.find_by_css('.btn-primary')
|
||||
submit(browser, element=update_setup)
|
||||
|
||||
|
||||
def set_advanced_mode(browser, mode):
|
||||
nav_to_module(browser, 'config')
|
||||
advanced_mode = browser.find_by_id('id_advanced_mode')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user