def METHOD_NAME(configure_environment, shutdown_agentd, get_current_test_case, create_certificates,
                               set_keys, set_password, file_monitoring, configure_socket_listener, request):
    """
    description:
        "Check that different configuration generates the adequate enrollment message or the corresponding
        error log. Agent-auth will be executed using the different parameters and with different keys and password
        files scenarios as described in the test cases."
    wazuh_min_version: 4.6.0
    tier: 0
    parameters:
        - configure_environment:
            type: fixture
            brief: Configure a custom environment for testing.
        - shutdown_agentd:
            type: fixture
            brief: Shutdown agentd to avoid interferences with agent-auth test
        - override_wazuh_conf:
            type: fixture
            brief: Write a particular Wazuh configuration for the test case.
        - get_current_test_case:
            type: fixture
            brief: Get the current test case.
        - create_certificates:
            type: fixture
            brief: Write the certificate files used for SSL communication.
        - set_keys:
            type: fixture
            brief: Write pre-existent keys into client.keys.
        - set_password:
            type: fixture
            brief: Write the password file.
        - file_monitoring:
            type: fixture
            brief: Handle the monitoring of a specified file.
        - restart_agentd:
            type: fixture
            brief: Restart Agentd and control if it is expected to fail or not.
        - request:
            type: fixture
            brief: Provide information of the requesting test function.
    assertions:
        - The enrollment message is sent when the configuration is valid
        - The enrollment message is generated as expected when the configuration is valid.
        - The error log is generated as expected when the configuration is invalid.
    input_description:
        Different test cases are contained in an external YAML file (wazuh_enrollment_tests.yaml) which includes the
        different available enrollment-related configurations.
    expected_output:
        - Enrollment request message on Authd socket
        - Error logs related to the wrong configuration block
    """
    if 'agent-auth' in get_current_test_case.get('skips', []):
        pytest.skip('This test does not apply to agent-auth')
    launch_agent_auth(get_current_test_case.get('configuration', {}))
    if 'expected_error' in get_current_test_case:
        log_monitor = request.module.log_monitor
        expected_error_dict = get_current_test_case['expected_error']
        expected_error = expected_error_dict['agent-auth'] if 'agent-auth' in expected_error_dict else \
                                                              expected_error_dict
        try:
            log_monitor.start(timeout=AGENT_AUTH_ENROLLMENT_REQUEST_TIMEOUT,
                              callback=make_callback(expected_error, prefix='.*',
                                                     escape=True),
                              error_message='Expected error log does not occured.')
        except Exception as error:
            expected_fail = get_current_test_case.get('expected_fail')
            if expected_fail and (expected_fail['os'] == "any" or expected_fail['os'] == sys.platform):
                is_xfail = True
                xfail_reason = expected_fail.get('reason')
            else:
                is_xfail = False
            if is_xfail:
                pytest.xfail(f"Xfailing due to {xfail_reason}")
            else:
                raise error
    else:
        test_expected = get_current_test_case['message']['expected'].format(host_name=get_host_name(),
                                                                            agent_version=get_version()).encode()
        test_response = get_current_test_case['message']['response'].format(host_name=get_host_name()).encode()
        # Monitor MITM queue
        socket_monitor = QueueMonitor(request.module.socket_listener.queue)
        event = (test_expected, test_response)
        try:
            # Start socket monitoring
            socket_monitor.start(timeout=AGENT_AUTH_ENROLLMENT_REQUEST_TIMEOUT,
                                 callback=lambda received_event: event == received_event,
                                 error_message='Enrollment request message never arrived', update_position=False)
        finally:
            socket_monitor.stop()