diff --git a/ansible/README.test.md b/ansible/README.test.md index dc097ac0de4..a5bbced7db4 100644 --- a/ansible/README.test.md +++ b/ansible/README.test.md @@ -165,3 +165,7 @@ ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} -e "testbed_name ``` - Requires switch connected to a t0 testbed - Requires switch connected to fanout switch and fanout switch need support [QinQ](https://en.wikipedia.org/wiki/IEEE_802.1ad). + +### CRM test +``` +ansible-playbook test_sonic.yml -i inventory --limit {DUT_NAME} --become --tags crm diff --git a/ansible/roles/test/tasks/crm.yml b/ansible/roles/test/tasks/crm.yml new file mode 100644 index 00000000000..0173d361737 --- /dev/null +++ b/ansible/roles/test/tasks/crm.yml @@ -0,0 +1,57 @@ +- block: + + - fail: msg="Information about tested missing" + when: (testbed_type is not defined) + + - fail: msg="Invalid testbed_type value '{{testbed_type}}'" + when: testbed_type not in ['t1', 't1-lag', 't0'] + + - set_fact: crm_intf="{{minigraph_interfaces[0].attachto}}" + when: testbed_type == "t1" + + - set_fact: crm_intf="{{minigraph_portchannel_interfaces[0].attachto}}" + when: (testbed_type == "t0") or (testbed_type == "t1-lag") + + - name: Set polling interval + command: crm config polling interval 1 + + - name: Make sure CRM counters updated + pause: seconds=300 + + - name: Run test case "CRM IPv4 route resource" + include: roles/test/tasks/crm/crm_test_ipv4_route.yml + + - name: Run test case "CRM IPv6 route resource" + include: roles/test/tasks/crm/crm_test_ipv6_route.yml + + - name: Run test case "CRM IPv4 nexthop resource" + include: roles/test/tasks/crm/crm_test_ipv4_nexthop.yml + + - name: Run test case "CRM IPv6 nexthop resource" + include: roles/test/tasks/crm/crm_test_ipv6_nexthop.yml + + - name: Run test case "CRM IPv4 neighbor resource" + include: roles/test/tasks/crm/crm_test_ipv4_neighbor.yml + + - name: Run test case "CRM IPv6 neighbor resource" + include: roles/test/tasks/crm/crm_test_ipv6_neighbor.yml + + - name: Run test case "CRM nexthop group resource" + include: roles/test/tasks/crm/crm_test_nexthop_group.yml + + - name: Run test case "CRM nexthop group member resource" + include: roles/test/tasks/crm/crm_test_nexthop_group_member.yml + + - name: Run test case "CRM ACL entry resources" + include: roles/test/tasks/crm/crm_test_acl_entry.yml + + - name: Run test case "CRM ACL counter resources" + include: roles/test/tasks/crm/crm_test_acl_counter.yml + + - name: Run test case "CRM FDB entry resource" + include: roles/test/tasks/crm/crm_test_fdb_entry.yml + + always: + + - name: Restore polling interval + command: crm config polling interval 300 diff --git a/ansible/roles/test/tasks/crm/acl.json b/ansible/roles/test/tasks/crm/acl.json new file mode 100644 index 00000000000..ba2a385128f --- /dev/null +++ b/ansible/roles/test/tasks/crm/acl.json @@ -0,0 +1,30 @@ +{ + "acl": { + "acl-sets": { + "acl-set": { + "dataacl": { + "acl-entries": { + "acl-entry": { + "1": { + "actions": { + "config": { + "forwarding-action": "ACCEPT" + } + }, + "config": { + "sequence-id": 1 + }, + "l2": { + "config": { + "ethertype": "2048" + } + } + } + } + } + } + } + } + } +} + diff --git a/ansible/roles/test/tasks/crm/crm_test_acl_counter.yml b/ansible/roles/test/tasks/crm/crm_test_acl_counter.yml new file mode 100644 index 00000000000..faa404eb8da --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_acl_counter.yml @@ -0,0 +1,79 @@ +- block: + + - set_fact: crm_stats_acl_counter_used=0 + - set_fact: crm_stats_acl_counter_available=0 + + - name: Copy ACL JSON config to switch. + copy: src=roles/test/tasks/crm/acl.json dest=/tmp + + - name: Add ACL + command: acl-loader update full /tmp/acl.json + become: yes + + - name: Get ACL entry keys + command: bash -c "docker exec -i database redis-cli --raw -n 1 KEYS *SAI_OBJECT_TYPE_ACL_ENTRY*" + register: out + - set_fact: acl_tbl_keys={{out.stdout.split()}} + + - name: Get ethertype for ACL entry in order to match ACL which was configured + command: bash -c "docker exec -i database redis-cli -n 1 HGET {{item}} SAI_ACL_ENTRY_ATTR_FIELD_ETHER_TYPE" + with_items: "{{acl_tbl_keys}}" + register: out + + - name: Match ethertype value for ACL entry + set_fact: key={{item.item}} + with_items: "{{out.results}}" + when: item.stdout|search("2048") + + - name: Get ACL table key + command: bash -c "docker exec -i database redis-cli -n 1 HGET {{key}} SAI_ACL_ENTRY_ATTR_TABLE_ID" + register: out + - set_fact: acl_tbl_key={{"CRM:ACL_TABLE_STATS:{0}".format(out.stdout|replace("oid:", ""))}} + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_acl_counter_used" counter value + command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_counter_used + register: out + - set_fact: new_crm_stats_acl_counter_used={{out.stdout}} + + - name: Get new "crm_stats_acl_counter_available" counter value + command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_counter_available + register: out + - set_fact: new_crm_stats_acl_counter_available={{out.stdout}} + + - name: Verify "crm_stats_acl_counter_used" counter was incremented + assert: {that: "{{new_crm_stats_acl_counter_used|int - crm_stats_acl_counter_used|int == 2}}"} + + - set_fact: crm_stats_acl_counter_available="{{new_crm_stats_acl_counter_available|int + new_crm_stats_acl_counter_used|int}}" + + - name: Verify thresholds for "ACL entry" CRM resource + vars: + crm_cli_res: "acl group counter" + crm_used: "{{new_crm_stats_acl_counter_used}}" + crm_avail: "{{new_crm_stats_acl_counter_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml + + - name: Remove ACL + command: acl-loader delete + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_acl_counter_used" counter value + command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_counter_used + register: out + - set_fact: new_crm_stats_acl_counter_used={{out.stdout}} + + - name: Get new "crm_stats_acl_counter_available" counter value + command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_counter_available + register: out + - set_fact: new_crm_stats_acl_counter_available={{out.stdout}} + + - name: Verify "crm_stats_acl_counter_used" counter was decremented + assert: {that: "{{new_crm_stats_acl_counter_used|int - crm_stats_acl_counter_used|int == 0}}"} + + - name: Verify "crm_stats_acl_counter_available" counter was incremented + assert: {that: "{{new_crm_stats_acl_counter_available|int - crm_stats_acl_counter_available|int == 0}}"} diff --git a/ansible/roles/test/tasks/crm/crm_test_acl_entry.yml b/ansible/roles/test/tasks/crm/crm_test_acl_entry.yml new file mode 100644 index 00000000000..424526d61c6 --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_acl_entry.yml @@ -0,0 +1,82 @@ +- block: + + - set_fact: crm_stats_acl_entry_used=0 + - set_fact: crm_stats_acl_entry_available=0 + + - name: Copy ACL JSON config to switch. + copy: src=roles/test/tasks/crm/acl.json dest=/tmp + + - name: Add ACL + command: acl-loader update full /tmp/acl.json + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get ACL entry keys + command: bash -c "docker exec -i database redis-cli --raw -n 1 KEYS *SAI_OBJECT_TYPE_ACL_ENTRY*" + register: out + - set_fact: acl_tbl_keys={{out.stdout.split()}} + + - name: Get ethertype for ACL entry in order to match ACL which was configured + command: bash -c "docker exec -i database redis-cli -n 1 HGET {{item}} SAI_ACL_ENTRY_ATTR_FIELD_ETHER_TYPE" + with_items: "{{acl_tbl_keys}}" + register: out + + - name: Match ethertype value for ACL entry + set_fact: key={{item.item}} + with_items: "{{out.results}}" + when: item.stdout|search("2048") + + - name: Get ACL table key + command: bash -c "docker exec -i database redis-cli -n 1 HGET {{key}} SAI_ACL_ENTRY_ATTR_TABLE_ID" + register: out + - set_fact: acl_tbl_key={{"CRM:ACL_TABLE_STATS:{0}".format(out.stdout|replace("oid:", ""))}} + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_acl_entry_used" counter value + command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_entry_used + register: out + - set_fact: new_crm_stats_acl_entry_used={{out.stdout}} + + - name: Get new "crm_stats_acl_entry_available" counter value + command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_entry_available + register: out + - set_fact: new_crm_stats_acl_entry_available={{out.stdout}} + + - name: Verify "crm_stats_acl_entry_used" counter was incremented + assert: {that: "{{new_crm_stats_acl_entry_used|int - crm_stats_acl_entry_used|int == 2}}"} + + - set_fact: crm_stats_acl_entry_available="{{new_crm_stats_acl_entry_available|int + new_crm_stats_acl_entry_used|int}}" + + - name: Verify thresholds for "ACL entry" CRM resource + vars: + crm_cli_res: "acl group entry" + crm_used: "{{new_crm_stats_acl_entry_used}}" + crm_avail: "{{new_crm_stats_acl_entry_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml + + - name: Remove ACL + command: acl-loader delete + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_acl_entry_used" counter value + command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_entry_used + register: out + - set_fact: new_crm_stats_acl_entry_used={{out.stdout}} + + - name: Get new "crm_stats_acl_entry_available" counter value + command: docker exec -i database redis-cli -n 2 HGET {{acl_tbl_key}} crm_stats_acl_entry_available + register: out + - set_fact: new_crm_stats_acl_entry_available={{out.stdout}} + + - name: Verify "crm_stats_acl_entry_used" counter was decremented + assert: {that: "{{new_crm_stats_acl_entry_used|int - crm_stats_acl_entry_used|int == 0}}"} + + - name: Verify "crm_stats_acl_entry_available" counter was incremented + assert: {that: "{{new_crm_stats_acl_entry_available|int - crm_stats_acl_entry_available|int == 0}}"} diff --git a/ansible/roles/test/tasks/crm/crm_test_fdb_entry.yml b/ansible/roles/test/tasks/crm/crm_test_fdb_entry.yml new file mode 100644 index 00000000000..165270cb845 --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_fdb_entry.yml @@ -0,0 +1,95 @@ +- block: + + - name: Get "crm_stats_fdb_entry_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_fdb_entry_used + register: out + - set_fact: crm_stats_fdb_entry_used={{out.stdout}} + + - name: Get "crm_stats_fdb_entry_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_fdb_entry_available + register: out + - set_fact: crm_stats_fdb_entry_available={{out.stdout}} + + - name: Copy FDB JSON config to switch. + copy: src=roles/test/tasks/crm/fdb.json dest=/tmp + + - name: Copy FDB JSON config to SWSS container + command: docker cp /tmp/fdb.json swss:/ + + - name: Add FDB entry + command: docker exec -i swss swssconfig /fdb.json + + - name: Add VLAN required for FDB entry + command: config vlan add 2 + become: yes + + - name: Add VLAN member required for FDB entry + command: config vlan member add 2 Ethernet0 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_fdb_entry_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_fdb_entry_used + register: out + - set_fact: new_crm_stats_fdb_entry_used={{out.stdout}} + + - name: Get new "crm_stats_fdb_entry_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_fdb_entry_available + register: out + - set_fact: new_crm_stats_fdb_entry_available={{out.stdout}} + + - name: Verify "crm_stats_fdb_entry_used" counter was incremented + assert: {that: "{{new_crm_stats_fdb_entry_used|int - crm_stats_fdb_entry_used|int == 1}}"} + + - name: Verify "crm_stats_fdb_entry_available" counter was decremented + assert: {that: "{{crm_stats_fdb_entry_available|int - new_crm_stats_fdb_entry_available|int == 1}}"} + + - name: Verify thresholds for "FDB entry" CRM resource + vars: + crm_cli_res: "fdb" + crm_used: "{{new_crm_stats_fdb_entry_used}}" + crm_avail: "{{new_crm_stats_fdb_entry_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml + + - name: Remove FDB entry + command: fdbclear + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_fdb_entry_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_fdb_entry_used + register: out + - set_fact: new_crm_stats_fdb_entry_used={{out.stdout}} + + - name: Get new "crm_stats_fdb_entry_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_fdb_entry_available + register: out + - set_fact: new_crm_stats_fdb_entry_available={{out.stdout}} + + - name: Verify "crm_stats_fdb_entry_used" counter was decremented + assert: {that: "{{new_crm_stats_fdb_entry_used|int - crm_stats_fdb_entry_used|int == 0}}"} + + - name: Verify "crm_stats_fdb_entry_available" counter was incremented + assert: {that: "{{new_crm_stats_fdb_entry_available|int - crm_stats_fdb_entry_available|int == 0}}"} + + always: + + - name: Remove VLAN member required for FDB entry + command: config vlan member del 2 Ethernet0 + become: yes + + - name: Remove VLAN required for FDB entry + command: config vlan del 2 + become: yes + + - name: Remove FDB entry + command: fdbclear + + - name: Remove FDB JSON config from switch. + command: rm /tmp/fdb.json + + - name: Remove FDB JSON config from SWSS container + command: docker exec -i swss rm /fdb.json diff --git a/ansible/roles/test/tasks/crm/crm_test_ipv4_neighbor.yml b/ansible/roles/test/tasks/crm/crm_test_ipv4_neighbor.yml new file mode 100644 index 00000000000..5e553a173bb --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_ipv4_neighbor.yml @@ -0,0 +1,64 @@ +- block: + + - name: Get "crm_stats_ipv4_neighbor_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_neighbor_used + register: out + - set_fact: crm_stats_ipv4_neighbor_used={{out.stdout}} + + - name: Get "crm_stats_ipv4_neighbor_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_neighbor_available + register: out + - set_fact: crm_stats_ipv4_neighbor_available={{out.stdout}} + + - name: Add IPv4 neighbor + command: ip neigh replace 2.2.2.2 lladdr 11:22:33:44:55:66 dev {{crm_intf}} + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv4_neighbor_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_neighbor_used + register: out + - set_fact: new_crm_stats_ipv4_neighbor_used={{out.stdout}} + + - name: Get new "crm_stats_ipv4_neighbor_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_neighbor_available + register: out + - set_fact: new_crm_stats_ipv4_neighbor_available={{out.stdout}} + + - name: Verify "crm_stats_ipv4_neighbor_used" counter was incremented + assert: {that: "{{new_crm_stats_ipv4_neighbor_used|int - crm_stats_ipv4_neighbor_used|int >= 1}}"} + + - name: Verify "crm_stats_ipv4_neighbor_available" counter was decremented + assert: {that: "{{crm_stats_ipv4_neighbor_available|int - new_crm_stats_ipv4_neighbor_available|int == 1}}"} + + - name: Remove IPv4 neighbor + command: ip neigh del 2.2.2.2 lladdr 11:22:33:44:55:66 dev {{crm_intf}} + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv4_neighbor_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_neighbor_used + register: out + - set_fact: new_crm_stats_ipv4_neighbor_used={{out.stdout}} + + - name: Get new "crm_stats_ipv4_neighbor_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_neighbor_available + register: out + - set_fact: new_crm_stats_ipv4_neighbor_available={{out.stdout}} + + - name: Verify "crm_stats_ipv4_neighbor_used" counter was decremented + assert: {that: "{{new_crm_stats_ipv4_neighbor_used|int - crm_stats_ipv4_neighbor_used|int >= 0}}"} + + - name: Verify "crm_stats_ipv4_neighbor_available" counter was incremented + assert: {that: "{{new_crm_stats_ipv4_neighbor_available|int - crm_stats_ipv4_neighbor_available|int == 0}}"} + + - name: Verify thresholds for "IPv4 neighbor" CRM resource + vars: + crm_cli_res: "ipv4 neighbor" + crm_used: "{{new_crm_stats_ipv4_neighbor_used}}" + crm_avail: "{{new_crm_stats_ipv4_neighbor_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml diff --git a/ansible/roles/test/tasks/crm/crm_test_ipv4_nexthop.yml b/ansible/roles/test/tasks/crm/crm_test_ipv4_nexthop.yml new file mode 100644 index 00000000000..689cd5bd964 --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_ipv4_nexthop.yml @@ -0,0 +1,64 @@ +- block: + + - name: Get "crm_stats_ipv4_nexthop_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_nexthop_used + register: out + - set_fact: crm_stats_ipv4_nexthop_used={{out.stdout}} + + - name: Get "crm_stats_ipv4_nexthop_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_nexthop_available + register: out + - set_fact: crm_stats_ipv4_nexthop_available={{out.stdout}} + + - name: Add IPv4 nexthop + command: ip neigh replace 2.2.2.2 lladdr 11:22:33:44:55:66 dev {{crm_intf}} + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv4_nexthop_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_nexthop_used + register: out + - set_fact: new_crm_stats_ipv4_nexthop_used={{out.stdout}} + + - name: Get new "crm_stats_ipv4_nexthop_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_nexthop_available + register: out + - set_fact: new_crm_stats_ipv4_nexthop_available={{out.stdout}} + + - name: Verify "crm_stats_ipv4_nexthop_used" counter was incremented + assert: {that: "{{new_crm_stats_ipv4_nexthop_used|int - crm_stats_ipv4_nexthop_used|int == 1}}"} + + - name: Verify "crm_stats_ipv4_nexthop_available" counter was decremented + assert: {that: "{{crm_stats_ipv4_nexthop_available|int - new_crm_stats_ipv4_nexthop_available|int == 1}}"} + + - name: Remove IPv4 nexthop + command: ip neigh del 2.2.2.2 lladdr 11:22:33:44:55:66 dev {{crm_intf}} + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv4_nexthop_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_nexthop_used + register: out + - set_fact: new_crm_stats_ipv4_nexthop_used={{out.stdout}} + + - name: Get new "crm_stats_ipv4_nexthop_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_nexthop_available + register: out + - set_fact: new_crm_stats_ipv4_nexthop_available={{out.stdout}} + + - name: Verify "crm_stats_ipv4_nexthop_used" counter was decremented + assert: {that: "{{new_crm_stats_ipv4_nexthop_used|int - crm_stats_ipv4_nexthop_used|int == 0}}"} + + - name: Verify "crm_stats_ipv4_nexthop_available" counter was incremented + assert: {that: "{{new_crm_stats_ipv4_nexthop_available|int - crm_stats_ipv4_nexthop_available|int == 0}}"} + + - name: Verify thresholds for "IPv4 nexthop" CRM resource + vars: + crm_cli_res: "ipv4 nexthop" + crm_used: "{{new_crm_stats_ipv4_nexthop_used}}" + crm_avail: "{{new_crm_stats_ipv4_nexthop_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml diff --git a/ansible/roles/test/tasks/crm/crm_test_ipv4_route.yml b/ansible/roles/test/tasks/crm/crm_test_ipv4_route.yml new file mode 100644 index 00000000000..4e5b00cc73e --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_ipv4_route.yml @@ -0,0 +1,64 @@ +- block: + + - name: Get "crm_stats_ipv4_route_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_route_used + register: out + - set_fact: crm_stats_ipv4_route_used={{out.stdout}} + + - name: Get "crm_stats_ipv4_route_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_route_available + register: out + - set_fact: crm_stats_ipv4_route_available={{out.stdout}} + + - name: Add IPv4 route + command: ip route add 2.2.2.0/24 via 10.0.0.57 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv4_route_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_route_used + register: out + - set_fact: new_crm_stats_ipv4_route_used={{out.stdout}} + + - name: Get new "crm_stats_ipv4_route_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_route_available + register: out + - set_fact: new_crm_stats_ipv4_route_available={{out.stdout}} + + - name: Verify "crm_stats_ipv4_route_used" counter was incremented + assert: {that: "{{new_crm_stats_ipv4_route_used|int - crm_stats_ipv4_route_used|int == 1}}"} + + - name: Verify "crm_stats_ipv4_route_available" counter was decremented + assert: {that: "{{crm_stats_ipv4_route_available|int - new_crm_stats_ipv4_route_available|int == 1}}"} + + - name: Remove IPv4 route + command: ip route del 2.2.2.0/24 via 10.0.0.57 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv4_route_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_route_used + register: out + - set_fact: new_crm_stats_ipv4_route_used={{out.stdout}} + + - name: Get new "crm_stats_ipv4_route_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv4_route_available + register: out + - set_fact: new_crm_stats_ipv4_route_available={{out.stdout}} + + - name: Verify "crm_stats_ipv4_route_used" counter was decremented + assert: {that: "{{new_crm_stats_ipv4_route_used|int - crm_stats_ipv4_route_used|int == 0}}"} + + - name: Verify "crm_stats_ipv4_route_available" counter was incremented + assert: {that: "{{new_crm_stats_ipv4_route_available|int - crm_stats_ipv4_route_available|int == 0}}"} + + - name: Verify thresholds for "IPv4 route" CRM resource + vars: + crm_cli_res: "ipv4 route" + crm_used: "{{new_crm_stats_ipv4_route_used}}" + crm_avail: "{{new_crm_stats_ipv4_route_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml diff --git a/ansible/roles/test/tasks/crm/crm_test_ipv6_neighbor.yml b/ansible/roles/test/tasks/crm/crm_test_ipv6_neighbor.yml new file mode 100644 index 00000000000..40fcbd53cdb --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_ipv6_neighbor.yml @@ -0,0 +1,64 @@ +- block: + + - name: Get "crm_stats_ipv6_neighbor_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_neighbor_used + register: out + - set_fact: crm_stats_ipv6_neighbor_used={{out.stdout}} + + - name: Get "crm_stats_ipv6_neighbor_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_neighbor_available + register: out + - set_fact: crm_stats_ipv6_neighbor_available={{out.stdout}} + + - name: Add IPv6 neighbor + command: ip neigh replace 2001::1 lladdr 11:22:33:44:55:66 dev {{crm_intf}} + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv6_neighbor_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_neighbor_used + register: out + - set_fact: new_crm_stats_ipv6_neighbor_used={{out.stdout}} + + - name: Get new "crm_stats_ipv6_neighbor_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_neighbor_available + register: out + - set_fact: new_crm_stats_ipv6_neighbor_available={{out.stdout}} + + - name: Verify "crm_stats_ipv6_neighbor_used" counter was incremented + assert: {that: "{{new_crm_stats_ipv6_neighbor_used|int - crm_stats_ipv6_neighbor_used|int >= 1}}"} + + - name: Verify "crm_stats_ipv6_neighbor_available" counter was decremented + assert: {that: "{{crm_stats_ipv6_neighbor_available|int - new_crm_stats_ipv6_neighbor_available|int == 1}}"} + + - name: Remove IPv6 neighbor + command: ip neigh del 2001::1 lladdr 11:22:33:44:55:66 dev {{crm_intf}} + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv6_neighbor_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_neighbor_used + register: out + - set_fact: new_crm_stats_ipv6_neighbor_used={{out.stdout}} + + - name: Get new "crm_stats_ipv6_neighbor_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_neighbor_available + register: out + - set_fact: new_crm_stats_ipv6_neighbor_available={{out.stdout}} + + - name: Verify "crm_stats_ipv6_neighbor_used" counter was decremented + assert: {that: "{{new_crm_stats_ipv6_neighbor_used|int - crm_stats_ipv6_neighbor_used|int >= 0}}"} + + - name: Verify "crm_stats_ipv6_neighbor_available" counter was incremented + assert: {that: "{{new_crm_stats_ipv6_neighbor_available|int - crm_stats_ipv6_neighbor_available|int == 0}}"} + + - name: Verify thresholds for "IPv6 neighbor" CRM resource + vars: + crm_cli_res: "ipv6 neighbor" + crm_used: "{{new_crm_stats_ipv6_neighbor_used}}" + crm_avail: "{{new_crm_stats_ipv6_neighbor_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml diff --git a/ansible/roles/test/tasks/crm/crm_test_ipv6_nexthop.yml b/ansible/roles/test/tasks/crm/crm_test_ipv6_nexthop.yml new file mode 100644 index 00000000000..754e32c4f33 --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_ipv6_nexthop.yml @@ -0,0 +1,64 @@ +- block: + + - name: Get "crm_stats_ipv6_nexthop_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_nexthop_used + register: out + - set_fact: crm_stats_ipv6_nexthop_used={{out.stdout}} + + - name: Get "crm_stats_ipv6_nexthop_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_nexthop_available + register: out + - set_fact: crm_stats_ipv6_nexthop_available={{out.stdout}} + + - name: Add IPv6 nexthop + command: ip neigh replace 2001::1 lladdr 11:22:33:44:55:66 dev {{crm_intf}} + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv6_nexthop_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_nexthop_used + register: out + - set_fact: new_crm_stats_ipv6_nexthop_used={{out.stdout}} + + - name: Get new "crm_stats_ipv6_nexthop_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_nexthop_available + register: out + - set_fact: new_crm_stats_ipv6_nexthop_available={{out.stdout}} + + - name: Verify "crm_stats_ipv6_nexthop_used" counter was incremented + assert: {that: "{{new_crm_stats_ipv6_nexthop_used|int - crm_stats_ipv6_nexthop_used|int == 1}}"} + + - name: Verify "crm_stats_ipv6_nexthop_available" counter was decremented + assert: {that: "{{crm_stats_ipv6_nexthop_available|int - new_crm_stats_ipv6_nexthop_available|int == 1}}"} + + - name: Remove IPv6 nexthop + command: ip neigh del 2001::1 lladdr 11:22:33:44:55:66 dev {{crm_intf}} + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv6_nexthop_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_nexthop_used + register: out + - set_fact: new_crm_stats_ipv6_nexthop_used={{out.stdout}} + + - name: Get new "crm_stats_ipv6_nexthop_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_nexthop_available + register: out + - set_fact: new_crm_stats_ipv6_nexthop_available={{out.stdout}} + + - name: Verify "crm_stats_ipv6_nexthop_used" counter was decremented + assert: {that: "{{new_crm_stats_ipv6_nexthop_used|int - crm_stats_ipv6_nexthop_used|int == 0}}"} + + - name: Verify "crm_stats_ipv6_nexthop_available" counter was incremented + assert: {that: "{{new_crm_stats_ipv6_nexthop_available|int - crm_stats_ipv6_nexthop_available|int == 0}}"} + + - name: Verify thresholds for "IPv6 nexthop" CRM resource + vars: + crm_cli_res: "ipv6 nexthop" + crm_used: "{{new_crm_stats_ipv6_nexthop_used}}" + crm_avail: "{{new_crm_stats_ipv6_nexthop_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml diff --git a/ansible/roles/test/tasks/crm/crm_test_ipv6_route.yml b/ansible/roles/test/tasks/crm/crm_test_ipv6_route.yml new file mode 100644 index 00000000000..a6a5c10a5d8 --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_ipv6_route.yml @@ -0,0 +1,65 @@ +- block: + + - name: Get "crm_stats_ipv6_route_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_route_used + register: out + - set_fact: crm_stats_ipv6_route_used={{out.stdout}} + + - name: Get "crm_stats_ipv6_route_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_route_available + register: out + - set_fact: crm_stats_ipv6_route_available={{out.stdout}} + + - name: Add IPv6 route + command: ip -6 route add 2001::/126 via fc00::72 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv6_route_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_route_used + register: out + - set_fact: new_crm_stats_ipv6_route_used={{out.stdout}} + + - name: Get new "crm_stats_ipv6_route_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_route_available + register: out + - set_fact: new_crm_stats_ipv6_route_available={{out.stdout}} + + - name: Verify "crm_stats_ipv6_route_used" counter was incremented + assert: {that: "{{new_crm_stats_ipv6_route_used|int - crm_stats_ipv6_route_used|int == 1}}"} + + - name: Verify "crm_stats_ipv6_route_available" counter was decremented + assert: {that: "{{crm_stats_ipv6_route_available|int - new_crm_stats_ipv6_route_available|int == 1}}"} + + - name: Remove IPv6 route + command: ip -6 route del 2001::/126 via fc00::72 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_ipv6_route_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_route_used + register: out + - set_fact: new_crm_stats_ipv6_route_used={{out.stdout}} + + - name: Get new "crm_stats_ipv6_route_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_ipv6_route_available + register: out + - set_fact: new_crm_stats_ipv6_route_available={{out.stdout}} + + - name: Verify "crm_stats_ipv6_route_used" counter was decremented + assert: {that: "{{new_crm_stats_ipv6_route_used|int - crm_stats_ipv6_route_used|int == 0}}"} + + - name: Verify "crm_stats_ipv6_route_available" counter was incremented + assert: {that: "{{new_crm_stats_ipv6_route_available|int - crm_stats_ipv6_route_available|int == 0}}"} + + - name: Verify thresholds for "IPv6 route" CRM resource + vars: + crm_cli_res: "ipv6 route" + crm_used: "{{new_crm_stats_ipv6_route_used}}" + crm_avail: "{{new_crm_stats_ipv6_route_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml + diff --git a/ansible/roles/test/tasks/crm/crm_test_nexthop_group.yml b/ansible/roles/test/tasks/crm/crm_test_nexthop_group.yml new file mode 100644 index 00000000000..7b593fe904b --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_nexthop_group.yml @@ -0,0 +1,64 @@ +- block: + + - name: Get "crm_stats_nexthop_group_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_used + register: out + - set_fact: crm_stats_nexthop_group_used={{out.stdout}} + + - name: Get "crm_stats_nexthop_group_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_available + register: out + - set_fact: crm_stats_nexthop_group_available={{out.stdout}} + + - name: Add nexthop group + command: ip route add 2.2.2.0/24 nexthop via 10.0.0.57 nexthop via 10.0.0.59 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_nexthop_group_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_used + register: out + - set_fact: new_crm_stats_nexthop_group_used={{out.stdout}} + + - name: Get new "crm_stats_nexthop_group_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_available + register: out + - set_fact: new_crm_stats_nexthop_group_available={{out.stdout}} + + - name: Verify "crm_stats_nexthop_group_used" counter was incremented + assert: {that: "{{new_crm_stats_nexthop_group_used|int - crm_stats_nexthop_group_used|int == 1}}"} + + - name: Verify "crm_stats_nexthop_group_available" counter was decremented + assert: {that: "{{crm_stats_nexthop_group_available|int - new_crm_stats_nexthop_group_available|int >= 1}}"} + + - name: Remove nexthop group + command: ip route del 2.2.2.0/24 nexthop via 10.0.0.57 nexthop via 10.0.0.59 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_nexthop_group_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_used + register: out + - set_fact: new_crm_stats_nexthop_group_used={{out.stdout}} + + - name: Get new "crm_stats_nexthop_group_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_available + register: out + - set_fact: new_crm_stats_nexthop_group_available={{out.stdout}} + + - name: Verify "crm_stats_nexthop_group_used" counter was decremented + assert: {that: "{{new_crm_stats_nexthop_group_used|int - crm_stats_nexthop_group_used|int == 0}}"} + + - name: Verify "crm_stats_nexthop_group_available" counter was incremented + assert: {that: "{{new_crm_stats_nexthop_group_available|int - crm_stats_nexthop_group_available|int == 0}}"} + + - name: Verify thresholds for "nexthop group" CRM resource + vars: + crm_cli_res: "nexthop group object" + crm_used: "{{new_crm_stats_nexthop_group_used}}" + crm_avail: "{{new_crm_stats_nexthop_group_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml diff --git a/ansible/roles/test/tasks/crm/crm_test_nexthop_group_member.yml b/ansible/roles/test/tasks/crm/crm_test_nexthop_group_member.yml new file mode 100644 index 00000000000..5960a085743 --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_nexthop_group_member.yml @@ -0,0 +1,64 @@ +- block: + + - name: Get "crm_stats_nexthop_group_member_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_member_used + register: out + - set_fact: crm_stats_nexthop_group_member_used={{out.stdout}} + + - name: Get "crm_stats_nexthop_group_member_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_member_available + register: out + - set_fact: crm_stats_nexthop_group_member_available={{out.stdout}} + + - name: Add nexthop group members + command: ip route add 2.2.2.0/24 nexthop via 10.0.0.57 nexthop via 10.0.0.59 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_nexthop_group_member_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_member_used + register: out + - set_fact: new_crm_stats_nexthop_group_member_used={{out.stdout}} + + - name: Get new "crm_stats_nexthop_group_member_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_member_available + register: out + - set_fact: new_crm_stats_nexthop_group_member_available={{out.stdout}} + + - name: Verify "crm_stats_nexthop_group_member_used" counter was incremented + assert: {that: "{{new_crm_stats_nexthop_group_member_used|int - crm_stats_nexthop_group_member_used|int == 2}}"} + + - name: Verify "crm_stats_nexthop_group_member_available" counter was decremented + assert: {that: "{{crm_stats_nexthop_group_member_available|int - new_crm_stats_nexthop_group_member_available|int == 2}}"} + + - name: Remove nexthop group members + command: ip route del 2.2.2.0/24 nexthop via 10.0.0.57 nexthop via 10.0.0.59 + become: yes + + - name: Make sure CRM counters updated + pause: seconds=1 + + - name: Get new "crm_stats_nexthop_group_member_used" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_member_used + register: out + - set_fact: new_crm_stats_nexthop_group_member_used={{out.stdout}} + + - name: Get new "crm_stats_nexthop_group_member_available" counter value + command: docker exec -i database redis-cli -n 2 HGET CRM:STATS crm_stats_nexthop_group_member_available + register: out + - set_fact: new_crm_stats_nexthop_group_member_available={{out.stdout}} + + - name: Verify "crm_stats_nexthop_group_member_used" counter was decremented + assert: {that: "{{new_crm_stats_nexthop_group_member_used|int - crm_stats_nexthop_group_member_used|int == 0}}"} + + - name: Verify "crm_stats_nexthop_group_member_available" counter was incremented + assert: {that: "{{new_crm_stats_nexthop_group_member_available|int - crm_stats_nexthop_group_member_available|int == 0}}"} + + - name: Verify thresholds for "nexthop group member" CRM resource + vars: + crm_cli_res: "nexthop group member" + crm_used: "{{new_crm_stats_nexthop_group_member_used}}" + crm_avail: "{{new_crm_stats_nexthop_group_member_available}}" + include: roles/test/tasks/crm/crm_test_threshold.yml diff --git a/ansible/roles/test/tasks/crm/crm_test_threshold.yml b/ansible/roles/test/tasks/crm/crm_test_threshold.yml new file mode 100644 index 00000000000..3384f21e455 --- /dev/null +++ b/ansible/roles/test/tasks/crm/crm_test_threshold.yml @@ -0,0 +1,76 @@ +- block: + + - name: Verify "CRM_EXCEEDED" log message for "used" threshold + vars: + command_to_run: bash -c "crm config thresholds {{crm_cli_res}} type used; crm config thresholds {{crm_cli_res}} low {{crm_used|int - 1}}; crm config thresholds {{crm_cli_res}} high {{crm_used|int}}" + tests_location: roles/test/tasks + testname: crm + test_expect_file: expect_crm_th_exceeded + out_dir: /tmp + run_dir: /tmp + errors_expected: true + include: roles/test/tasks/run_command_with_log_analyzer.yml + + - name: Verify "CRM_CLEAR" log message for "used" threshold + vars: + command_to_run: bash -c "crm config thresholds {{crm_cli_res}} type used && crm config thresholds {{crm_cli_res}} low {{crm_used|int}} && crm config thresholds {{crm_cli_res}} high {{crm_used|int + 1}}" + tests_location: roles/test/tasks + testname: crm + test_expect_file: expect_crm_th_clear + out_dir: /tmp + run_dir: /tmp + errors_expected: true + include: roles/test/tasks/run_command_with_log_analyzer.yml + + - name: Verify "CRM_EXCEEDED" log message for "free" threshold + vars: + command_to_run: bash -c "crm config thresholds {{crm_cli_res}} type free && crm config thresholds {{crm_cli_res}} low {{crm_avail|int - 1}} && crm config thresholds {{crm_cli_res}} high {{crm_avail|int}}" + tests_location: roles/test/tasks + testname: crm + test_expect_file: expect_crm_th_exceeded + out_dir: /tmp + run_dir: /tmp + errors_expected: true + include: roles/test/tasks/run_command_with_log_analyzer.yml + + - name: Verify "CRM_CLEAR" log message for "free" threshold + vars: + command_to_run: bash -c "crm config thresholds {{crm_cli_res}} type free && crm config thresholds {{crm_cli_res}} low {{crm_avail|int}} && crm config thresholds {{crm_cli_res}} high {{crm_avail|int + 1}}" + tests_location: roles/test/tasks + testname: crm + test_expect_file: expect_crm_th_clear + out_dir: /tmp + run_dir: /tmp + errors_expected: true + include: roles/test/tasks/run_command_with_log_analyzer.yml + + - name: Verify "CRM_EXCEEDED" log message for "percentage" threshold + vars: + th_lo: "{{(crm_used|int * 100 / (crm_used|int + crm_avail|int)) - 1}}" + th_hi: "{{crm_used|int * 100 / (crm_used|int + crm_avail|int)}}" + command_to_run: bash -c "crm config thresholds {{crm_cli_res}} type percentage && crm config thresholds {{crm_cli_res}} low {{th_lo|int}} && crm config thresholds {{crm_cli_res}} high {{th_hi|int}}" + tests_location: roles/test/tasks + testname: crm + test_expect_file: expect_crm_th_exceeded + out_dir: /tmp + run_dir: /tmp + errors_expected: true + include: roles/test/tasks/run_command_with_log_analyzer.yml + + - name: Verify "CRM_CLEAR" log message for "percentage" threshold + vars: + th_lo: "{{crm_used|int * 100 / (crm_used|int + crm_avail|int)}}" + th_hi: "{{(crm_used|int * 100 / (crm_used|int + crm_avail|int)) + 1}}" + command_to_run: bash -c "crm config thresholds {{crm_cli_res}} type percentage && crm config thresholds {{crm_cli_res}} low {{th_lo|int}} && crm config thresholds {{crm_cli_res}} high {{th_hi|int}}" + tests_location: roles/test/tasks + testname: crm + test_expect_file: expect_crm_th_clear + out_dir: /tmp + run_dir: /tmp + errors_expected: true + include: roles/test/tasks/run_command_with_log_analyzer.yml + + always: + + - name: Restore CRM threshods + command: bash -c "crm config thresholds {{crm_cli_res}} type percentage && crm config thresholds {{crm_cli_res}} low 70 && crm config thresholds {{crm_cli_res}} high 85" diff --git a/ansible/roles/test/tasks/crm/expect_crm_th_clear b/ansible/roles/test/tasks/crm/expect_crm_th_clear new file mode 100644 index 00000000000..fab01e5131c --- /dev/null +++ b/ansible/roles/test/tasks/crm/expect_crm_th_clear @@ -0,0 +1 @@ +r, ".* THRESHOLD_CLEAR .*" diff --git a/ansible/roles/test/tasks/crm/expect_crm_th_exceeded b/ansible/roles/test/tasks/crm/expect_crm_th_exceeded new file mode 100644 index 00000000000..dd42f4412f1 --- /dev/null +++ b/ansible/roles/test/tasks/crm/expect_crm_th_exceeded @@ -0,0 +1 @@ +r, ".* THRESHOLD_EXCEEDED .*" diff --git a/ansible/roles/test/tasks/crm/fdb.json b/ansible/roles/test/tasks/crm/fdb.json new file mode 100644 index 00000000000..e280e3d68fe --- /dev/null +++ b/ansible/roles/test/tasks/crm/fdb.json @@ -0,0 +1,9 @@ +[ + { + "FDB_TABLE:Vlan2:52-54-00-25-07-E9": { + "port": "Ethernet0", + "type": "dynamic" + }, + "OP": "SET" + } +] diff --git a/ansible/roles/test/tasks/test_sonic_by_tag.yml b/ansible/roles/test/tasks/test_sonic_by_tag.yml index 426ec840fe5..c4286da552d 100644 --- a/ansible/roles/test/tasks/test_sonic_by_tag.yml +++ b/ansible/roles/test/tasks/test_sonic_by_tag.yml @@ -175,3 +175,7 @@ - name: neighbor mac change test without using ptf include: neighbour-mac-noptf.yml tags: neighbour_mac_noptf + +- name: CRM test + include: crm.yml + tags: crm diff --git a/ansible/roles/test/vars/testcases.yml b/ansible/roles/test/vars/testcases.yml index 8624f81f69a..ffd95b8c1e8 100644 --- a/ansible/roles/test/vars/testcases.yml +++ b/ansible/roles/test/vars/testcases.yml @@ -184,3 +184,7 @@ testcases: required_vars: ptf_host: testbed_type: + + crm: + filename: crm.yml + topologies: [t1, t1-lag, t0]