diff --git a/deps/wazuh_testing/wazuh_testing/data/keepalives.txt b/deps/wazuh_testing/wazuh_testing/data/keepalives.txt index 58adae393d..b5b6219643 100644 --- a/deps/wazuh_testing/wazuh_testing/data/keepalives.txt +++ b/deps/wazuh_testing/wazuh_testing/data/keepalives.txt @@ -1,36 +1,36 @@ mojave -#!-Darwin |snaow-imac.home |18.5.0 |Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 |x86_64 [Mac OS X|darwin: 10.14.4 (Mojave)] - Wazuh v3.11.0 / ab73af41699f13fdd81903b5f23d8d00 +#!-Darwin |snaow-imac.home |18.5.0 |Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 |x86_64 [Mac OS X|darwin: 10.14.4 (Mojave)] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":172.16.5.5 ubuntu12.04 -#!-Linux |agent-ubuntu12 |3.2.0-126-virtual |#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 |x86_64 [Ubuntu|ubuntu: 12.04.5 LTS, Precise Pangolin] - Wazuh v3.11.3 / ab73af41699f13fdd81903b5f23d8d00 +#!-Linux |agent-ubuntu12 |3.2.0-126-virtual |#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 |x86_64 [Ubuntu|ubuntu: 12.04.5 LTS, Precise Pangolin] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":172.16.5.6 ubuntu14.04 -#!-Linux |agent-ubuntu14 |3.13.0-170-generic |#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 |x86_64 [Ubuntu|ubuntu: 14.04.6 LTS, Trusty Tahr] - Wazuh v3.11.3 / ab73af41699f13fdd81903b5f23d8d00 +#!-Linux |agent-ubuntu14 |3.13.0-170-generic |#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 |x86_64 [Ubuntu|ubuntu: 14.04.6 LTS, Trusty Tahr] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":172.16.5.7 ubuntu16.04 -#!-Linux |agent-ubuntu16 |4.4.0-173-generic |#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 |x86_64 [Ubuntu|ubuntu: 16.04.6 LTS (Xenial Xerus)] - Wazuh v3.11.3 / ab73af41699f13fdd81903b5f23d8d00 +#!-Linux |agent-ubuntu16 |4.4.0-173-generic |#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 |x86_64 [Ubuntu|ubuntu: 16.04.6 LTS (Xenial Xerus)] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":172.16.5.8 ubuntu18.04 -#!-Linux |agent-ubuntu18 |4.15.0-76-generic |#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 |x86_64 [Ubuntu|ubuntu: 18.04.4 LTS (Bionic Beaver)] - Wazuh v3.11.3 / ab73af41699f13fdd81903b5f23d8d00 +#!-Linux |agent-ubuntu18 |4.15.0-76-generic |#220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 |x86_64 [Ubuntu|ubuntu: 18.04.4 LTS (Bionic Beaver)] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":172.16.5.9 debian7 -#!-Linux |agent-debian7 |3.16.0-9-amd64 |#1 SMP Debian 3.16.68-1 (2019-05-22) |x86_64 [Debian GNU/Linux|debian: 7 (wheezy)] - Wazuh v3.11.3 / ab73af41699f13fdd81903b5f23d8d00 +#!-Linux |agent-debian7 |3.16.0-9-amd64 |#1 SMP Debian 3.16.68-1 (2019-05-22) |x86_64 [Debian GNU/Linux|debian: 7 (wheezy)] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":10.0.2.15 debian8 -#!-Linux |agent-debian8 |3.16.0-9-amd64 |#1 SMP Debian 3.16.68-1 (2019-05-22) |x86_64 [Debian GNU/Linux|debian: 8 (jessie)] - Wazuh v4.1.0 / ab73af41699f13fdd81903b5f23d8d00 +#!-Linux |agent-debian8 |3.16.0-9-amd64 |#1 SMP Debian 3.16.68-1 (2019-05-22) |x86_64 [Debian GNU/Linux|debian: 8 (jessie)] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":10.0.2.15 debian9 -#!-Linux |agent-debian9 |4.9.0-12-amd64 |#1 SMP Debian 4.9.210-1 (2020-01-20) |x86_64 [Debian GNU/Linux|debian: 9 (stretch)] - Wazuh v3.11.3 / ab73af41699f13fdd81903b5f23d8d00 +#!-Linux |agent-debian9 |4.9.0-12-amd64 |#1 SMP Debian 4.9.210-1 (2020-01-20) |x86_64 [Debian GNU/Linux|debian: 9 (stretch)] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":10.0.2.15 debian10 -#!-Linux |agent-debian10 |4.9.0-12-amd64 |#1 SMP Debian 4.9.210-1 (2020-01-20) |x86_64 [Debian GNU/Linux|debian: 10 (buster)] - Wazuh v3.11.3 / ab73af41699f13fdd81903b5f23d8d00 +#!-Linux |agent-debian10 |4.9.0-12-amd64 |#1 SMP Debian 4.9.210-1 (2020-01-20) |x86_64 [Debian GNU/Linux|debian: 10 (buster)] - Wazuh / ab73af41699f13fdd81903b5f23d8d00 d6e3ac3e75ca0319af3e7c262776f331 merged.mg #"_agent_ip":10.0.2.15 diff --git a/deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py b/deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py index b7380604f4..35a690bdbf 100644 --- a/deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py +++ b/deps/wazuh_testing/wazuh_testing/tools/agent_simulator.py @@ -39,13 +39,16 @@ class Agent: def __init__(self, manager_address, cypher="aes", os=None, inventory_sample=None, rootcheck_sample= None, - id=None, name=None, key=None, version="3.12", + id=None, name=None, key=None, version="v3.12.0", fim_eps=None, fim_integrity_eps=None, authd_password=None): self.id = id self.name = name self.key = key - self.version = version + if version is not None: + self.long_version = version + ver_split = version.replace("v","").split(".") + self.short_version = f"{'.'.join(ver_split[:2])}" self.cypher = cypher self.os = os self.fim_eps = 1000 if fim_eps is None else fim_eps @@ -97,14 +100,12 @@ def set_os(self): # Set variables related to wpk simulated responses def set_wpk_variables(self, sha=None, upgrade_exec_result=None, upgrade_notification=False, upgrade_script_result=0, - stage_disconnect=None, version=None): + stage_disconnect=None): self.sha_key = sha self.upgrade_exec_result = upgrade_exec_result self.send_upgrade_notification = upgrade_notification self.upgrade_script_result = upgrade_script_result self.stage_disconnect = stage_disconnect - if version: - self.version = version # Set agent name def set_name(self): @@ -286,7 +287,7 @@ def processCommand(self, sender, message_list): self.stage_disconnect == 'clear_upgrade_result': self.stop_receive = 1 else: - if float(self.version) < 4.1 or command == 'lock_restart': + if self.short_version < "4.1" or command == 'lock_restart': sender.sendEvent(self.createEvent(f'#!-req {message_list[1]} ok ')) else: sender.sendEvent(self.createEvent(f'#!-req {message_list[1]} ' @@ -297,7 +298,7 @@ def processCommand(self, sender, message_list): if command == 'sha1' and self.stage_disconnect == 'sha1': self.stop_receive = 1 else: - if float(self.version) < 4.1: + if self.short_version < "4.1": sender.sendEvent(self.createEvent(f'#!-req {message_list[1]} ' f'ok {self.sha_key}')) else: @@ -310,7 +311,7 @@ def processCommand(self, sender, message_list): if command == 'upgrade' and self.stage_disconnect == 'upgrade': self.stop_receive = 1 else: - if float(self.version) < 4.1: + if self.short_version < "4.1": sender.sendEvent(self.createEvent( f'#!-req {message_list[1]} ok ' f'{self.upgrade_exec_result}')) @@ -353,6 +354,7 @@ def createKeepAlive(self): line = fp.readline() break line = fp.readline() + msg = msg.replace("",self.long_version) self.keep_alive_msg = self.createEvent(msg) def initializeModules(self): @@ -361,10 +363,10 @@ def initializeModules(self): if self.modules["rootcheck"]["status"] == "enabled": self.rootcheck = Rootcheck(self.rootcheck_sample) if self.modules["fim"]["status"] == "enabled": - self.fim = GeneratorFIM(self.id, self.name, self.version) + self.fim = GeneratorFIM(self.id, self.name, self.short_version) if self.modules["fim_integrity"]["status"] == "enabled": self.fim_integrity = GeneratorIntegrityFIM(self.id, self.name, - self.version) + self.short_version) class Inventory: @@ -621,11 +623,11 @@ def getAttributes(self): return attributes def formatMessage(self, message): - if self.agent_version == "3.12": + if self.agent_version >= "3.12": return '{0}:[{1}] ({2}) any->syscheck:{3}' \ .format(self.SYSCHECK_MQ, self.agent_id, self.agent_name, message) - if self.agent_version == "3.11": + else: # If first time generating. Send control message to simulate # end of FIM baseline. if self.baseline_completed == 0: @@ -636,7 +638,7 @@ def formatMessage(self, message): message) def generateMessage(self): - if self.agent_version == "3.12": + if self.agent_version >= "3.12": if self.event_type == "added": timestamp = int(time()) self.generateAttributes() @@ -667,7 +669,7 @@ def generateMessage(self): message = json.dumps({"type": "event", "data": data}) - if self.agent_version == "3.11": + else: self.generateAttributes() message = '{0}:{1}:{2}:{3}:{4}:{5}:{6}:{7}:{8}:{9} {10}'.format( self._size, self._mode, self._uid, self._gid, self._md5, @@ -879,7 +881,7 @@ def stop_rec(self): def create_agents(agents_number, manager_address, cypher, fim_eps=None, - authd_password=None, os=None): + authd_password=None, os=None, version=None): global agent_count # Read client.keys and create virtual agents agents = [] @@ -888,11 +890,14 @@ def create_agents(agents_number, manager_address, cypher, fim_eps=None, agent_os = os[agent] else: agent_os = None + + agent_version = version[agent] if version is not None else None + if authd_password is not None: agents.append(Agent(manager_address, cypher, fim_eps=fim_eps, - authd_password=authd_password, os=agent_os)) + authd_password=authd_password, os=agent_os, version=agent_version)) else: agents.append(Agent(manager_address, cypher, fim_eps=fim_eps, - os=agent_os)) + os=agent_os, version=agent_version)) agent_count = agent_count + 1 return agents diff --git a/tests/integration/README.md b/tests/integration/README.md index 551b15bcd2..6256e20b00 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -141,13 +141,19 @@ Finally, copy your `wazuh-qa` repository within your testing environment and you Our newest integration tests are located in `wazuh-qa/tests/integration/`. They are organized by capabilities: +- _test_agentd_ - _test_analysisd_ +- _test_api_ +- _test_authd_ - _test_cluster_ - _test_fim_ - _test_gcloud_ -- _test_mitre_ +- _test_logtest_ +- _test_rids_ +- _test_rootcheck_ +- _test_vulnerability_detector_ - _test_wazuh_db_ -- _test_sca_ +- _test_wpk_ Every group will have the following structure: @@ -367,6 +373,7 @@ python3 -m pytest [options] [file_or_dir] [file_or_dir] [...] is not met before the given time lapse. Some tests make use of this value and other has other fixed timeout that cannot be modified. - `--fim_mode`: Specify the mode of execution of the FIM tests. (ex. --fim_mode="scheduled"). To run the test in realtime and whodata the option must be specified twice: --fim_mode="realtime" --fim_mode="whodata". If the option is not specified, the test will run using scheduled, whodata and realtime. +- `--wpk_version`: Specify the WPK package version used to upgrade on WPK tests. (ex. --wpk_version=v4.2.0). Note: This field is required to execute any WPK test and the WPK package must be previously created in the [repository](packages-dev.wazuh.com/trash/wpk/). _Use `-h` to see the rest or check its [documentation](https://docs.pytest.org/en/latest/usage.html)._ diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index d81b58ef1f..985069dca6 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -173,6 +173,14 @@ def pytest_addoption(parser): type=str, help="run tests using a specific FIM mode" ) + parser.addoption( + "--wpk_version", + action="append", + metavar="wpk_version", + default=None, + type=str, + help="run tests using a specific WPK package version" + ) def pytest_configure(config): @@ -217,6 +225,8 @@ def pytest_configure(config): mode = ["scheduled", "whodata", "realtime"] global_parameters.fim_mode = mode + # Set WPK package version + global_parameters.wpk_version = config.getoption("--wpk_version") def pytest_html_results_table_header(cells): cells.insert(4, html.th('Tier', class_='sortable tier', col='tier')) diff --git a/tests/integration/test_api/test_config/test_behind_proxy_server/test_behind_proxy_server.py b/tests/integration/test_api/test_config/test_behind_proxy_server/test_behind_proxy_server.py index a84387e506..679c6f02db 100644 --- a/tests/integration/test_api/test_config/test_behind_proxy_server/test_behind_proxy_server.py +++ b/tests/integration/test_api/test_config/test_behind_proxy_server/test_behind_proxy_server.py @@ -35,6 +35,7 @@ def get_configuration(request): # Tests +@pytest.mark.xfail(reason='To be deprecated in https://github.com/wazuh/wazuh/issues/7006') @pytest.mark.parametrize('tags_to_apply', [ {'bps_enabled'}, {'bps_disabled'}, diff --git a/tests/integration/test_authd/test_authd_agents_ctx.py b/tests/integration/test_authd/test_authd_agents_ctx.py index b4b5b43ce2..81a48c6793 100644 --- a/tests/integration/test_authd/test_authd_agents_ctx.py +++ b/tests/integration/test_authd/test_authd_agents_ctx.py @@ -65,7 +65,6 @@ def get_configuration(request): def clean_agents_ctx(): clean_keys() clean_groups() - clean_agentinfo() clean_rids() clean_agents_timestamp() clean_diff() @@ -104,15 +103,6 @@ def clean_diff(): except Exception as e: print('Failed to delete %s. Reason: %s' % (diff_path, e)) -def clean_agentinfo(): - agentinfo_folder = os.path.join(WAZUH_PATH, 'queue', 'agent-info') - for filename in os.listdir(agentinfo_folder): - file_path = os.path.join(agentinfo_folder, filename) - try: - os.unlink(file_path) - except Exception as e: - print('Failed to delete %s. Reason: %s' % (file_path, e)) - def clean_rids(): rids_folder = os.path.join(WAZUH_PATH, 'queue', 'rids') for filename in os.listdir(rids_folder): @@ -258,7 +248,7 @@ def register_agent_local_server(Name, Group=None, IP=None): # Tests def duplicate_ip_agent_delete_test(server): """Register a first agent, then register an agent with duplicated IP. - Check that client.keys, agent-info, agent-groups, agent-timestamp and agent diff were updated correctly + Check that client.keys, agent-groups, agent-timestamp and agent diff were updated correctly Parameters ---------- @@ -300,7 +290,7 @@ def duplicate_ip_agent_delete_test(server): def duplicate_name_agent_delete_test(server): """Register a first agent, then register an agent with duplicated Name. - Check that client.keys, agent-info, agent-groups, agent-timestamp and agent diff were updated correctly + Check that client.keys, agent-groups, agent-timestamp and agent diff were updated correctly Parameters ---------- diff --git a/tests/integration/test_cluster/test_key_polling/test_key_polling_master.py b/tests/integration/test_cluster/test_key_polling/test_key_polling_master.py index 46d84b03de..fe0390fb84 100644 --- a/tests/integration/test_cluster/test_key_polling/test_key_polling_master.py +++ b/tests/integration/test_cluster/test_key_polling/test_key_polling_master.py @@ -60,6 +60,7 @@ def get_configuration(request): # Tests +@pytest.mark.skip(reason='Development in progress: https://github.com/wazuh/wazuh/issues/4387') @pytest.mark.parametrize('cmd, counter, payload, expected', [ (b'run_keypoll', 1, b'{"message": "id:001"}', "id:001"), (b'run_keypoll', 2, b'{"message": "ip:124.0.0.1"}', "ip:124.0.0.1") @@ -85,7 +86,6 @@ def test_key_polling_master(cmd, counter, payload, expected, configure_environme expected : str Expected message in krequest socket """ - pytest.xfail("Development in progress: https://github.com/wazuh/wazuh/issues/4387") # Build message and send it to the master message = cluster_msg_build(cmd=cmd, counter=counter, payload=payload, encrypt=True) receiver_sockets[0].send(message) diff --git a/tests/integration/test_cluster/test_key_polling/test_key_polling_worker.py b/tests/integration/test_cluster/test_key_polling/test_key_polling_worker.py index 30b5041065..b6dc4fb77f 100644 --- a/tests/integration/test_cluster/test_key_polling/test_key_polling_worker.py +++ b/tests/integration/test_cluster/test_key_polling/test_key_polling_worker.py @@ -55,6 +55,7 @@ def get_configuration(request): # Tests +@pytest.mark.skip(reason='Development in progress: https://github.com/wazuh/wazuh/issues/4387') @pytest.mark.parametrize('cmd, counter, payload', [ (b'run_keypoll', 1, b'{"message": "id:001"}'), (b'run_keypoll', 2, b'{"message": "ip:124.0.0.1"}') @@ -78,7 +79,6 @@ def test_key_polling_worker(cmd, counter, payload, configure_environment, config payload : bytes Cluster message payload data """ - pytest.xfail("Development in progress: https://github.com/wazuh/wazuh/issues/4387") # Build message to send to c-internal.sock in the worker and send it message = cluster_msg_build(cmd=cmd, counter=counter, payload=payload, encrypt=False) receiver_sockets[0].send(message) diff --git a/tests/integration/test_gcloud/test_configuration/test_remote_configuration.py b/tests/integration/test_gcloud/test_configuration/test_remote_configuration.py index a9f47d6700..3cc3d8de52 100644 --- a/tests/integration/test_gcloud/test_configuration/test_remote_configuration.py +++ b/tests/integration/test_gcloud/test_configuration/test_remote_configuration.py @@ -76,7 +76,6 @@ def get_remote_configuration(component_name, config): socket_path = os.path.join(WAZUH_PATH, 'queue', 'ossec') dest_socket = os.path.join(socket_path, component_name) command = f"getconfig {config}" - host_type = 'agent' if 'agent' in WAZUH_SERVICE else 'server' # Socket connection s = SocketController(dest_socket) @@ -94,13 +93,9 @@ def get_remote_configuration(component_name, config): try: if rec_msg_ok.startswith('ok'): remote_configuration = json.loads(rec_msg) - if host_type == 'server': - remote_configuration_gcp = remote_configuration['wmodules'][6]['gcp-pubsub'] - else: - if sys.platform == 'darwin': - remote_configuration_gcp = remote_configuration['wmodules'][3]['gcp-pubsub'] - else: - remote_configuration_gcp = remote_configuration['wmodules'][5]['gcp-pubsub'] + for element in remote_configuration['wmodules']: + if 'gcp-pubsub' in element: + remote_configuration_gcp = element['gcp-pubsub'] else: s.close() raise ValueError(rec_msg_ok) diff --git a/tests/integration/test_gcloud/test_functioning/test_rules.py b/tests/integration/test_gcloud/test_functioning/test_rules.py index cfed48cb15..9daadaf6c4 100644 --- a/tests/integration/test_gcloud/test_functioning/test_rules.py +++ b/tests/integration/test_gcloud/test_functioning/test_rules.py @@ -84,11 +84,9 @@ def test_rules(get_configuration, configure_environment, rules_id = [] file_ind = 0 - for number in range(65004, 65037): - rules_id.append(number) - - for number in range(65039, 65045): - rules_id.append(number) + rules_id = [id for id in range(65005, 65011)] + rules_id += [id for id in range(65012, 65039)] + rules_id += [id for id in range(65041, 65047)] events_file = open(file_path, 'r') for line in events_file: diff --git a/tests/integration/test_wpk/conftest.py b/tests/integration/test_wpk/conftest.py index 18a08c9f5b..9840b1fd71 100644 --- a/tests/integration/test_wpk/conftest.py +++ b/tests/integration/test_wpk/conftest.py @@ -9,5 +9,5 @@ def configure_agents(request, get_configuration): SERVER_ADDRESS = getattr(request.module, 'SERVER_ADDRESS') CRYPTO = getattr(request.module, 'CRYPTO') - agents = create_agents(agents_number, SERVER_ADDRESS, CRYPTO, os=metadata['agents_os']) + agents = create_agents(agents_number, SERVER_ADDRESS, CRYPTO, os=metadata['agents_os'], version=metadata['agents_version']) setattr(request.module, 'agents', agents) diff --git a/tests/integration/test_wpk/test_wpk_agent.py b/tests/integration/test_wpk/test_wpk_agent.py index 09926fee18..922e1b365b 100644 --- a/tests/integration/test_wpk/test_wpk_agent.py +++ b/tests/integration/test_wpk/test_wpk_agent.py @@ -19,6 +19,7 @@ from wazuh_testing.tools.file import truncate_file from wazuh_testing.tools.remoted_sim import RemotedSimulator from wazuh_testing.tools.services import control_service +from wazuh_testing import global_parameters pytestmark = [pytest.mark.linux, pytest.mark.win32, pytest.mark.tier(level=0), pytest.mark.agent] @@ -36,7 +37,10 @@ CRYPTO = "aes" SERVER_ADDRESS = 'localhost' PROTOCOL = "tcp" -version_to_upgrade = 'v4.1.0' + +if not global_parameters.wpk_version: + raise Exception("The WPK package version must be defined by parameter. See README.md") +version_to_upgrade = global_parameters.wpk_version[0] # Test will varying according to agent version. This test should be tried @@ -60,7 +64,8 @@ def get_current_version(): _agent_version = get_current_version() error_msg = '' -if _agent_version == version_to_upgrade: +ver_split = _agent_version.replace("v", "").split(".") +if int(ver_split[0])>=4 and int(ver_split[1])>=1: error_msg = 'Could not chmod' \ if platform.system() == 'Linux' else \ 'Error executing command' @@ -70,7 +75,7 @@ def get_current_version(): 'err Cannot execute installer' test_metadata = [ - # 1. Upgrade from initial_version to v4.1.0 + # 1. Upgrade from initial_version to new version { 'protocol': PROTOCOL, 'initial_version': _agent_version, @@ -140,9 +145,9 @@ def get_current_version(): }] elif _agent_version == version_to_upgrade: test_metadata += [{ - # 5. Simulate a rollback (v4.1.0) + # 5. Simulate a rollback (new version) 'protocol': PROTOCOL, - 'initial_version': 'v4.1.0', + 'initial_version': version_to_upgrade, 'agent_version': version_to_upgrade, 'use_http': False, 'upgrade_script': DEFAULT_UPGRADE_SCRIPT, @@ -210,7 +215,9 @@ def start_agent(request, get_configuration): mode='CONTROLED_ACK', start_on_init=False, client_keys=CLIENT_KEYS_PATH) - if _agent_version == 'v4.1.0': + + ver_split = _agent_version.replace("v", "").split(".") + if int(ver_split[0])>=4 and int(ver_split[1])>=1: remoted_simulator.setWcomMessageVersion('4.1') else: remoted_simulator.setWcomMessageVersion(None) diff --git a/tests/integration/test_wpk/test_wpk_manager.py b/tests/integration/test_wpk/test_wpk_manager.py index 62e0b234a2..9e52f4273d 100644 --- a/tests/integration/test_wpk/test_wpk_manager.py +++ b/tests/integration/test_wpk/test_wpk_manager.py @@ -12,13 +12,16 @@ import time import hashlib import requests +import platform +from configobj import ConfigObj from wazuh_testing.tools import WAZUH_PATH, LOG_FILE_PATH from wazuh_testing.tools.configuration import load_wazuh_configurations from wazuh_testing.tools.agent_simulator import Sender, Injector from wazuh_testing.tools.services import control_service from wazuh_testing.tools.file import truncate_file from wazuh_testing.tools.monitoring import FileMonitor +from wazuh_testing import global_parameters pytestmark = [pytest.mark.linux, pytest.mark.tier(level=0), pytest.mark.server] @@ -26,7 +29,6 @@ TASK_SOCKET = os.path.join(WAZUH_PATH, 'queue', 'tasks', 'task') UPGRADE_PATH = os.path.join(WAZUH_PATH, 'var', 'upgrade') SERVER_ADDRESS = 'localhost' -MANAGER_VERSION = 'v4.1.0' WPK_REPOSITORY_4x = 'packages-dev.wazuh.com/trash/wpk/' WPK_REPOSITORY_3x = 'packages.wazuh.com/wpk/' CRYPTO = "aes" @@ -35,6 +37,18 @@ global valid_sha1_list valid_sha1_list = {} +if global_parameters.wpk_version is None: + raise ValueError("The WPK package version must be defined by parameter. See README.md") +version_to_upgrade = global_parameters.wpk_version[0] + +def get_current_version(): + if platform.system() == 'Linux': + config_file_path = os.path.join(WAZUH_PATH, 'etc', 'ossec-init.conf') + _config = ConfigObj(config_file_path) + return _config['VERSION'] + +MANAGER_VERSION = get_current_version() + cases = [ # 0. Single Agent - success { @@ -49,6 +63,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -71,6 +86,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -94,6 +110,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['INVALID'], 'upgrade_exec_result': ['0'], @@ -117,6 +134,7 @@ 'agents_number': 3, 'protocol': 'tcp', 'agents_os': ['debian7', 'ubuntu12.04', 'debian10'], + 'agents_version': ['v3.12.0','v3.12.0','v3.12.0'], 'stage_disconnect': [None, None, None], 'sha_list': ['VALIDSHA1', 'INVALIDSHA', 'VALIDSHA1'], 'upgrade_exec_result': ['0', '0', '0'], @@ -140,6 +158,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -163,6 +182,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -187,13 +207,14 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], 'upgrade_script_result': [0], 'status': ['Error'], 'upgrade_notification': [False], - 'message_params': {'version': 'v4.1.0', 'force_upgrade': False}, + 'message_params': {'version': MANAGER_VERSION, 'force_upgrade': False}, 'error_msg': ['The repository is not reachable'], 'expected_response': 'Success' } @@ -211,6 +232,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['mojave'], + 'agents_version': ['v3.11.0'], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -233,6 +255,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian8'], + 'agents_version': [version_to_upgrade], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -255,6 +278,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -278,6 +302,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian8'], + 'agents_version': [version_to_upgrade], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -300,7 +325,8 @@ 'wpk_repository': WPK_REPOSITORY_4x, 'agents_number': 1, 'protocol': 'tcp', - 'agents_os': ['debian8'], # debian8 have v4.1.0 agent version + 'agents_os': ['debian8'], + 'agents_version': [version_to_upgrade], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -324,6 +350,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -348,6 +375,7 @@ 'protocol': 'tcp', 'stage_disconnect': [None], 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], 'upgrade_script_result': [0], @@ -370,6 +398,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -394,6 +423,7 @@ 'protocol': 'tcp', 'stage_disconnect': ['open'], 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], 'upgrade_script_result': [0], @@ -417,6 +447,7 @@ 'protocol': 'tcp', 'stage_disconnect': ['write'], 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], 'upgrade_script_result': [0], @@ -440,6 +471,7 @@ 'protocol': 'tcp', 'stage_disconnect': ['close'], 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], 'upgrade_script_result': [0], @@ -463,6 +495,7 @@ 'protocol': 'tcp', 'stage_disconnect': ['lock_restart'], 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], 'upgrade_script_result': [0], @@ -486,6 +519,7 @@ 'protocol': 'tcp', 'stage_disconnect': ['sha1'], 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], 'upgrade_script_result': [0], @@ -509,6 +543,7 @@ 'protocol': 'tcp', 'stage_disconnect': ['upgrade'], 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], 'upgrade_script_result': [0], @@ -531,6 +566,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -555,6 +591,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -580,6 +617,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -605,6 +643,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['NOT_NEED'], 'upgrade_exec_result': ['0'], @@ -631,6 +670,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -655,6 +695,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -678,6 +719,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.12.0'], 'stage_disconnect': [None], 'sha_list': ['VALIDSHA1'], 'upgrade_exec_result': ['0'], @@ -865,8 +907,7 @@ def test_wpk_manager(set_debug_mode, get_configuration, configure_environment, metadata['upgrade_exec_result'][index], metadata['upgrade_notification'][index], metadata['upgrade_script_result'][index], - stage_disconnect=metadata['stage_disconnect'][index], - version='4.1' if metadata['agents_os'][index] == 'debian8' else None) + stage_disconnect=metadata['stage_disconnect'][index]) injector = Injector(sender, agent) injectors.append(injector) injector.run() @@ -939,7 +980,7 @@ def test_wpk_manager(set_debug_mode, get_configuration, configure_environment, if metadata.get('checks') and ('wpk_name' in metadata.get('checks')): # Checking version in logs try: - log_monitor.start(timeout=120, callback=wait_wpk_custom) + log_monitor.start(timeout=180, callback=wait_wpk_custom) except TimeoutError as err: raise AssertionError("Custom wpk log tooks too much!") @@ -1022,3 +1063,5 @@ def test_wpk_manager(set_debug_mode, get_configuration, configure_environment, for injector in injectors: injector.stop_receive() + + time.sleep(3) # Wait for agents threads to stop diff --git a/tests/integration/test_wpk/test_wpk_manager_task_states.py b/tests/integration/test_wpk/test_wpk_manager_task_states.py index da30c97143..c8bf782d7a 100644 --- a/tests/integration/test_wpk/test_wpk_manager_task_states.py +++ b/tests/integration/test_wpk/test_wpk_manager_task_states.py @@ -42,6 +42,7 @@ 'agents_number': 2, 'protocol': 'tcp', 'agents_os': ['debian7', 'debian7'], + 'agents_version': ['v3.11.3', 'v3.11.3'], 'stage_disconnect': ['lock_restart', None], 'first_status': ['Updating', 'In queue'], 'expected_response': 'Success', @@ -63,6 +64,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.11.3'], 'stage_disconnect': ['write'], 'first_status': ['Updating'], 'expected_response': 'Success', @@ -84,6 +86,7 @@ 'agents_number': 2, 'protocol': 'tcp', 'agents_os': ['debian7', 'debian7'], + 'agents_version': ['v3.11.3', 'v3.11.3'], 'stage_disconnect': ['lock_restart', None], 'first_status': ['Updating', 'In queue'], 'expected_response': 'Success', @@ -108,6 +111,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.11.3'], 'stage_disconnect': ['write'], 'first_status': ['Updating'], 'expected_response': 'Success', @@ -132,6 +136,7 @@ 'agents_number': 1, 'protocol': 'tcp', 'agents_os': ['debian7'], + 'agents_version': ['v3.11.3'], 'stage_disconnect': ['write'], 'first_status': ['Updating'], 'expected_response': 'Success', diff --git a/tests/legacy/test_sca/README.md b/tests/legacy/test_sca/README.md new file mode 100644 index 0000000000..12e032400f --- /dev/null +++ b/tests/legacy/test_sca/README.md @@ -0,0 +1,110 @@ +# SCA tests + + +These tests are not part of the current testing framework for Wazuh, so they have to be executed manually. The necessary instructions are described below. + +## Introduction +--------------- + +A brief knowledge of SCA is recommended, the documentation covers it in detail in [How SCA works](https://documentation.wazuh.com/4.2/user-manual/capabilities/sec-config-assessment/how_it_works.html). Also, there is a blog post about [Security Configuration Assessment](https://wazuh.com/blog/security-configuration-assessment/). + +Basically, the tests inside **data** folder contain different _.yml_ policies that will test the general capabilities of **SCA**. It will be necessary to install a Manager and register an agent. There is more information about this part of the process in the [Installation Guide](https://documentation.wazuh.com/4.0/installation-guide/index.html). + +## Directory structure +---------------------- + + ├── test_basic_usage/data + │ ├── sca_commands_test_suite.yml + │ ├── sca_compare_test_suite.yml + │ ├── sca_condition_test_suite.yml + │ ├── sca_directories_test_suite.yml + │ ├── sca_files_test_suite.yml + │ ├── sca_negation_test_suite.yml + │ ├── sca_processes_test_suite.yml + │ ├── sca_repeated_global_ids_1.yml # Will be skipped + │ ├── sca_repeated_global_ids_2.yml # Will be skipped + │ ├── sca_repeated_local.yml # Will be skipped + │ ├── sca_win_registry_test_suite.yml + │ ├── set_linux_config_to_compliance.sh # Script to improve the SCA score + | + ├── README.md + +## Test execution +----------------- + +The **SCA** module has to be enabled in the agent + +``` + + yes + yes + 12h + yes + +``` + +And the test policies have to copied to __INSTALL_DIR/ruleset/sca__. +Then, restart the agent to force the policy evaluation. + +## Results +---------- + +The agent will log to __ossec.log__ these type of messages + +``` + sca: INFO: Starting evaluation of policy: 'policy.yml' + sca: INFO: Evaluation finished for policy: 'policy.yml' +``` + +Some scans will not be performed, because there are some policies that have the same ID on purpose to test this situation. For example: + +``` +sca: WARNING: Found duplicated check ID: 200100. First appearance at policy 'sca_files_test_suite' +sca: WARNING: Error found while validating policy file: '/var/ossec/ruleset/sca/sca_repeated_global_ids_1.yml'. Skipping it. +``` + +After all the scans finish, the results can be checked in the manager with this API request + +``` +curl -k -X GET "https://localhost:55000/sca/001?pretty=true" -H "Authorization: Bearer $TOKEN" +``` +``` + ... + { + "invalid": 6, + "total_checks": 24, + "fail": 11, + "references": "NULL", + "description": "This document includes file rules for testing purposes with the syntax rule of Wazuh v3.10.0", + "start_scan": "2020-12-22T20:16:26Z", + "hash_file": "8688d6b8ae1828f9512d3dc9b68b904d8d08cde1f8709d76cdb9954f382656f2", + "name": "Test suite for conditions.", + "pass": 7, + "policy_id": "sca_condition_test_suite", + "score": 38, + "end_scan": "2020-12-22T20:16:26Z" + }, + ... +``` + +The scan results and those described in the test must be equal + +``` +... + policy: + id: sca_condition_test_suite + file: sca_condition_test_suite.yml + name: Test suite for conditions. + description: This document includes file rules for testing purposes with the syntax rule of Wazuh v3.10.0 + ############### Expected results + # Pass = 7 + # Fail = 11 + # Invalid = 6 + # Total checks = 24 +... +``` + +## Compliance script +-------------------- + +The _set_linux_config_to_compliance.sh_ script modifies some configurations in a Linux environment to improve the tests scores for policies like _cis_debian9_L1.yml_ and _cis_debian9_L2.yml_. diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_commands_test_suite.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_commands_test_suite.yml similarity index 98% rename from tests/integration/test_sca/test_basic_usage/data/sca_commands_test_suite.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_commands_test_suite.yml index 0fe9f71d9d..2b5eb44589 100644 --- a/tests/integration/test_sca/test_basic_usage/data/sca_commands_test_suite.yml +++ b/tests/legacy/test_sca/test_basic_usage/data/sca_commands_test_suite.yml @@ -15,7 +15,7 @@ policy: # Passed = 2 # Failed = 2 # Invalid = 3 -# Total checks = 6 +# Total checks = 7 checks: - id: 300100 @@ -35,13 +35,13 @@ checks: condition: any rules: - c:echo -n ABC -> r:CBA - + - id: 300103 title: PASS -- Negate yield ABC and try to find CBA condition: any rules: - not c:echo -n ABC -> r:CBA - + - id: 300104 title: INVALID -- Command does not exist (will trigger leak reports due to execvp failing) condition: any diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_compare_test_suite.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_compare_test_suite.yml similarity index 99% rename from tests/integration/test_sca/test_basic_usage/data/sca_compare_test_suite.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_compare_test_suite.yml index 83568b1f7a..2f63f79c94 100644 --- a/tests/integration/test_sca/test_basic_usage/data/sca_compare_test_suite.yml +++ b/tests/legacy/test_sca/test_basic_usage/data/sca_compare_test_suite.yml @@ -15,7 +15,7 @@ policy: # Pass = 6 # Fail = 1 # Invalid = 7 -# Total checks = 13 +# Total checks = 14 checks: diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_condition_test_suite.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_condition_test_suite.yml similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/sca_condition_test_suite.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_condition_test_suite.yml diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_directories_test_suite.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_directories_test_suite.yml similarity index 98% rename from tests/integration/test_sca/test_basic_usage/data/sca_directories_test_suite.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_directories_test_suite.yml index 45d57a0c61..b2f61c5e4c 100644 --- a/tests/integration/test_sca/test_basic_usage/data/sca_directories_test_suite.yml +++ b/tests/legacy/test_sca/test_basic_usage/data/sca_directories_test_suite.yml @@ -12,10 +12,10 @@ policy: name: Test suite for directories rules description: This document includes directories rules for testing purposes with the syntax rule of Wazuh v3.10.0 ############### Expected results -# Passed = 8 -# Failed = 8 -# Invalid = 2 -# Total checks = 18 +# Passed = 12 +# Failed = 9 +# Invalid = 4 +# Total checks = 25 # Directory checks checks: ################################# diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_files_test_suite.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_files_test_suite.yml similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/sca_files_test_suite.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_files_test_suite.yml diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_negation_test_suite.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_negation_test_suite.yml similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/sca_negation_test_suite.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_negation_test_suite.yml diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_processes_test_suite.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_processes_test_suite.yml similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/sca_processes_test_suite.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_processes_test_suite.yml diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_repeated_global_ids_1.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_repeated_global_ids_1.yml similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/sca_repeated_global_ids_1.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_repeated_global_ids_1.yml diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_repeated_global_ids_2.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_repeated_global_ids_2.yml similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/sca_repeated_global_ids_2.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_repeated_global_ids_2.yml diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_repeated_local_ids.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_repeated_local_ids.yml similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/sca_repeated_local_ids.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_repeated_local_ids.yml diff --git a/tests/integration/test_sca/test_basic_usage/data/sca_win_registry_test_suite.yml b/tests/legacy/test_sca/test_basic_usage/data/sca_win_registry_test_suite.yml similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/sca_win_registry_test_suite.yml rename to tests/legacy/test_sca/test_basic_usage/data/sca_win_registry_test_suite.yml diff --git a/tests/integration/test_sca/test_basic_usage/data/set_linux_config_to_compliance.sh b/tests/legacy/test_sca/test_basic_usage/data/set_linux_config_to_compliance.sh similarity index 100% rename from tests/integration/test_sca/test_basic_usage/data/set_linux_config_to_compliance.sh rename to tests/legacy/test_sca/test_basic_usage/data/set_linux_config_to_compliance.sh diff --git a/tests/system/test_cluster/test_agent_key_polling/test_agent_key_polling.py b/tests/system/test_cluster/test_agent_key_polling/test_agent_key_polling.py index 93f4c28216..a709319677 100644 --- a/tests/system/test_cluster/test_agent_key_polling/test_agent_key_polling.py +++ b/tests/system/test_cluster/test_agent_key_polling/test_agent_key_polling.py @@ -33,6 +33,7 @@ def configure_environment(host_manager): host_manager.clear_file(host='wazuh-agent2', file_path=os.path.join(WAZUH_LOGS_PATH, 'ossec.log')) +@pytest.mark.skip(reason='Development in progress: https://github.com/wazuh/wazuh/issues/4387') def test_agent_key_polling(inventory_path): """Check that the agent key polling cycle works correctly. To do this, we use the messages and the hosts defined in data/messages.yml and the hosts inventory. @@ -42,7 +43,6 @@ def test_agent_key_polling(inventory_path): inventory_path : str Path to the Ansible hosts inventory """ - pytest.xfail("Development in progress: https://github.com/wazuh/wazuh/issues/4387") actual_path = os.path.dirname(os.path.abspath(__file__)) host_manager = HostManager(inventory_path=inventory_path) configure_environment(host_manager)