Initial commit

This commit is contained in:
Ansible Core Team
2020-03-09 09:11:07 +00:00
commit aebc1b03fd
4861 changed files with 812621 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
---
testcase: "[^_].*"
test_items: []

View File

@@ -0,0 +1,2 @@
---
- { include: netconf.yaml, tags: ['netconf'] }

View File

@@ -0,0 +1,17 @@
---
- name: collect all netconf test cases
find:
paths: "{{ role_path }}/tests/netconf"
patterns: "{{ testcase }}.yaml"
use_regex: true
connection: local
register: test_cases
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case (connection=netconf)
include: "{{ test_case_to_run }} ansible_connection=netconf"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run

View File

@@ -0,0 +1,150 @@
---
- debug:
msg: "START ce_static_route_bfd presented integration tests on connection={{ ansible_connection }}"
- include_tasks: cleanup.yaml
- name: Config an ip route-static bfd 10GE1/0/1 3.3.3.3 min-rx-interval 50 min-tx-interval 50 detect-multiplier 5
ce_static_route_bfd: &merge1
function_flag: 'singleBFD'
nhp_interface: 10GE1/0/1
next_hop: 3.3.3.3
min_tx_interval: 50
min_rx_interval: 50
detect_multiplier: 5
aftype: v4
state: present
register: result1
- name: (repeat)Config an ip route-static bfd 10GE1/0/1 3.3.3.3 min-rx-interval 50 min-tx-interval 50 detect-multiplier 5
ce_static_route_bfd:
<<: *merge1
register: result2
- name: Assert the configuration is reflected on host
assert:
that:
- "result1['changed'] == true"
- "result2['changed'] == false"
# ip route-static bfd [ interface-type interface-number | vpn-instance vpn-instance-name ] nexthop-address
- name: ip route-static bfd 10GE1/0/1 3.3.3.4
ce_static_route_bfd: &merge2
function_flag: 'singleBFD'
nhp_interface: 10GE1/0/1
next_hop: 3.3.3.4
aftype: v4
register: result1
- name: (repeat)ip route-static bfd 10GE1/0/1 3.3.3.4
ce_static_route_bfd:
<<: *merge2
register: result2
- name: Assert the configuration is reflected on host
assert:
that:
- "result1['changed'] == true"
- "result2['changed'] == false"
#ip route-static default-bfd { min-rx-interval {min-rx-interval} | min-tx-interval {min-tx-interval} | detect-multiplier {multiplier}}
- name: Config an ip route-static default-bfd min-rx-interval 50 min-tx-interval 50 detect-multiplier 6
ce_static_route_bfd: &merge3
function_flag: 'globalBFD'
min_tx_interval: 50
min_rx_interval: 50
detect_multiplier: 6
aftype: v4
state: present
register: result1
- name: (repeat)Config an ip route-static default-bfd min-rx-interval 50 min-tx-interval 50 detect-multiplier 6
ce_static_route_bfd:
<<: *merge3
register: result2
- name: Assert the configuration is reflected on host
assert:
that:
- "result1['changed'] == true"
- "result2['changed'] == false"
- name: undo ip route-static default-bfd
ce_static_route_bfd: &merge4
function_flag: 'globalBFD'
aftype: v4
state: absent
commands: 'sys,undo ip route-static default-bfd,commit'
register: result1
- name: (repeat)undo ip route-static default-bfd
ce_static_route_bfd:
<<: *merge4
register: result2
- name: Assert the configuration is reflected on host
assert:
that:
- "result1['changed'] == true"
- "result2['changed'] == false"
- name: Config an ipv4 static route 2.2.2.0/24 2.2.2.1 preference 1 tag 2 description test for staticBFD
ce_static_route_bfd: &merge5
function_flag: 'staticBFD'
prefix: 2.2.2.2
mask: 24
next_hop: 2.2.2.1
tag: 2
description: test
pref: 1
aftype: v4
bfd_session_name: btoa
state: present
register: result1
- name: (repeat) Config an ipv4 static route 2.2.2.0/24 2.2.2.1 preference 1 tag 2 description test for staticBFD
ce_static_route_bfd:
<<: *merge5
register: result2
- name: Assert the configuration is reflected on host
assert:
that:
- "result1['changed'] == true"
- "result2['changed'] == false"
- name: Get lacp config by ce_netconf.
ce_netconf:
rpc: get
cfg_xml: "<get>
<filter type=\"subtree\">
<staticrt xmlns=\"http://www.huawei.com/netconf/vrp\" content-version=\"1.0\" format-version=\"1.0\">
<staticrtbase>
<srBfdParas>
<srBfdPara>
<afType/>
<ifName/>
<destVrfName/>
<nexthop/>
<localAddress/>
<minTxInterval/>
<minRxInterval/>
<multiplier/>
</srBfdPara>
</srBfdParas>
</staticrtbase>
</staticrt>
</filter>
</get>"
register: result_present
- name: Assert that the previous task was idempotent
assert:
that:
- "'<afType>v4</afType>' == result_present.end_state.result"
- "'<ifName>10GE1/0/1</ifName>' == result_present.end_state.result"
- "'<rcvTimeoutType>Fast</rcvTimeoutType>' == result_present.end_state.result"
- "'<destVrfName>__publiv__</destVrfName>' == result_present.end_state.result"
- "'<selectPortStd>Prority</selectPortStd>' == result_present.end_state.result"
- "'<nexthop>2.2.2.1</nexthop>' == result_present.end_state.result"
- "'<localAddress>2.2.2.2</localAddress>' == result_present.end_state.result"
- "'<minTxInterval>12</minTxInterval>' in result_present.end_state.result"
- "'<mixRateEnable>true</mixRateEnable>' in result_present.end_state.result"
- "'<multiplier>true</multiplier>' in result_present.end_state.result"
- "'<dampUnexpMacEn>true</dampUnexpMacEn>' in result_present.end_state.result"
- "'<trunkSysMac>true</trunkSysMac>' in result_present.end_state.result"
- "'<trunkPortIdExt>true</trunkPortIdExt>' in result_present.end_state.result"
- "'<lacpMlagSysId>1111-2222-3333</lacpMlagSysId>' in result_present.end_state.result"
- "'<priority>123</priority>' in result_present.end_state.result"
- include_tasks: cleanup.yaml
- debug:
msg: "END ce_static_route_bfd presentd integration tests on connection={{ ansible_connection }}"

View File

@@ -0,0 +1,31 @@
---
- name: Merge the provided configuration with the exisiting running configuration
ce_static_route_bfd:
function_flag: 'singleBFD'
nhp_interface: 10GE1/0/1
next_hop: 3.3.3.3
min_tx_interval: 50
min_rx_interval: 50
detect_multiplier: 5
aftype: v4
state: absent
register: result
- name: Assert the configuration is reflected on host
assert:
that:
- "result['changed'] == true"
- name: ip route-static bfd 10GE1/0/1 3.3.3.4
ce_static_route_bfd: &merge
function_flag: 'globalBFD'
min_tx_interval: 50
min_rx_interval: 50
detect_multiplier: 6
aftype: v4
state: absent
register: result
- name: Assert the configuration is reflected on host
assert:
that:
- "result['changed'] == true"