| 1 |
--- |
| 2 |
ansible_connection: httpapi |
| 3 |
|
| 4 |
sonic_pms_test_vars: |
| 5 |
po1: "PortChannel100" |
| 6 |
po2: "PortChannel101" |
| 7 |
vlan_id_1: 100 |
| 8 |
vlan_id_2: 101 |
| 9 |
|
| 10 |
sonic_pms_preparation_task_input: |
| 11 |
lag_interfaces: |
| 12 |
- name: '{{ sonic_pms_test_vars.po1 }}' |
| 13 |
- name: '{{ sonic_pms_test_vars.po2 }}' |
| 14 |
vlans: |
| 15 |
- vlan_id: '{{ sonic_pms_test_vars.vlan_id_1 }}' |
| 16 |
- vlan_id: '{{ sonic_pms_test_vars.vlan_id_2 }}' |
| 17 |
l2_interfaces: |
| 18 |
- name: '{{ interface1 }}' |
| 19 |
access: |
| 20 |
vlan: '{{ sonic_pms_test_vars.vlan_id_1 }}' |
| 21 |
- name: '{{ interface2 }}' |
| 22 |
access: |
| 23 |
vlan: '{{ sonic_pms_test_vars.vlan_id_1 }}' |
| 24 |
- name: '{{ interface3 }}' |
| 25 |
trunk: |
| 26 |
allowed_vlans: |
| 27 |
- vlan: '{{ sonic_pms_test_vars.vlan_id_2 }}' |
| 28 |
- name: '{{ interface4 }}' |
| 29 |
trunk: |
| 30 |
allowed_vlans: |
| 31 |
- vlan: '{{ sonic_pms_test_vars.vlan_id_2 }}' |
| 32 |
- name: '{{ sonic_pms_test_vars.po1 }}' |
| 33 |
access: |
| 34 |
vlan: '{{ sonic_pms_test_vars.vlan_id_1 }}' |
| 35 |
- name: '{{ sonic_pms_test_vars.po2 }}' |
| 36 |
access: |
| 37 |
vlan: '{{ sonic_pms_test_vars.vlan_id_2 }}' |
| 38 |
|
| 39 |
sonic_pms_tests: |
| 40 |
- name: test_case_01 |
| 41 |
description: 'Add PMS configurations for interfaces with no prior configs' |
| 42 |
state: merged |
| 43 |
input: |
| 44 |
- name: '{{ interface1 }}' |
| 45 |
max_allowed_macs: 20 |
| 46 |
sticky_mac: true |
| 47 |
port_security_enable: true |
| 48 |
- name: '{{ interface2 }}' |
| 49 |
max_allowed_macs: 10 |
| 50 |
port_security_enable: true |
| 51 |
- name: '{{ sonic_pms_test_vars.po1 }}' |
| 52 |
violation: 'SHUTDOWN' |
| 53 |
port_security_enable: true |
| 54 |
- name: '{{ sonic_pms_test_vars.po2 }}' |
| 55 |
max_allowed_macs: 20 |
| 56 |
port_security_enable: true |
| 57 |
|
| 58 |
- name: test_case_02 |
| 59 |
description: 'Add PMS configurations for existing PMS configured interfaces' |
| 60 |
state: merged |
| 61 |
input: |
| 62 |
- name: '{{ interface2 }}' |
| 63 |
port_security_enable: true |
| 64 |
violation: 'PROTECT' |
| 65 |
- name: '{{ sonic_pms_test_vars.po1 }}' |
| 66 |
port_security_enable: false |
| 67 |
- name: '{{ interface3 }}' |
| 68 |
port_security_enable: true |
| 69 |
sticky_mac: true |
| 70 |
violation: 'SHUTDOWN' |
| 71 |
|
| 72 |
- name: test_case_del_03 |
| 73 |
description: 'Delete PMS configurations attributes for interfaces' |
| 74 |
state: deleted |
| 75 |
input: |
| 76 |
- name: '{{ interface1 }}' |
| 77 |
port_security_enable: true |
| 78 |
sticky_mac: true |
| 79 |
- name: '{{ interface2 }}' |
| 80 |
port_security_enable: true |
| 81 |
max_allowed_macs: 10 |
| 82 |
violation: 'PROTECT' |
| 83 |
- name: '{{ sonic_pms_test_vars.po2 }}' |
| 84 |
port_security_enable: true |
| 85 |
max_allowed_macs: 20 |
| 86 |
violation: 'PROTECT' |
| 87 |
|
| 88 |
- name: test_case_replace_04 |
| 89 |
description: 'Replace PMS configurations at attributes level' |
| 90 |
state: replaced |
| 91 |
input: |
| 92 |
- name: '{{ interface2 }}' |
| 93 |
port_security_enable: true |
| 94 |
max_allowed_macs: 12 |
| 95 |
sticky_mac: true |
| 96 |
violation: 'SHUTDOWN' |
| 97 |
- name: '{{ sonic_pms_test_vars.po2 }}' |
| 98 |
port_security_enable: true |
| 99 |
max_allowed_macs: 20 |
| 100 |
violation: 'PROTECT' |
| 101 |
- name: '{{ interface3 }}' |
| 102 |
port_security_enable: true |
| 103 |
|
| 104 |
- name: test_case_replace_05 |
| 105 |
description: 'Remove PMS configuration using replaced' |
| 106 |
state: replaced |
| 107 |
input: |
| 108 |
- name: '{{ sonic_pms_test_vars.po2 }}' |
| 109 |
port_security_enable: false |
| 110 |
|
| 111 |
- name: test_case_override_06 |
| 112 |
description: 'Override PMS configurations at attributes level' |
| 113 |
state: overridden |
| 114 |
input: |
| 115 |
- name: '{{ sonic_pms_test_vars.po2 }}' |
| 116 |
port_security_enable: true |
| 117 |
sticky_mac: true |
| 118 |
violation: 'SHUTDOWN' |
| 119 |
- name: '{{ interface3 }}' |
| 120 |
port_security_enable: true |
| 121 |
- name: '{{ interface2 }}' |
| 122 |
port_security_enable: true |
| 123 |
max_allowed_macs: 12 |
| 124 |
sticky_mac: true |
| 125 |
violation: 'SHUTDOWN' |
| 126 |
|
| 127 |
- name: test_case_override_07 |
| 128 |
description: 'Remove PMS configuration using overridden' |
| 129 |
state: overridden |
| 130 |
input: |
| 131 |
- name: '{{ sonic_pms_test_vars.po2 }}' |
| 132 |
port_security_enable: false |
| 133 |
- name: '{{ interface3 }}' |
| 134 |
port_security_enable: true |
| 135 |
- name: '{{ interface2 }}' |
| 136 |
port_security_enable: true |
| 137 |
max_allowed_macs: 12 |
| 138 |
sticky_mac: true |
| 139 |
violation: 'SHUTDOWN' |
| 140 |
|
| 141 |
- name: test_case_delete_all_08 |
| 142 |
description: 'Delete all PMS configurations' |
| 143 |
state: deleted |
| 144 |
input: [] |