wip
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:
parent
b08d952454
commit
9f2ce22e96
@ -1,4 +1,7 @@
|
||||
class MpConfig:
|
||||
|
||||
PING_OUTPUT = "ping.log"
|
||||
|
||||
def __init__(self, topo, param):
|
||||
self.topo = topo
|
||||
self.param = param
|
||||
@ -36,3 +39,8 @@ class MpConfig:
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -42,6 +42,7 @@ if __name__ == '__main__':
|
||||
mpConfig = MpMultiInterfaceConfig(mpTopo, param)
|
||||
mpTopo.startNetwork()
|
||||
mpConfig.configureNetwork()
|
||||
mpConfig.pingAllFromClient()
|
||||
mpTopo.getCLI()
|
||||
mpTopo.stopNetwork()
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user