##### SUMMARY

Support collection roles as integration test targets.

Now that https://github.com/ansible/ansible/issues/59462 has been merged, ansible-test can be updated to support running integration test targets that are collection roles.

The planned convention is to look for targets under `roles/test/` and allow use of target-specific plugins from `plugins/{plugin_type}/test/{target_name}/`.

##### ISSUE TYPE

Feature Idea

##### COMPONENT NAME

ansible-test

##### ADDITIONAL INFORMATION

This will allow integration test targets to be written using collections instead of pre-collection roles.
"""
    :type args: CommonConfig
    """
    comment = ' # ansible-test httptester\n'
    append_lines = ['127.0.0.1 %s%s' % (host, comment) for host in HTTPTESTER_HOSTS]
    with open('/etc/hosts', 'r+') as hosts_fd:
        original_lines = hosts_fd.readlines()
        if not any(line.endswith(comment) for line in original_lines):
            hosts_fd.writelines(append_lines)
    
    pfctl = find_executable('pfctl', required=False)
    iptables = find_executable('iptables', required=False)
    if pfctl:
        kldload = find_executable('kldload', required=False)
        if kldload:
            try: