Fix junos_netconf integration test failure (#34744)

* Fix junos_netconf integration test failure

Set ansible_connection to netconf for junos_command module
in junos_netconf integration test

* Fix review comments
This commit is contained in:
Ganesh Nalawade 2018-01-12 08:46:21 +05:30 committed by GitHub
parent 83b7ec69fc
commit 85f300e02b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 30 deletions

View file

@ -1,7 +1,6 @@
--- ---
- debug: msg="START netconf/changeport.yaml on connection={{ ansible_connection }}" - debug: msg="START netconf/changeport.yaml on connection={{ ansible_connection }}"
- name: Setup - name: Setup
junos_netconf: junos_netconf:
state: present state: present
@ -33,25 +32,16 @@
seconds: 10 seconds: 10
- name: Ensure we can communicate over 8022 - name: Ensure we can communicate over 8022
junos_command: include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=8022 is_ignore_errors=false"
rpcs:
- get-software-information
provider: "{{ netconf }}"
port: 8022
connection: netconf
- name: wait for persistent socket to timeout - name: wait for persistent socket to timeout
pause: pause:
seconds: 120 seconds: 120
# This protects against the port override above not being honoured and a bug setting the port # This protects against the port override above not being honoured and a bug setting the port
- name: Ensure we can NOT communicate over default port - name: Ensure we can NOT communicate over default port
junos_command: include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=true"
rpcs: get-software-information
provider: "{{ netconf }}"
register: result
connection: netconf
ignore_errors: true
- assert: - assert:
that: that:
@ -67,10 +57,6 @@
seconds: 120 seconds: 120
- name: Ensure we can communicate over netconf - name: Ensure we can communicate over netconf
junos_command: include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=false"
rpcs:
- get-software-information
provider: "{{ netconf }}"
connection: netconf
- debug: msg="END netconf/changeport.yaml on connection={{ ansible_connection }}" - debug: msg="END netconf/changeport.yaml on connection={{ ansible_connection }}"

View file

@ -23,13 +23,9 @@
seconds: 10 seconds: 10
- name: Ensure we can communicate over netconf - name: Ensure we can communicate over netconf
junos_command: include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=false"
rpcs: get-software-information
provider: "{{ netconf }}"
connection: netconf
# Disable netconf # Disable netconf
- name: Disable netconf - name: Disable netconf
junos_netconf: junos_netconf:
state: absent state: absent
@ -53,12 +49,7 @@
seconds: 120 seconds: 120
- name: Ensure we can NOT talk via netconf - name: Ensure we can NOT talk via netconf
junos_command: include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=true"
rpcs: get-software-information
provider: "{{ netconf }}"
register: result
connection: netconf
ignore_errors: true
- assert: - assert:
that: that:
@ -69,5 +60,4 @@
state: present state: present
register: result register: result
- debug: msg="END netconf/netconfg.yaml on connection={{ ansible_connection }}" - debug: msg="END netconf/netconfg.yaml on connection={{ ansible_connection }}"

View file

@ -0,0 +1,6 @@
---
- name: run junos_command to check netconf connectivity
junos_command:
rpcs: get-software-information
register: result
ignore_errors: "{{ is_ignore_errors }}"