Skip to content

Commit

Permalink
Merge pull request iovisor#121 from iovisor/weichunc_dev
Browse files Browse the repository at this point in the history
add connectivity validation in distributed bridge examples
  • Loading branch information
drzaeus77 committed Aug 10, 2015
2 parents 4aca477 + b264e03 commit 0066ca5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion examples/distributed_bridge/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from builtins import input
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
from simulation import Simulation
from subprocess import PIPE
from subprocess import PIPE, call

if len(argv) > 1 and argv[1] == "mesh":
multicast = 0
Expand Down Expand Up @@ -40,6 +40,12 @@ def start(self):
with self.ipdb.create(ifname="br-fabric", kind="bridge") as br:
for host in host_info: br.add_port(host[1])
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:
sim = TunnelSimulation(ipdb)
Expand Down
1 change: 0 additions & 1 deletion examples/distributed_bridge/tunnel_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,5 @@ def run():
run()
ipdb.release()
input("")
print("---")
finally:
for v in ifc_gc: call(["ip", "link", "del", v])

0 comments on commit 0066ca5

Please sign in to comment.