From: Wei-Chun Chao Date: Mon, 10 Aug 2015 18:56:14 +0000 (-0700) Subject: add connectivity validation in distributed bridge examples X-Git-Tag: v0.1.4~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b264e03c66d9f039a9b5a0ef48f7e7c30b5314af;p=platform%2Fupstream%2Fbcc.git add connectivity validation in distributed bridge examples Signed-off-by: Wei-Chun Chao --- diff --git a/examples/distributed_bridge/main.py b/examples/distributed_bridge/main.py index 0421bed..6f2577a 100755 --- a/examples/distributed_bridge/main.py +++ b/examples/distributed_bridge/main.py @@ -6,7 +6,7 @@ from sys import argv 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 @@ -40,6 +40,12 @@ class TunnelSimulation(Simulation): 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) diff --git a/examples/distributed_bridge/tunnel_mesh.py b/examples/distributed_bridge/tunnel_mesh.py index 9c17e34..9a6efa9 100644 --- a/examples/distributed_bridge/tunnel_mesh.py +++ b/examples/distributed_bridge/tunnel_mesh.py @@ -76,6 +76,5 @@ try: run() ipdb.release() input("") - print("---") finally: for v in ifc_gc: call(["ip", "link", "del", v])