Ejemplo n.º 1
0
    def get_install_path():
        """Get Wazuh installation path, obtained relative to the path of this file

        Returns:
            str: install_path
        """
        return common.find_wazuh_path()
Ejemplo n.º 2
0
 def __init__(self, credentials_file: str, project: str,
              subscription_id: str):
     """Instantiate a WazuhGCloudSubscriber object.
     :params credentials_file: Path to credentials file
     :params project: Project name
     :params subscription_id: Subscription ID
     """
     # get Wazuh paths
     self.wazuh_path = common.find_wazuh_path()
     self.wazuh_queue = tools.get_wazuh_queue()
     self.wazuh_version = common.get_wazuh_version()
     # get subscriber
     self.subscriber = self.get_subscriber_client(credentials_file).api
     self.subscription_path = self.get_subscription_path(project,
                                                         subscription_id)
Ejemplo n.º 3
0
def get_wazuh_queue() -> str:
    """Get Wazuh queue"""
    return os.path.join(common.find_wazuh_path(), 'queue', 'ossec', 'queue')
Ejemplo n.º 4
0
def test_find_wazuh_path_relative_path():
    with patch('os.path.abspath', return_value='~/framework'):
        assert(find_wazuh_path() == '~')
Ejemplo n.º 5
0
def test_find_wazuh_path(fake_path, expected):
    with patch('wazuh.core.common.__file__', new=fake_path):
        assert(find_wazuh_path() == expected)