Skip to content

Commit

Permalink
Merge pull request #2356 from wazuh/2355-fix-api-tests-full-green
Browse files Browse the repository at this point in the history
Fix autoconfigure `test_add_old_resource`
  • Loading branch information
snaow committed Dec 20, 2021
2 parents a733de0 + 344142a commit 3911a6b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions tests/integration/test_api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,18 @@ def wait_for_start(get_configuration, request):
@pytest.fixture(scope='module')
def get_api_details():
return get_api_details_dict


@pytest.fixture(scope='module')
def restart_api_module(request):
# Stop Wazuh and Wazuh API
control_service('stop')
control_service('start')


@pytest.fixture(scope='module')
def wait_for_start_module(request):
# Wait for API to start
file_monitor = FileMonitor(API_LOG_FILE_PATH)
file_monitor.start(timeout=20, callback=callback_detect_api_start,
error_message='Did not receive expected "INFO: Listening on ..." event')
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

# Tests
@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning')
def test_add_old_user(set_security_resources, get_api_details):
def test_add_old_user(restart_api_module, wait_for_start_module, set_security_resources, get_api_details):
'''
description: Check if the security relationships of a previous user are maintained
in the system after adding a new user with the same ID.
Expand Down

0 comments on commit 3911a6b

Please sign in to comment.