blob: 2c32e574d41017eef6d4a8ac81f85a8e94a249bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
---
- debug:
msg: "START ce_lacp merged integration tests on connection={{ ansible_connection }}"
# befor removing, it should be merged
- include_tasks: merge.yaml
- name: Merge the provided configuration with the exisiting running configuration
ce_lacp: &absent
mode: Dynamic
trunk_id: 10
preempt_enable: True
state_flapping: True
port_id_extension_enable: True
unexpected_mac_disable: True
system_id: 1111-2222-3333
timeout_type: Fast
fast_timeout: 12
mixed_rate_link_enable: True
preempt_delay: 12
collector_delay: 12
max_active_linknumber: 2
select: Prority
priority: 23
global_priority: 123
state: absent
register: result
- name: Assert the configuration is reflected on host
assert:
that:
- "result['changed'] == true"
- name: Get lacp config by ce_netconf.
ce_netconf:
rpc: get
cfg_xml: "<filter type=\"subtree\">
<ifmtrunk xmlns=\"http://www.huawei.com/netconf/vrp\" content-version=\"1.0\" format-version=\"1.0\">
<TrunkIfs>
<TrunkIf>
<ifName>Eth-Trunk10</ifName>
<lacpTrunk>
<isSupportPrmpt></isSupportPrmpt>
<rcvTimeoutType></rcvTimeoutType>
<fastTimeoutUserDefinedValue></fastTimeoutUserDefinedValue>
<selectPortStd></selectPortStd>
<promptDelay></promptDelay>
<maxActiveNum></maxActiveNum>
<collectMaxDelay></collectMaxDelay>
<mixRateEnable></mixRateEnable>
<dampStaFlapEn></dampStaFlapEn>
<dampUnexpMacEn></dampUnexpMacEn>
<trunkSysMac></trunkSysMac>
<trunkPortIdExt></trunkPortIdExt>
</lacpTrunk>
</TrunkIf>
</TrunkIfs>
</ifmtrunk>
</filter>"
register: result_ifs_merged
- name: Get lacp config by ce_netconf.
ce_netconf:
rpc: get
cfg_xml: "<filter type=\"subtree\">
<ifmtrunk xmlns=\"http://www.huawei.com/netconf/vrp\" content-version=\"1.0\" format-version=\"1.0\">
<lacpSysInfo>
<priority></priority>
</lacpSysInfo>
</ifmtrunk>
</filter>"
register: result_global_merged
- name: Merge the provided configuration with the existing running configuration (IDEMPOTENT)
ce_lacp: *absent
register: result_re_merged
- name: Assert that the previous task was idempotent, some become ot default values, others depend on devices.
assert:
that:
- "result_re_merged.changed == false"
- "'<isSupportPrmpt>false</isSupportPrmpt>' == result_ifs_merged.end_state.result"
- "'<rcvTimeoutType>Slow</rcvTimeoutType>' == result_ifs_merged.end_state.result"
- "'<fastTimeoutUserDefinedValue>90</fastTimeoutUserDefinedValue>' == result_ifs_merged.end_state.result"
- "'<selectPortStd>Prority</selectPortStd>' == result_ifs_merged.end_state.result"
- "'<promptDelay>30</promptDelay>' == result_ifs_merged.end_state.result"
- "'<collectMaxDelay>0</collectMaxDelay>' in result_ifs_merged.end_state.result"
- "'<mixRateEnable>false</mixRateEnable>' in result_ifs_merged.end_state.result"
- "'<dampStaFlapEn>false</dampStaFlapEn>' in result_ifs_merged.end_state.result"
- "'<dampUnexpMacEn>false</dampUnexpMacEn>' in result_ifs_merged.end_state.result"
- "'<trunkSysMac>false</trunkSysMac>' in result_ifs_merged.end_state.result"
- "'<priority>32768</priority>' in result_global_merged.end_state.result"
- debug:
msg: "END ce_lacp merged integration tests on connection={{ ansible_connection }}"
|