Пример #1
0
    def test_all_repos_private(self, session_browser):
        """Test repo accessability when all repos are private."""
        _create_repo(session_browser,
                     'Test-repo',
                     'private',
                     ok_if_exists=True)
        _set_all_repos_private(session_browser)
        if not functional.user_exists(session_browser, 'gitweb_user'):
            functional.create_user(session_browser,
                                   'gitweb_user',
                                   groups=['git-access'])
        if not functional.user_exists(session_browser, 'nogroupuser'):
            functional.create_user(session_browser, 'nogroupuser', groups=[])

        functional.login_with_account(session_browser, functional.base_url,
                                      'gitweb_user')
        assert functional.is_available(session_browser, 'gitweb')
        assert len(functional.find_on_front_page(session_browser,
                                                 'gitweb')) == 1

        functional.login_with_account(session_browser, functional.base_url,
                                      'nogroupuser')
        assert not functional.is_available(session_browser, 'gitweb')
        assert len(functional.find_on_front_page(session_browser,
                                                 'gitweb')) == 0

        functional.logout(session_browser)
        functional.access_url(session_browser, 'gitweb')
        assert functional.is_login_prompt(session_browser)
        assert len(functional.find_on_front_page(session_browser,
                                                 'gitweb')) == 0
Пример #2
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')
Пример #3
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')
Пример #4
0
def test_public_access(session_browser):
    """Test enabling public access."""
    functional.app_enable(session_browser, 'searx')

    # Enable public access
    _enable_public_access(session_browser)
    functional.logout(session_browser)
    assert functional.is_visible_on_front_page(session_browser, 'searx')
    assert functional.is_available(session_browser, 'searx')

    # Disable public access
    functional.login(session_browser)
    _disable_public_access(session_browser)
    functional.logout(session_browser)
    assert not functional.is_visible_on_front_page(session_browser, 'searx')
    assert not functional.is_available(session_browser, 'searx')
Пример #5
0
 def test_backup_restore(self, session_browser):
     """Test backing up and restoring."""
     _create_repo(session_browser, 'Test-repo', ok_if_exists=True)
     functional.backup_create(session_browser, 'gitweb', 'test_gitweb')
     _delete_repo(session_browser, 'Test-repo')
     functional.backup_restore(session_browser, 'gitweb', 'test_gitweb')
     assert _repo_exists(session_browser, 'Test-repo')
     assert functional.is_available(session_browser, 'gitweb')
Пример #6
0
def test_app_access(session_browser):
    """Test that only logged-in users can access Syncthing web interface."""
    functional.logout(session_browser)
    functional.access_url(session_browser, 'syncthing')
    assert functional.is_login_prompt(session_browser)

    functional.login(session_browser)
    functional.access_url(session_browser, 'syncthing')
    assert functional.is_available(session_browser, 'syncthing')
Пример #7
0
    def test_bittorrent_group(self, session_browser):
        """Test if only users in bit-torrent group can access Deluge."""
        functional.app_enable(session_browser, 'deluge')
        if not functional.user_exists(session_browser, 'delugeuser'):
            functional.create_user(session_browser, 'delugeuser',
                                   groups=['bit-torrent'])

        if not functional.user_exists(session_browser, 'nogroupuser'):
            functional.create_user(session_browser, 'nogroupuser')

        functional.login_with_account(session_browser, functional.base_url,
                                      'delugeuser')
        assert functional.is_available(session_browser, 'deluge')

        functional.login_with_account(session_browser, functional.base_url,
                                      'nogroupuser')
        assert not functional.is_available(session_browser, 'deluge')

        functional.login(session_browser)
Пример #8
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)
Пример #9
0
    def test_user_group_access(self, session_browser):
        """Test that only users in syncthing-access group can access syncthing
        site."""
        functional.app_enable(session_browser, self.app_name)
        if not functional.user_exists(session_browser, 'syncthinguser'):
            functional.create_user(session_browser, 'syncthinguser',
                                   groups=['syncthing-access'])
        if not functional.user_exists(session_browser, 'nogroupuser'):
            functional.create_user(session_browser, 'nogroupuser')

        functional.login_with_account(session_browser, functional.base_url,
                                      'syncthinguser')
        assert functional.is_available(session_browser, self.app_name)

        functional.login_with_account(session_browser, functional.base_url,
                                      'nogroupuser')
        assert not functional.is_available(session_browser, self.app_name)

        functional.login(session_browser)
Пример #10
0
def test_share_permissions(session_browser):
    """Test share permissions."""
    _remove_share(session_browser, 'tmp')
    _add_share(session_browser, 'tmp', '/tmp', 'syncthing-access')
    _verify_share(session_browser, 'tmp', '/tmp', 'syncthing-access')
    _verify_inaccessible_share(session_browser, 'tmp')

    _make_share_public(session_browser, 'tmp')
    functional.logout(session_browser)
    assert functional.is_available(session_browser, 'share_tmp')
    functional.login(session_browser)
Пример #11
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')
Пример #12
0
def test_backup_restore(session_browser):
    """Test backup and restore."""
    functional.app_enable(session_browser, 'searx')
    functional.backup_create(session_browser, 'searx', 'test_searx')
    functional.backup_restore(session_browser, 'searx', 'test_searx')
    assert functional.is_available(session_browser, 'searx')
Пример #13
0
def site_should_not_be_available(session_browser, site_name):
    assert not functional.is_available(session_browser, site_name)
Пример #14
0
def test_backup(session_browser):
    """Test backing up and restoring."""
    functional.backup_create(session_browser, 'jsxc', 'test_jsxc')
    functional.backup_restore(session_browser, 'jsxc', 'test_jsxc')
    assert functional.is_available(session_browser, 'jsxc')
Пример #15
0
def test_install(session_browser):
    """Test installing the app."""
    functional.install(session_browser, 'jsxc')
    assert functional.is_available(session_browser, 'jsxc')