Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add network-integration tests #87

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

alagoutte
Copy link
Contributor

use ansible-test network-integration for launch test

You need before to copy inventory.networking.template to inventory.networking (on integration folder)
and modify for add your target

You can look https://docs.ansible.com/ansible/latest/network/dev_guide/developing_resource_modules_network.html#id18 for more info

use ansible-test network-integration for launch test

You need before to copy inventory.networking.template to inventory.networking (on integration folder)
and modify for add your target
@alagoutte
Copy link
Contributor Author

add example using Aruba OS OVA (10.10 and 10.11) :

alagoutte@ALG-Ansible:~/aoscx/tests/integration$ansible-test network-integration
Running aoscx_vrf integration test role
[WARNING]: running playbook inside collection arubanetworks.aoscx
[WARNING]: An error occurred while calling ansible.utils.display.initialize_locale (unsupported locale setting). This may result in incorrectly calculated text widths that can cause Display to print incorrect line lengths

PLAY [aoscx] *************************************************************************************************************************************************************************************************************************************************************************

TASK [aoscx_vrf : collect all api test cases] ****************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : set test_items] ****************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : run test cases (connection=arubanetworks.aoscx.aoscx, network_os=arubanetworks.aoscx.aoscx)] ***********************************************************************************************************************************************************************
included: /home/alagoutte/.ansible/collections/ansible_collections/arubanetworks/aoscx/tests/output/.tmp/integration/aoscx_vrf-iiu1nax2-ÅÑŚÌβŁÈ/tests/integration/targets/aoscx_vrf/tests/api/delete.yaml for 10.200.4.110, 10.200.4.111 => (item=/home/alagoutte/.ansible/collections/ansible_collections/arubanetworks/aoscx/tests/output/.tmp/integration/aoscx_vrf-iiu1nax2-ÅÑŚÌβŁÈ/tests/integration/targets/aoscx_vrf/tests/api/delete.yaml)
included: /home/alagoutte/.ansible/collections/ansible_collections/arubanetworks/aoscx/tests/output/.tmp/integration/aoscx_vrf-iiu1nax2-ÅÑŚÌβŁÈ/tests/integration/targets/aoscx_vrf/tests/api/create.yaml for 10.200.4.110, 10.200.4.111 => (item=/home/alagoutte/.ansible/collections/ansible_collections/arubanetworks/aoscx/tests/output/.tmp/integration/aoscx_vrf-iiu1nax2-ÅÑŚÌβŁÈ/tests/integration/targets/aoscx_vrf/tests/api/create.yaml)

TASK [aoscx_vrf : debug] *************************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110] => {
    "msg": "START aoscx_vrf delete integration tests on connection=arubanetworks.aoscx.aoscx"
}
ok: [10.200.4.111] => {
    "msg": "START aoscx_vrf delete integration tests on connection=arubanetworks.aoscx.aoscx"
}

TASK [aoscx_vrf : Remove VRF] ********************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.111]
ok: [10.200.4.110]

TASK [aoscx_vrf : Create VRF] ********************************************************************************************************************************************************************************************************************************************************
changed: [10.200.4.110]
changed: [10.200.4.111]

TASK [aoscx_vrf : Delete vrf] ********************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : Get vrf facts] *****************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : Assert if vrf is always present] ***********************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110] => {
    "changed": false,
    "msg": "All assertions passed"
}
ok: [10.200.4.111] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aoscx_vrf : Delete vrf (idempotent)] *******************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : Assert that the previous task was idempotent] **********************************************************************************************************************************************************************************************************************
ok: [10.200.4.110] => {
    "changed": false,
    "msg": "All assertions passed"
}
ok: [10.200.4.111] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aoscx_vrf : Remove VRF] ********************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : debug] *************************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110] => {
    "msg": "START aoscx_vrf create integration tests on connection=arubanetworks.aoscx.aoscx"
}
ok: [10.200.4.111] => {
    "msg": "START aoscx_vrf create integration tests on connection=arubanetworks.aoscx.aoscx"
}

TASK [aoscx_vrf : Remove VRF] ********************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : Create vrf] ********************************************************************************************************************************************************************************************************************************************************
changed: [10.200.4.110]
changed: [10.200.4.111]

TASK [aoscx_vrf : Get vrf facts] *****************************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : Assert if vrf is not created] **************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110] => {
    "changed": false,
    "msg": "All assertions passed"
}
ok: [10.200.4.111] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aoscx_vrf : Create vrf (idempotent)] *******************************************************************************************************************************************************************************************************************************************
ok: [10.200.4.110]
ok: [10.200.4.111]

TASK [aoscx_vrf : Assert that the previous task was idempotent] **********************************************************************************************************************************************************************************************************************
ok: [10.200.4.110] => {
    "changed": false,
    "msg": "All assertions passed"
}
ok: [10.200.4.111] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [aoscx_vrf : Remove VRF] ********************************************************************************************************************************************************************************************************************************************************
changed: [10.200.4.110]
changed: [10.200.4.111]

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************************************
10.200.4.110               : ok=21   changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
10.200.4.111               : ok=21   changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

@alagoutte
Copy link
Contributor Author

@karthikeyan-dhandapani @kchavesr @tchiapuziowong can you look ?

connection plugin has an improperly configured remote target value, forcing "inventory_hostname" templated value instead of the string

See ansible/ansible#77841 for same error message (coming with ansible >= 2.13)
tests/integration/targets/aoscx_vrf/tasks/api.yaml:21:1: empty-lines: too many blank lines (1 > 0)
tests/integration/targets/aoscx_vrf/tests/api/create.yaml:34:5: hyphens: too many spaces after hyphen
tests/integration/targets/aoscx_vrf/tests/api/create.yaml:42:1: empty-lines: too many blank lines (1 > 0)
tests/integration/targets/aoscx_vrf/tests/api/delete.yaml:34:5: hyphens: too many spaces after hyphen
tests/integration/targets/aoscx_vrf/tests/api/delete.yaml:42:1: empty-lines: too many blank lines (1 > 0)
tests/integration/targets/aoscx_vrf/tests/api/delete.yaml:34:5: hyphens: too many spaces after hyphen
tests/integration/targets/aoscx_vrf/tests/api/delete.yaml:42:1: empty-lines: too many blank lines (1 > 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant