Skip to content

Commit

Permalink
tests: PIM AutoRP tests expanded
Browse files Browse the repository at this point in the history
Now with a full AutoRP implementation, we can test AutoRP in a full network setup
beginning with candidate RP announcements all the way through discovery and active RP
selection.

Signed-off-by: Nathan Bahr <[email protected]>
  • Loading branch information
nabahr committed Nov 19, 2024
1 parent ddf750b commit 027f48f
Show file tree
Hide file tree
Showing 6 changed files with 696 additions and 220 deletions.
40 changes: 20 additions & 20 deletions tests/topotests/lib/pim.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,26 +1720,26 @@ def verify_pim_rp_info(
)
return errormsg

if not iamRP:
if rp_json["iAmRP"] == False:
logger.info(
"[DUT %s]: Verifying group "
"and iAmNotRP [PASSED]!!"
" Found Expected: (%s, %s:%s)",
dut,
grp_addr,
"iAmRP",
rp_json["iAmRP"],
)
else:
errormsg = (
"[DUT %s]: Verifying group"
"%s and iAmRP [FAILED]!! "
"Expected: (iAmRP: %s),"
" Found: (iAmRP: %s)"
% (dut, grp_addr, "false", rp_json["iAmRP"])
)
return errormsg
if not iamRP:
if rp_json["iAmRP"] == False:
logger.info(
"[DUT %s]: Verifying group "
"and iAmNotRP [PASSED]!!"
" Found Expected: (%s, %s:%s)",
dut,
grp_addr,
"iAmRP",
rp_json["iAmRP"],
)
else:
errormsg = (
"[DUT %s]: Verifying group"
"%s and iAmRP [FAILED]!! "
"Expected: (iAmRP: %s),"
" Found: (iAmRP: %s)"
% (dut, grp_addr, "false", rp_json["iAmRP"])
)
return errormsg

logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name))
return True
Expand Down
12 changes: 11 additions & 1 deletion tests/topotests/pim_autorp/r1/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@
hostname r1
password zebra
log file /tmp/r1-frr.log
!
debug pim autorp
!
interface r1-eth0
ip address 10.10.76.1/24
ip address 10.0.0.1/24
ip igmp
ip pim
!
interface r1-eth1
ip address 10.0.1.1/24
ip igmp
ip pim
!
ip forwarding
!
ip route 10.0.2.0/24 10.0.0.2 50
ip route 10.0.3.0/24 10.0.0.2 50
!
router pim
autorp discovery
rp 10.0.3.4 224.0.1.0/24
!
12 changes: 11 additions & 1 deletion tests/topotests/pim_autorp/r2/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@
hostname r2
password zebra
log file /tmp/r2-frr.log
!
debug pim autorp
!
interface r2-eth0
ip address 10.10.76.2/24
ip address 10.0.0.2/24
ip igmp
ip pim
!
interface r2-eth1
ip address 10.0.2.2/24
ip igmp
ip pim
!
ip forwarding
!
ip route 10.0.1.0/24 10.0.0.1 50
ip route 10.0.3.0/24 10.0.2.4 50
!
router pim
autorp discovery
rp 10.0.3.4 224.0.1.0/24
!
26 changes: 26 additions & 0 deletions tests/topotests/pim_autorp/r3/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
!
hostname r3
password zebra
log file /tmp/r3-frr.log
!
debug pim autorp
!
interface r3-eth0
ip address 10.0.1.3/24
ip igmp
ip pim
!
interface r3-eth1
ip address 10.0.3.3/24
ip igmp
ip pim
!
ip forwarding
!
ip route 10.0.0.0/24 10.0.1.1 50
ip route 10.0.2.0/24 10.0.3.4 50
!
router pim
autorp discovery
rp 10.0.3.4 224.0.1.0/24
!
26 changes: 26 additions & 0 deletions tests/topotests/pim_autorp/r4/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
!
hostname r4
password zebra
log file /tmp/r4-frr.log
!
debug pim autorp
!
interface r4-eth0
ip address 10.0.2.4/24
ip igmp
ip pim
!
interface r4-eth1
ip address 10.0.3.4/24
ip igmp
ip pim
!
ip forwarding
!
ip route 10.0.0.0/24 10.0.2.2 50
ip route 10.0.1.0/24 10.0.2.2 50
!
router pim
autorp discovery
rp 10.0.3.4 224.0.1.0/24
!
Loading

0 comments on commit 027f48f

Please sign in to comment.