-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New ITs changes requested implemented
- Loading branch information
1 parent
0a532b2
commit 016ced1
Showing
5 changed files
with
160 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/integration/test_logcollector/test_macos/conftest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (C) 2015-2021, Wazuh Inc. | ||
# Created by Wazuh, Inc. <info@wazuh.com>. | ||
# This program is free software; you can redistribute it and/or modify it under the terms of GPLv2 | ||
|
||
import pytest | ||
|
||
from wazuh_testing.tools import LOGCOLLECTOR_FILE_STATUS_PATH, LOG_FILE_PATH | ||
from wazuh_testing.tools.services import control_service | ||
from wazuh_testing.tools.file import truncate_file | ||
from os.path import exists | ||
from os import remove | ||
|
||
|
||
required_test_daemons = ['wazuh-agentd', 'wazuh-modulesd', 'wazuh-logcollector'] | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def restart_required_logcollector_test_daemons(): | ||
"""Wazuh logcollector daemons handler.""" | ||
|
||
for daemon in required_test_daemons: | ||
control_service('stop', daemon=daemon) | ||
|
||
truncate_file(LOG_FILE_PATH) | ||
remove(LOGCOLLECTOR_FILE_STATUS_PATH) if exists(LOGCOLLECTOR_FILE_STATUS_PATH) else None | ||
|
||
for daemon in required_test_daemons: | ||
control_service('start', daemon=daemon) | ||
|
||
yield | ||
|
||
for daemon in required_test_daemons: | ||
control_service('stop', daemon=daemon) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.