Esempio n. 1
0
    def test_rhsso_timeout_using_hammer(
        self,
        enable_external_auth_rhsso,
        rhsso_setting_setup_with_timeout,
        rh_sso_hammer_auth_setup,
    ):
        """verify the hammer auth timeout using RHSSO auth source

        :id: d014cc98-d198-11ea-b526-d46d6dd3b5b2

        :expectedresults: hammer auth login timeout should be suceessful for a rhsso user

        :CaseImportance: Medium
        """
        result = AuthLogin.oauth({
            'oidc-token-endpoint':
            get_oidc_token_endpoint(),
            'oidc-client-id':
            get_oidc_client_id(),
            'username':
            settings.rhsso.rhsso_user,
            'password':
            settings.rhsso.password,
        })
        assert f"Successfully logged in as '{settings.rhsso.rhsso_user}'." == result[
            0]['message']
        sleep(70)
        with pytest.raises(CLIReturnCodeError) as error:
            Task.with_user(username=settings.rhsso.rhsso_user,
                           password=settings.rhsso.password).list()
        assert 'Unable to authenticate user sat_admin' in error.value.message
Esempio n. 2
0
    def test_rhsso_login_using_hammer(self, enable_external_auth_rhsso,
                                      rhsso_setting_setup,
                                      rh_sso_hammer_auth_setup):
        """verify the hammer auth login using RHSSO auth source

        :id: 56c09a1a-d0e5-11ea-9024-d46d6dd3b5b2

        :expectedresults: hammer auth login should be suceessful for a rhsso user

        :CaseImportance: High
        """
        result = AuthLogin.oauth({
            'oidc-token-endpoint':
            get_oidc_token_endpoint(),
            'oidc-client-id':
            get_oidc_client_id(),
            'username':
            settings.rhsso.rhsso_user,
            'password':
            settings.rhsso.password,
        })
        assert f"Successfully logged in as '{settings.rhsso.rhsso_user}'." == result[
            0]['message']
        result = Auth.with_user(username=settings.rhsso.rhsso_user,
                                password=settings.rhsso.password).status()
        assert (
            f"Session exists, currently logged in as '{settings.rhsso.rhsso_user}'."
            == result[0]['message'])
        task_list = Task.with_user(username=settings.rhsso.rhsso_user,
                                   password=settings.rhsso.password).list()
        assert len(task_list) >= 0
        with pytest.raises(CLIReturnCodeError) as error:
            Role.with_user(username=settings.rhsso.rhsso_user,
                           password=settings.rhsso.password).list()
        assert 'Missing one of the required permissions' in error.value.message