-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from netascode/mcast_rule
Add Mcast Rule for Underlay and TRM
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
roles/validate/files/rules/required_rules/202_global_underlay_mcast_trm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class Rule: | ||
id = "202" | ||
description = "Verify Fabric Underlay Supports Multicast for TRM" | ||
severity = "HIGH" | ||
|
||
@classmethod | ||
def match(cls, inventory): | ||
results = [] | ||
fabric_replication = False | ||
fabric_mcast_mode = False | ||
fabric_trm = False | ||
|
||
if inventory.get("vxlan", None): | ||
if inventory["vxlan"].get("underlay", None): | ||
if inventory["vxlan"].get("underlay").get("general", None): | ||
fabric_replication = inventory["vxlan"]["underlay"]["general"].get("replication_mode", False) | ||
|
||
if inventory["vxlan"].get("underlay").get("multicast", None): | ||
fabric_mcast_mode = inventory["vxlan"]["underlay"]["multicast"].get("rp_mode", False) | ||
fabric_trm = inventory["vxlan"]["underlay"]["multicast"].get("trm_enable", False) | ||
|
||
if fabric_replication: | ||
if ((fabric_replication == "multicast" and fabric_mcast_mode == "bidir" and fabric_trm) or | ||
(fabric_replication == "ingress" and fabric_trm)): | ||
results.append( | ||
"For vxlan.underlay.multicast.trm_enable to be enabled, " | ||
"vxlan.underlay.general.replication_mode must be set to multicast and " | ||
"vxlan.underlay.multicast.rp_mode must be set to asm." | ||
) | ||
|
||
return results |