mininet-sample/mpPerf.py

39 lines
794 B
Python
Raw Normal View History

#!/usr/bin/python
import sys, getopt
from mpXpRunner import MpXpRunner
2020-06-24 08:36:26 +00:00
from core.topo import Topo
topoParamFile = None
xpParamFile = None
topoBuilder = "mininet"
def printHelp():
print("Help Menu")
def parseArgs(argv):
global topoParamFile
global xpParamFile
try:
opts, args = getopt.getopt(argv, "ht:x:", ["topoParam=","xp="])
except getopt.GetoptError:
printHelp()
sys.exit(1)
for opt, arg in opts:
if opt == "-h":
printHelp()
sys.exit(1)
elif opt in ("-x","--xp"):
xpParamFile = arg
elif opt in ("-t","--topoParam"):
print("hey")
topoParamFile = arg
if topoParamFile is None:
print("Missing the topo...")
printHelp()
sys.exit(1)
if __name__ == '__main__':
parseArgs(sys.argv[1:])
2020-06-24 08:36:26 +00:00
MpXpRunner(Topo.mininetBuilder, topoParamFile, xpParamFile)