Performing tests versus appliance devices

Hello,

I’m trying to develop a collection for an appliance (similar way of working as a network device), you can do RAPI calls to it or SSH to a very narrowed shell.

Therefore, I thought that using the httpapi connection type from the netcommon collection would be a good idea to use it as a first class citizen.

Now it starts… I’ve some “unit testing” but I’ve serious difficulties to think that they are usefull as I cannot access the httpapi plugin (any import attempts fails when used in combination with ansible-test commands), therefore Unit test are mocking them or creating Fake connections.

Integration tests are ran through the following command: ansible-test network-integration --inventory ~/dev/ansible_collections/community/my_collection/tests/integration/inventory.networking but keeps returning:

fatal: [appliance]: FAILED! => {“msg”: “the connection plugin ‘httpapi’ was not found”}

I guess this is a problem of python path being constructed differently when running ansible-test command ?

Here’s a sample of my inventory:

[appliance]
appliance_container ansible_host=“appliance.iamlab.community.org” ansible_connection=“httpapi” ansible_network_os=“appliance” ansible_user=“admin” ansible_password=“Passw0rd” ansible_httpapi_use_ssl=“yes” ansible_httpapi_validate_certs=“no”

And this is the play output:

Running appliance_service_agreements_info integration test role
[WARNING]: running playbook inside collection community.appliance

PLAY [appliance] *********************************************************************************************************************************************************************************************

TASK [appliance_service_agreements_info : Checking Applianceservice agreements] **********************************************************************************************************************************
fatal: [appliance_container]: FAILED! => {“msg”: “the connection plugin ‘httpapi’ was not found”}

PLAY RECAP **********************************************************************************************************************************************************************************************
appliance_container : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Would you have any guidance for me please ?

Regards,

Cédric S.

Replying to myself, you need to setup those collections in the same path as the one being develop. Duh !

Cédric S.