add test to check if up and delay is ok

test example:

sudo ./mpPerf.py -f conf/topo/1_para_3

Signed-off-by: Benjamin Hesmans <benjamin.hesmans@uclouvain.be>
This commit is contained in:
Benjamin Hesmans 2015-01-07 16:00:15 +01:00
parent b08d952454
commit 9f2ce22e96
4 changed files with 20 additions and 2 deletions

View File

@ -1,4 +1,7 @@
class MpConfig:
PING_OUTPUT = "ping.log"
def __init__(self, topo, param):
self.topo = topo
self.param = param
@ -35,4 +38,9 @@ class MpConfig:
s = "ip route add default via " + via
print(s)
return s
def pingCommand(self, fromIP, toIP, n=5):
s = "ping -c " + str(n) + " -I " + fromIP + " " + toIP + \
" >> " + MpConfig.PING_OUTPUT
print(s)
return s

View File

@ -97,3 +97,12 @@ class MpMultiInterfaceConfig(MpConfig):
def getServerInterface(self):
return MpTopo.serverName + "-eth0"
def pingAllFromClient(self, n = 5):
i = 0
self.topo.commandTo(self.client, "rm " + MpConfig.PING_OUTPUT)
for l in self.topo.switch:
cmd = self.pingCommand(self.getClientIP(i),
self.getServerIP(), n)
self.topo.commandTo(self.client, cmd)
i = i + 1

View File

@ -34,7 +34,7 @@ class MpParamTopo:
def loadLinkCharacteristics(self):
i = 0
for k in self.paramDic:
for k in sorted(self.paramDic):
if k.startswith("path"):
tab = self.paramDic[k].split(",")
if len(tab) == 3:

View File

@ -42,6 +42,7 @@ if __name__ == '__main__':
mpConfig = MpMultiInterfaceConfig(mpTopo, param)
mpTopo.startNetwork()
mpConfig.configureNetwork()
mpConfig.pingAllFromClient()
mpTopo.getCLI()
mpTopo.stopNetwork()
else: