diff --git a/ntc_templates/templates/hp_comware_display_route-policy.textfsm b/ntc_templates/templates/hp_comware_display_route-policy.textfsm new file mode 100644 index 0000000000..88b0fc7e02 --- /dev/null +++ b/ntc_templates/templates/hp_comware_display_route-policy.textfsm @@ -0,0 +1,15 @@ +Value Filldown POLICY_NAME (\S+) +Value Required ACTION (Permit|Deny) +Value Required NODE (\d+) +Value List IF_MATCH (.+) +Value List APPLY (.+) + +Start + ^Route-policy:\s+ -> Continue.Record + ^Route-policy:\s+${POLICY_NAME}\s*$$ + ^\s+(Permit|Deny)\s+:\s+\d+ -> Continue.Record + ^\s+${ACTION}\s+:\s+${NODE}\s*$$ + ^\s+if-match\s+${IF_MATCH}\s*$$ + ^\s+apply\s+${APPLY}\s*$$ + ^\s*$$ -> Record + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 8d4ecac01b..2391793f97 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -681,6 +681,7 @@ hp_comware_display_interface_brief.textfsm, .*, hp_comware, di[[splay]] int[[erf hp_comware_display_ip_vpn-instance.textfsm, .*, hp_comware, di[[splay]] ip vpn[[-instance]] hp_comware_display_bgp_peer_ipv4.textfsm, .*, hp_comware, di[[splay]] bg[[p]] pe[[er]] ipv4 hp_comware_display_ip_interface.textfsm, .*, hp_comware, dis[[play]] ip i[[nterface]] +hp_comware_display_route-policy.textfsm, .*, hp_comware, di[[splay]] route[[-policy]] hp_comware_display_mac-address.textfsm, .*, hp_comware, di[[splay]] mac-ad[[dress]] hp_comware_display_vlan_brief.textfsm, .*, hp_comware, di[[splay]] v[[lan]] b[[rief]] hp_comware_display_interface.textfsm, .*, hp_comware, dis[[play]] int[[erface]] diff --git a/tests/hp_comware/display_route-policy/hp_comware_display_route-policy.raw b/tests/hp_comware/display_route-policy/hp_comware_display_route-policy.raw new file mode 100644 index 0000000000..923cf712bb --- /dev/null +++ b/tests/hp_comware/display_route-policy/hp_comware_display_route-policy.raw @@ -0,0 +1,15 @@ +Route-policy: ACTIVE_OUT + Permit : 10 + if-match ip address prefix-list pl_customer_only + +Route-policy: BACKUP_ACT_OUT + Permit : 10 + if-match ip address prefix-list pl_customer_only + apply community 1111:135 + Deny : 99 + +Route-policy: BACKUP_SBY_OUT + Permit : 10 + if-match ip address prefix-list pl_customer_only + apply community 1111:130 + Deny : 99 diff --git a/tests/hp_comware/display_route-policy/hp_comware_display_route-policy.yml b/tests/hp_comware/display_route-policy/hp_comware_display_route-policy.yml new file mode 100644 index 0000000000..b6119f8a97 --- /dev/null +++ b/tests/hp_comware/display_route-policy/hp_comware_display_route-policy.yml @@ -0,0 +1,32 @@ +--- +parsed_sample: + - action: "Permit" + apply: [] + if_match: + - "ip address prefix-list pl_customer_only" + node: "10" + policy_name: "ACTIVE_OUT" + - action: "Permit" + apply: + - "community 1111:135" + if_match: + - "ip address prefix-list pl_customer_only" + node: "10" + policy_name: "BACKUP_ACT_OUT" + - action: "Deny" + apply: [] + if_match: [] + node: "99" + policy_name: "BACKUP_ACT_OUT" + - action: "Permit" + apply: + - "community 1111:130" + if_match: + - "ip address prefix-list pl_customer_only" + node: "10" + policy_name: "BACKUP_SBY_OUT" + - action: "Deny" + apply: [] + if_match: [] + node: "99" + policy_name: "BACKUP_SBY_OUT" diff --git a/tests/hp_comware/display_route-policy/hp_comware_display_route-policy1.raw b/tests/hp_comware/display_route-policy/hp_comware_display_route-policy1.raw new file mode 100644 index 0000000000..019c082401 --- /dev/null +++ b/tests/hp_comware/display_route-policy/hp_comware_display_route-policy1.raw @@ -0,0 +1,10 @@ +Route-policy: active_out + Permit : 10 + if-match ip address prefix-list pl_customer_only + +Route-policy: test_policy + Permit : 10 + if-match cost 10 + if-match ip address prefix-list pl_customer_only + apply community 1111:100 + apply local-preference 200 diff --git a/tests/hp_comware/display_route-policy/hp_comware_display_route-policy1.yml b/tests/hp_comware/display_route-policy/hp_comware_display_route-policy1.yml new file mode 100644 index 0000000000..03a032194c --- /dev/null +++ b/tests/hp_comware/display_route-policy/hp_comware_display_route-policy1.yml @@ -0,0 +1,17 @@ +--- +parsed_sample: + - action: "Permit" + apply: [] + if_match: + - "ip address prefix-list pl_customer_only" + node: "10" + policy_name: "active_out" + - action: "Permit" + apply: + - "community 1111:100" + - "local-preference 200" + if_match: + - "cost 10" + - "ip address prefix-list pl_customer_only" + node: "10" + policy_name: "test_policy"