Commit b264e03c authored by Wei-Chun Chao's avatar Wei-Chun Chao

add connectivity validation in distributed bridge examples

Signed-off-by: default avatarWei-Chun Chao <weichunc@plumgrid.com>
parent 949e9eb1
...@@ -6,7 +6,7 @@ from sys import argv ...@@ -6,7 +6,7 @@ from sys import argv
from builtins import input from builtins import input
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
from simulation import Simulation from simulation import Simulation
from subprocess import PIPE from subprocess import PIPE, call
if len(argv) > 1 and argv[1] == "mesh": if len(argv) > 1 and argv[1] == "mesh":
multicast = 0 multicast = 0
...@@ -40,6 +40,12 @@ class TunnelSimulation(Simulation): ...@@ -40,6 +40,12 @@ class TunnelSimulation(Simulation):
with self.ipdb.create(ifname="br-fabric", kind="bridge") as br: with self.ipdb.create(ifname="br-fabric", kind="bridge") as br:
for host in host_info: br.add_port(host[1]) for host in host_info: br.add_port(host[1])
br.up() br.up()
print("Validating connectivity")
for i in range(1, num_hosts):
for j in range(0, 2):
print("VNI%d between host0 and host%d" % (10000 + j, i))
call(["ip", "netns", "exec", "host%d" % i,
"ping", "99.1.%d.1" % j, "-c", "3", "-i", "0.2", "-q"])
try: try:
sim = TunnelSimulation(ipdb) sim = TunnelSimulation(ipdb)
......
...@@ -76,6 +76,5 @@ try: ...@@ -76,6 +76,5 @@ try:
run() run()
ipdb.release() ipdb.release()
input("") input("")
print("---")
finally: finally:
for v in ifc_gc: call(["ip", "link", "del", v]) for v in ifc_gc: call(["ip", "link", "del", v])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment