Skip to content

Commit

Permalink
Enhacement
Browse files Browse the repository at this point in the history
  • Loading branch information
Paco committed Jan 28, 2021
1 parent 8a11d10 commit 83199bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions deps/wazuh_testing/wazuh_testing/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
API_LOG_FILE_PATH = None

else:
WAZUH_PATH = os.path.join("/", "var", "ossec")
if sys.platform == 'darwin':
WAZUH_PATH = os.path.join("/", "Library", "Ossec")
else:
WAZUH_PATH = os.path.join("/", "var", "ossec")

WAZUH_CONF = os.path.join(WAZUH_PATH, 'etc', 'ossec.conf')
WAZUH_API_CONF = os.path.join(WAZUH_PATH, 'api', 'configuration', 'api.yaml')
WAZUH_SECURITY_CONF = os.path.join(WAZUH_PATH, 'api', 'configuration', 'security', 'security.yaml')
Expand All @@ -43,7 +47,7 @@
if sys.platform == 'darwin' or sys.platform == 'win32' or sys.platform == 'sunos5':
WAZUH_SERVICE = 'wazuh.agent'
else:
type_ = _version = subprocess.check_output([WAZUH_PATH + "/bin/wazuh-control", "info", "-t"], stderr=subprocess.PIPE).decode('utf-8')
type_ = _version = subprocess.check_output([f"{WAZUH_PATH}/bin/wazuh-control", "info", "-t"], stderr=subprocess.PIPE).decode('utf-8')
WAZUH_SERVICE = 'wazuh-manager' if type_ == 'server' else 'wazuh-agent'

_data_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_wpk/test_wpk_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# 2. v4.1.0
def get_current_version():
if platform.system() == 'Linux':
_version = subprocess.check_output([WAZUH_PATH + "/bin/wazuh-control", "info", "-v"], stderr=subprocess.PIPE).decode('utf-8')
_version = subprocess.check_output([f"{WAZUH_PATH}/bin/wazuh-control", "info", "-v"], stderr=subprocess.PIPE).decode('utf-8')
return _version.replace("v", "")

else:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_wpk/test_wpk_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

def get_current_version():
if platform.system() == 'Linux':
_version = subprocess.check_output([WAZUH_PATH + "/bin/wazuh-control", "info", "-v"], stderr=subprocess.PIPE).decode('utf-8')
_version = subprocess.check_output([f"{WAZUH_PATH}/bin/wazuh-control", "info", "-v"], stderr=subprocess.PIPE).decode('utf-8')
return _version

MANAGER_VERSION = get_current_version()
Expand Down

0 comments on commit 83199bc

Please sign in to comment.