def METHOD_NAME(configure_environment, configure_sockets_environment,
                                           connect_to_sockets_function, set_up_groups, insert_pre_existent_agents,
                                           restart_wazuh_daemon_function, wait_for_authd_startup_function,
                                           get_current_test_case, tear_down):
    '''
    description:
        Checks that every input message in authd port generates the adequate output.
    wazuh_min_version:
        4.2.0
    tier: 0
    parameters:
        - configure_environment:
            type: fixture
            brief: Configure a custom environment for testing.
        - configure_sockets_environment:
            type: fixture
            brief: Configure the socket listener to receive and send messages on the sockets.
        - connect_to_sockets_function:
            type: fixture
            brief: Bind to the configured sockets at function scope.
        - set_up_groups:
            type: fixture
            brief: Set pre-existent groups.
        - insert_pre_existent_agents:
            type: fixture
            brief: adds the required agents to the client.keys and global.db
        - restart_wazuh_daemon_function:
            type: fixture
            brief: Restarts wazuh or a specific daemon passed.
        - wait_for_authd_startup_function:
            type: fixture
            brief: Waits until Authd is accepting connections.
        - get_current_test_case:
            type: fixture
            brief: gets the current test case from the tests' list
        - tear_down:
            type: fixture
            brief: cleans the client.keys file
    assertions:
        - The received output must match with expected
        - The enrollment messages are parsed as expected
        - The agent keys are denied if the hash is the same than the manager's
    input_description:
        Different test cases are contained in an external YAML file (authd_key_hash.yaml) which includes
        the different possible registration requests and the expected responses.
    expected_output:
        - Registration request responses on Authd socket
    '''
    case = get_current_test_case['test_case']
    for index, stage in enumerate(case):
        # Reopen socket (socket is closed by manager after sending message with client key)
        receiver_sockets[0].open()
        expected = stage['output']
        message = stage['input']
        receiver_sockets[0].send(message, size=False)
        timeout = time.time() + 10
        response = ''
        while response == '':
            response = receiver_sockets[0].receive().decode()
            if time.time() > timeout:
                assert response != '', 'The manager did not respond to the message sent.'
        assert response[:len(expected)] == expected, \
            'Failed stage "{}". Response was: {} instead of: {}' \
            .format(index+1, response, expected)