Skip to content

New netlab testcase for RIP with VRF

David Petera requested to merge rip-vrf-testcase into master

I basically wanted to copy the test case cf-ospf-vrf and change it for RIP.

For that I needed to extend the modules in /tests folder.

  • I added new script get_stdout_rip_neighbors to be able to test RIP neighbors.
  • I extended (and refactored a bit) the kernel.py module in order to support test_rip_neighbors test function.
  • I fixed a small bug in regex in the strip_dtime function in the strip_output script and extended the regex to work with single digit numbers in front of the decimal point.

Then I was able to replace the OSPF protocol with RIP and add a basic direct protocol in the configs of nodes. Lastly change the tests and README.md accordingly (also fixed some inconsistencies in the cf-ospf-vrf README.md file).


One thing I'm not sure of is the VRF initialization in the netlab config file. It seems to me that even in the cf-ospf-vrf testcase there is initialization only for vrf1 (basically default vrf) and vrf3 (by the vrf mX vrf3 300 line) but no vrf2.

...
netlab_init

vrf m1 vrf1 100
vrf m1 vrf2 200
vrf m1 vrf3 300

vrf m8 vrf3 300
vrf m9 vrf3 300
vrf m10 vrf3 300

if_dummy m1 vf0 10.1.1 2001:db8:1:1
...

The nodes in vrf3 have the following interface in their netns listed by ip a but nodes in vrf2 have no similar interface for their VRF.

...
2: vrf3: <NOARP,MASTER,UP,LOWER_UP> mtu 65575 qdisc noqueue state UP group default qlen 1000
    link/ether 92:20:78:53:56:42 brd ff:ff:ff:ff:ff:ff
...

However when I tested it seems to work as expected and routes from vrf1 does not "spill" to vrf2.

So I guess it is okay, but I would like to understand it better. What is the reason it is used only for vrf3?

Merge request reports

Loading