summaryrefslogtreecommitdiffstats
path: root/tests/topotests/lib/pim.py
diff options
context:
space:
mode:
authorNathan Bahr <nbahr@atcorp.com>2024-09-18 17:00:10 +0200
committerNathan Bahr <nbahr@atcorp.com>2024-09-24 18:40:57 +0200
commitdff1db9ef699a768806d1aa752f0166d33339bc9 (patch)
tree74ced7add80ac4149e3b14076419c75b3bf07531 /tests/topotests/lib/pim.py
parenttests: Update existing tests for changes introduced by AutoRP Discovery (diff)
downloadfrr-dff1db9ef699a768806d1aa752f0166d33339bc9.tar.xz
frr-dff1db9ef699a768806d1aa752f0166d33339bc9.zip
tests: Addition of AutoRP Discovery uncovered broken PIM test
With AutoRP discovery running by default, that adds a new IGMP group that needs to be accounted for in IGMP output. For pim.py The clear IGMP interfaces function is in a broken state. It was already ignoring any errors and returned true always, but with the addition of the AutoRP discovery group, you could end up with a different group order in the json which would cause a key error making the test fail. For now I just added a check to avoid the key error. Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Diffstat (limited to '')
-rw-r--r--tests/topotests/lib/pim.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/topotests/lib/pim.py b/tests/topotests/lib/pim.py
index 9eb3a076a..369a794eb 100644
--- a/tests/topotests/lib/pim.py
+++ b/tests/topotests/lib/pim.py
@@ -2454,10 +2454,11 @@ def clear_igmp_interfaces(tgen, dut):
# Verify uptime for groups
for group in group_before_clear.keys():
- d1 = datetime.datetime.strptime(group_before_clear[group], "%H:%M:%S")
- d2 = datetime.datetime.strptime(group_after_clear[group], "%H:%M:%S")
- if d2 >= d1:
- errormsg = ("[DUT: %s]: IGMP group is not cleared", " [FAILED!!]", dut)
+ if group in group_after_clear:
+ d1 = datetime.datetime.strptime(group_before_clear[group], "%H:%M:%S")
+ d2 = datetime.datetime.strptime(group_after_clear[group], "%H:%M:%S")
+ if d2 >= d1:
+ errormsg = ("[DUT: %s]: IGMP group is not cleared", " [FAILED!!]", dut)
logger.info("[DUT: %s]: IGMP group is cleared [PASSED!!]")