from lutil import luCommand
-luCommand('ce1','ping 192.168.1.1 -c 1',' 0. packet loss','pass','CE->PE ping')
-luCommand('ce2','ping 192.168.1.1 -c 1',' 0. packet loss','pass','CE->PE ping')
-luCommand('ce3','ping 192.168.1.1 -c 1',' 0. packet loss','pass','CE->PE ping')
-luCommand('ce4','ping 192.168.2.1 -c 1',' 0. packet loss','pass','CE->PE ping')
luCommand('ce1','vtysh -c "show bgp summary"',' 00:0','wait','Adjacencies up',180)
luCommand('ce2','vtysh -c "show bgp summary"',' 00:0','wait','Adjacencies up')
luCommand('ce3','vtysh -c "show bgp summary"',' 00:0','wait','Adjacencies up')
--- /dev/null
+from lutil import luCommand
+rtrs = ['r1', 'r3', 'r4']
+for rtr in rtrs:
+ luCommand(rtr, 'ip link show type vrf {}-cust1'.format(rtr),'cust1: .*UP,LOWER_UP','pass','VRF cust1 up')
+ luCommand(rtr, 'ip add show vrf {}-cust1'.format(rtr),'r..eth4: .*UP,LOWER_UP.* 192.168','pass','VRF cust1 IP config')
+ luCommand(rtr, 'ip route show vrf {}-cust1'.format(rtr),'192.168...0/24 dev r.-eth','pass','VRF cust1 interface route')
+luCommand('r4', 'ip link show type vrf r4-cust2','cust2: .*UP,LOWER_UP','pass','VRF cust2 up')
+luCommand('r4', 'ip add show vrf r4-cust2','r..eth5.*UP,LOWER_UP.* 192.168','pass','VRF cust1 IP config')
+luCommand(rtr, 'ip route show vrf r4-cust2'.format(rtr),'192.168...0/24 dev r.-eth','pass','VRF cust2 interface route')
+rtrs = ['ce1', 'ce2', 'ce3']
+for rtr in rtrs:
+ luCommand(rtr, 'ip route show','192.168...0/24 dev ce.-eth0','pass','CE interface route')
+ luCommand(rtr,'ping 192.168.1.1 -c 1',' 0. packet loss','wait','CE->PE ping')
+luCommand('ce4','ping 192.168.2.1 -c 1',' 0. packet loss','wait','CE4->PE4 ping')
from lib.ltemplate import *
+def test_check_linux_vrf():
+ CliOnFail = None
+ # For debugging, uncomment the next line
+ #CliOnFail = 'tgen.mininet_cli'
+ CheckFunc = 'customize.versionCheck(\'3.1\')'
+ #uncomment next line to start cli *before* script is run
+ #CheckFunc = 'customize.versionCheck(\'3.1\', cli=True)'
+ ltemplateTest('scripts/check_linux_vrf.py', False, CliOnFail, CheckFunc)
+
def test_adjacencies():
CliOnFail = None
# For debugging, uncomment the next line