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 }}"
- name: Setup
junos_netconf:
state: present
@ -33,25 +32,16 @@
seconds: 10
- name: Ensure we can communicate over 8022
junos_command:
rpcs:
- get-software-information
provider: "{{ netconf }}"
port: 8022
connection: netconf
include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=8022 is_ignore_errors=false"
- name: wait for persistent socket to timeout
pause:
seconds: 120
# 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
junos_command:
rpcs: get-software-information
provider: "{{ netconf }}"
register: result
connection: netconf
ignore_errors: true
include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=true"
- assert:
that:
@ -67,10 +57,6 @@
seconds: 120
- name: Ensure we can communicate over netconf
junos_command:
rpcs:
- get-software-information
provider: "{{ netconf }}"
connection: netconf
include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=false"
- debug: msg="END netconf/changeport.yaml on connection={{ ansible_connection }}"

View file

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