tests: Add a test for the ip pim register-accept-list PLIST command

Add a test to the pim-basic to ensure that the prefix-list works as
expected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2020-02-20 15:38:33 -05:00
parent f4e74bd038
commit c64d8d8577
6 changed files with 31 additions and 1 deletions

View File

@ -7,6 +7,10 @@ interface r1-eth0
interface r1-eth1
ip pim
!
interface r1-eth2
ip igmp
ip pim
!
interface lo
ip pim
!

View File

@ -6,6 +6,9 @@ interface r1-eth0
interface r1-eth1
ip address 10.0.30.1/24
!
interface r1-eth2
ip address 10.0.40.1/24
!
interface lo
ip address 10.254.0.1/32
!

View File

@ -0,0 +1 @@
hostname r3

View File

@ -0,0 +1,8 @@
hostname r3
!
interface r3-eth0
ip address 10.0.40.4/24
!
interface lo
ip address 10.254.0.4/32
!

View File

@ -7,3 +7,6 @@ interface lo
ip pim
!
ip pim rp 10.254.0.3
ip pim register-accept-list ACCEPT
ip prefix-list ACCEPT seq 5 permit 10.0.20.0/24 le 32

View File

@ -46,14 +46,18 @@ class PIMTopo(Topo):
"Build function"
tgen = get_topogen(self)
for routern in range(1, 3):
for routern in range(1, 4):
tgen.add_router('r{}'.format(routern))
tgen.add_router('rp')
# rp ------ r1 -------- r2
# \
# --------- r3
# r1 -> .1
# r2 -> .2
# rp -> .3
# r3 -> .4
# loopback network is 10.254.0.X/32
#
# r1 <- sw1 -> r2
@ -70,6 +74,10 @@ class PIMTopo(Topo):
sw.add_link(tgen.gears['r1'])
sw.add_link(tgen.gears['rp'])
# 10.0.40.0/24
sw = tgen.add_switch('sw3')
sw.add_link(tgen.gears['r1'])
sw.add_link(tgen.gears['r3'])
def setup_module(mod):
"Sets up the pytest environment"
@ -130,12 +138,15 @@ def test_pim_send_mcast_stream():
pytest.skip(tgen.errors)
rp = tgen.gears['rp']
r3 = tgen.gears['r3']
r2 = tgen.gears['r2']
r1 = tgen.gears['r1']
# Let's establish a S,G stream from r2 -> r1
CWD = os.path.dirname(os.path.realpath(__file__))
r2.run("{}/mcast-tx.py --ttl 5 --count 5 --interval 10 229.1.1.1 r2-eth0 > /tmp/bar".format(CWD))
# And from r3 -> r1
r3.run("{}/mcast-tx.py --ttl 5 --count 5 --interval 10 229.1.1.1 r3-eth0 > /tmp/bar".format(CWD))
# Let's see that it shows up and we have established some basic state
out = r1.vtysh_cmd("show ip pim upstream json", isjson=True)