Esempio n. 1
0
def fixture_background(session_browser):
    """Login and install the app."""
    functional.login(session_browser)
    functional.install(session_browser, 'syncthing')
    functional.app_enable(session_browser, 'syncthing')
    yield
    functional.app_disable(session_browser, 'syncthing')
Esempio n. 2
0
 def test_set_tor_relay_configuration(self, session_browser):
     """Test setting Tor relay configuration."""
     functional.app_enable(session_browser, 'tor')
     _feature_enable(session_browser, 'relay', should_enable=False)
     _feature_enable(session_browser, 'relay', should_enable=True)
     _assert_feature_enabled(session_browser, 'relay', enabled=True)
     assert 'orport' in _get_relay_ports(session_browser)
Esempio n. 3
0
 def test_notifications(self, session_browser):
     """Test that authentication and usage reporting notifications are not
     shown."""
     functional.app_enable(session_browser, self.app_name)
     functional.access_url(session_browser, self.app_name)
     _assert_usage_report_notification_not_shown(session_browser)
     _assert_authentication_notification_not_shown(session_browser)
Esempio n. 4
0
def test_post(session_browser):
    """Test writing a blog post."""
    functional.app_enable(session_browser, 'wordpress')
    _write_post(session_browser, 'FunctionalTest')
    assert _get_post(session_browser, 'FunctionalTest')
    _delete_post(session_browser, 'FunctionalTest')
    assert not _get_post(session_browser, 'FunctionalTest')
Esempio n. 5
0
    def test_set_forwarders(self, session_browser):
        """Test setting forwarders."""
        functional.app_enable(session_browser, 'bind')
        functional.set_forwarders(session_browser, '1.1.1.1')

        functional.set_forwarders(session_browser, '1.1.1.1 1.0.0.1')
        assert functional.get_forwarders(session_browser) == '1.1.1.1 1.0.0.1'
Esempio n. 6
0
    def test_backup_restore(self, session_browser):
        """Test backup and restore of app data."""
        functional.app_enable(session_browser, 'openvpn')
        profile = _download_profile(session_browser)
        functional.backup_create(session_browser, 'openvpn', 'test_openvpn')

        functional.backup_restore(session_browser, 'openvpn', 'test_openvpn')
        _profile_download_compare(session_browser, profile)
Esempio n. 7
0
 def test_backup_restore(self, session_browser):
     """Test backing up and restoring."""
     functional.app_enable(session_browser, 'calibre')
     _add_library(session_browser, 'FunctionalTest')
     functional.backup_create(session_browser, 'calibre', 'test_calibre')
     _delete_library(session_browser, 'FunctionalTest')
     functional.backup_restore(session_browser, 'calibre', 'test_calibre')
     assert _is_library_available(session_browser, 'FunctionalTest')
Esempio n. 8
0
 def fixture_background(self, session_browser):
     functional.login(session_browser)
     functional.set_advanced_mode(session_browser, True)
     functional.install(session_browser, self.app_name)
     functional.app_enable(session_browser, self.app_name)
     yield
     functional.login(session_browser)
     functional.app_disable(session_browser, self.app_name)
Esempio n. 9
0
    def test_message_archive_management(self, session_browser):
        """Test enabling message archive management."""
        functional.app_enable(session_browser, 'ejabberd')
        _enable_message_archive_management(session_browser)
        assert functional.service_is_running(session_browser, 'ejabberd')

        _disable_message_archive_management(session_browser)
        assert functional.service_is_running(session_browser, 'ejabberd')
Esempio n. 10
0
def test_backup(session_browser):
    """Test backing up and restoring."""
    functional.app_enable(session_browser, 'wordpress')
    _write_post(session_browser, 'FunctionalTest')
    functional.backup_create(session_browser, 'wordpress', 'test_wordpress')
    _delete_post(session_browser, 'FunctionalTest')
    functional.backup_restore(session_browser, 'wordpress', 'test_wordpress')
    assert _get_post(session_browser, 'FunctionalTest')
Esempio n. 11
0
def fixture_background(session_browser):
    """Login and install the app."""
    functional.login(session_browser)
    functional.install(session_browser, 'bind')
    functional.app_enable(session_browser, 'bind')
    yield
    functional.app_disable(session_browser, 'bind')
    _backup_schedule_disable(session_browser)
Esempio n. 12
0
def test_users_can_connect_passwordless_over_ssh(session_browser,
                                                 tmp_path_factory):
    """Test that users can connect passwordless over ssh if the keys are
    set."""
    functional.app_enable(session_browser, 'ssh')
    _generate_ssh_keys(session_browser, tmp_path_factory)
    _configure_ssh_keys(session_browser, tmp_path_factory)
    _should_connect_passwordless_over_ssh(session_browser, tmp_path_factory)
Esempio n. 13
0
def test_change_home_page(session_browser):
    """Test changing webserver home page."""
    functional.install(session_browser, 'syncthing')
    functional.app_enable(session_browser, 'syncthing')
    _set_home_page(session_browser, 'syncthing')

    _set_home_page(session_browser, 'plinth')
    assert _check_home_page_redirect(session_browser, 'plinth')
Esempio n. 14
0
def test_enable_disable(session_browser):
    """Test enabling the app."""
    functional.app_disable(session_browser, APP_ID)

    functional.app_enable(session_browser, APP_ID)
    assert functional.service_is_running(session_browser, APP_ID)

    functional.app_disable(session_browser, APP_ID)
    assert functional.service_is_not_running(session_browser, APP_ID)
Esempio n. 15
0
    def test_backup_and_restore(self, session_browser):
        functional.app_enable(session_browser, 'bepasty')
        password_added = _add_and_save_password(session_browser)
        functional.backup_create(session_browser, 'bepasty', 'test_bepasty')

        _remove_all_passwords(session_browser)
        functional.backup_restore(session_browser, 'bepasty', 'test_bepasty')

        assert functional.is_available(session_browser, 'bepasty')
        assert _can_login(session_browser, password_added)
Esempio n. 16
0
def test_enable_disable(session_browser):
    """Test enabling the app."""
    functional.app_disable(session_browser, 'searx')

    functional.app_enable(session_browser, 'searx')
    assert functional.is_available(session_browser, 'searx')
    _is_search_form_visible(session_browser)

    functional.app_disable(session_browser, 'searx')
    assert not functional.is_available(session_browser, 'searx')
Esempio n. 17
0
    def test_add_delete_library(self, session_browser):
        """Test adding/deleting a new library."""
        functional.app_enable(session_browser, 'calibre')
        _delete_library(session_browser, 'FunctionalTest', True)

        _add_library(session_browser, 'FunctionalTest')
        assert _is_library_available(session_browser, 'FunctionalTest')

        _delete_library(session_browser, 'FunctionalTest')
        assert not _is_library_available(session_browser, 'FunctionalTest')
Esempio n. 18
0
    def test_backup_restore(self, session_browser):
        """Test backup and restore of app data."""
        functional.app_enable(session_browser, 'ejabberd')
        _jsxc_add_contact(session_browser)
        functional.backup_create(session_browser, 'ejabberd', 'test_ejabberd')

        _jsxc_delete_contact(session_browser)
        functional.backup_restore(session_browser, 'ejabberd', 'test_ejabberd')

        _jsxc_assert_has_contact(session_browser)
Esempio n. 19
0
    def test_backup_restore(self, session_browser):
        """Test backup and restore of app data."""
        functional.app_enable(session_browser, 'ikiwiki')
        _create_wiki_if_needed(session_browser)
        functional.backup_create(session_browser, 'ikiwiki', 'test_ikiwiki')

        _delete_wiki(session_browser)
        functional.backup_restore(session_browser, 'ikiwiki', 'test_ikiwiki')

        assert _wiki_exists(session_browser)
Esempio n. 20
0
    def test_enable_disable_dnssec(self, session_browser):
        """Test enabling/disabling DNSSEC."""
        functional.app_enable(session_browser, 'bind')
        _enable_dnssec(session_browser, False)

        _enable_dnssec(session_browser, True)
        assert _get_dnssec(session_browser)

        _enable_dnssec(session_browser, False)
        assert not _get_dnssec(session_browser)
Esempio n. 21
0
    def test_backup_restore(self, session_browser):
        """Test backup and restore."""
        functional.app_enable(session_browser, 'deluge')
        _remove_all_torrents(session_browser)
        _upload_sample_torrent(session_browser)
        functional.backup_create(session_browser, 'deluge', 'test_deluge')

        _remove_all_torrents(session_browser)
        functional.backup_restore(session_browser, 'deluge', 'test_deluge')
        assert functional.service_is_running(session_browser, 'deluge')
        assert _get_number_of_torrents(session_browser) == 1
Esempio n. 22
0
    def test_add_remove_folder(self, session_browser):
        """Test adding and removing a folder."""
        functional.app_enable(session_browser, self.app_name)
        if _folder_is_present(session_browser, 'Test'):
            _remove_folder(session_browser, 'Test')

        _add_folder(session_browser, 'Test', '/tmp')
        assert _folder_is_present(session_browser, 'Test')

        _remove_folder(session_browser, 'Test')
        assert not _folder_is_present(session_browser, 'Test')
Esempio n. 23
0
def test_enable_disable(session_browser):
    """Test enabling the app."""
    functional.app_disable(session_browser, 'wordpress')

    functional.app_enable(session_browser, 'wordpress')
    assert functional.service_is_running(session_browser, 'wordpress')
    assert functional.is_available(session_browser, 'wordpress')

    functional.app_disable(session_browser, 'wordpress')
    assert functional.service_is_not_running(session_browser, 'wordpress')
    assert not functional.is_available(session_browser, 'wordpress')
Esempio n. 24
0
def test_backup_restore(session_browser):
    """Test backup and restore of app data."""
    functional.app_enable(session_browser, APP_ID)
    _subscribe(session_browser)
    functional.backup_create(session_browser, APP_ID, 'test_ttrss')

    _unsubscribe(session_browser)
    functional.backup_restore(session_browser, APP_ID, 'test_ttrss')

    assert functional.service_is_running(session_browser, APP_ID)
    assert _is_subscribed(session_browser)
Esempio n. 25
0
    def test_backup_restore(self, session_browser):
        """Test backup and restore of configuration."""
        functional.app_enable(session_browser, 'radicale')
        _set_access_rights(session_browser, 'owner_only')
        functional.backup_create(session_browser, 'radicale', 'test_radicale')

        _set_access_rights(session_browser, 'owner_write')
        functional.backup_restore(session_browser, 'radicale', 'test_radicale')

        assert functional.service_is_running(session_browser, 'radicale')
        assert _get_access_rights(session_browser) == 'owner_only'
Esempio n. 26
0
 def test_set_tor_hidden_services_configuration(self, session_browser):
     """Test setting Tor hidden services configuration."""
     functional.app_enable(session_browser, 'tor')
     _feature_enable(session_browser,
                     'hidden-services',
                     should_enable=False)
     _feature_enable(session_browser, 'hidden-services', should_enable=True)
     _assert_feature_enabled(session_browser,
                             'hidden-services',
                             enabled=True)
     _assert_hidden_services(session_browser)
Esempio n. 27
0
    def test_backup_restore(self, session_browser):
        """Test backup and restore."""
        functional.app_enable(session_browser, 'bind')
        functional.set_forwarders(session_browser, '1.1.1.1')
        _enable_dnssec(session_browser, False)
        functional.backup_create(session_browser, 'bind', 'test_bind')

        functional.set_forwarders(session_browser, '1.0.0.1')
        _enable_dnssec(session_browser, True)

        functional.backup_restore(session_browser, 'bind', 'test_bind')
        assert functional.get_forwarders(session_browser) == '1.1.1.1'
        assert not _get_dnssec(session_browser)
Esempio n. 28
0
    def test_add_delete_book(self, session_browser):
        """Test adding/delete book in the library."""
        functional.app_enable(session_browser, 'calibre')
        _add_library(session_browser, 'FunctionalTest')
        _delete_book(session_browser, 'FunctionalTest', 'sample.txt', True)

        _add_book(session_browser, 'FunctionalTest', 'sample.txt')
        assert _is_book_available(session_browser, 'FunctionalTest',
                                  'sample.txt')

        _delete_book(session_browser, 'FunctionalTest', 'sample.txt')
        assert not _is_book_available(session_browser, 'FunctionalTest',
                                      'sample.txt')
Esempio n. 29
0
def test_preserve_public_access_setting(session_browser):
    """Test that public access setting is preserved when disabling and
    re-enabling the app."""
    functional.login(session_browser)
    functional.app_enable(session_browser, 'searx')
    _enable_public_access(session_browser)

    functional.app_disable(session_browser, 'searx')
    functional.app_enable(session_browser, 'searx')
    functional.logout(session_browser)

    assert functional.is_visible_on_front_page(session_browser, 'searx')
    assert functional.is_available(session_browser, 'searx')
Esempio n. 30
0
    def test_configure(self, session_browser):
        """Test pagekite configuration."""
        functional.app_enable(session_browser, 'pagekite')
        _configure(session_browser, 'pagekite.example.com', 8080,
                   'mykite.example.com', 'mysecret')
        assert ('pagekite.example.com', 8080, 'mykite.example.com',
                'mysecret') == _get_configuration(session_browser)

        # Capitalized kite name should become lower case.
        _configure(session_browser, 'pagekite.example.com', 8080,
                   'Mykite.example.com', 'mysecret')
        assert ('pagekite.example.com', 8080, 'mykite.example.com',
                'mysecret') == _get_configuration(session_browser)