Skip to content

Commit

Permalink
Add fixture to disable BFA
Browse files Browse the repository at this point in the history
  • Loading branch information
mshriver authored and JacobCallahan committed Feb 22, 2021
1 parent 24e9d28 commit 3e741ee
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
8 changes: 4 additions & 4 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"pytest_plugins.disable_rp_params",
# Fixtures
"pytest_fixtures.api_fixtures",
"pytest_fixtures.xdist",
"pytest_fixtures.broker",
"pytest_fixtures.xdist",
# Component Fixtures
"pytest_fixtures.satellite_auth",
"pytest_fixtures.sys_fixtures",
"pytest_fixtures.templatesync_fixtures",
"pytest_fixtures.ansible_fixtures",
"pytest_fixtures.oscap_fixtures",
"pytest_fixtures.satellite_auth",
"pytest_fixtures.sys_fixtures",
"pytest_fixtures.smartproxy_fixtures",
"pytest_fixtures.templatesync_fixtures",
"pytest_fixtures.user_fixtures",
"pytest_fixtures.upgrade_fixtures",
]
15 changes: 15 additions & 0 deletions pytest_fixtures/sys_fixtures.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
import pytest

from robottelo.config import settings
from robottelo.rhsso_utils import run_command
from robottelo.ssh import command as ssh_command


@pytest.fixture
def foreman_service_teardown():
"""stop and restart of foreman service"""
yield
run_command('foreman-maintain service start --only=foreman')


@pytest.fixture(autouse=True, scope="session")
def relax_bfa():
"""Relax BFA protection against failed login attempts
The robottelo.ssh.command should resolve the hostname for the current xdist worker
"""
if settings.server.hostname:
ssh_command(
f'hammer -u admin -p {settings.server.admin_password} '
'settings set --name "failed_login_attempts_limit" --value 0'
)
1 change: 0 additions & 1 deletion tests/foreman/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def test_name(request):
tests.foreman.ui.test_activationkey::test_positive_create
tests.foreman.api.test_errata::TestErrata::test_positive_list
"""
return request.node._nodeid

Expand Down

0 comments on commit 3e741ee

Please sign in to comment.