Merge "Created a README file for the SCPFportLat test"
diff --git a/.gitignore b/.gitignore
index ae5f64f..5b80f94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-*.swp
-*.swo
+.*.sw?
TestON/logs/*
*.pyc
diff --git a/TestON/bin/cli.py b/TestON/bin/cli.py
index f6417a6..b515486 100755
--- a/TestON/bin/cli.py
+++ b/TestON/bin/cli.py
@@ -17,7 +17,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
@@ -102,7 +102,7 @@
test.start()
else :
print main.TEST+ " test execution paused, please resume that before executing to another test"
-
+
def do_resume(self, line):
'''
resume command will continue the execution of paused test.
@@ -115,20 +115,20 @@
testthread.play()
else :
print "There is no test to resume"
-
+
def do_nextstep(self,line):
'''
- nextstep will execute the next-step of the paused test and
+ nextstep will execute the next-step of the paused test and
it will pause the test after finishing of step.
-
+
teston> nextstep
Will pause the test's execution, after completion of this step.....
-
+
teston> [2013-01-07 21:24:26.286601] [PoxTest] [STEP] 1.8: Checking the host reachability using pingHost
2013-01-07 21:24:26,455 - PoxTest - INFO - Expected Prompt Found
.....
teston>
-
+
'''
if testthread:
main.log.info("Executing the nextstep, Will pause test execution, after completion of the step")
@@ -137,17 +137,17 @@
testthread.pause()
else:
print "There is no paused test "
-
+
def do_dumpvar(self,line):
'''
dumpvar will print all the test data in raw format.
- usgae :
+ usgae :
teston>dumpvar main
Here 'main' will be the test object.
-
- teston>dumpvar params
+
+ teston>dumpvar params
here 'params' will be the parameters specified in the params file.
-
+
teston>dumpvar topology
here 'topology' will be topology specification of the test specified in topo file.
'''
@@ -161,25 +161,25 @@
print e
else :
print "There is no paused test "
-
+
def do_currentcase(self,line):
'''
currentcase will return the current case in the test execution.
-
+
teston>currentcase
Currently executing test case is: 2
-
+
'''
if testthread:
print "Currently executing test case is: "+str(main.CurrentTestCaseNumber)
else :
print "There is no paused test "
-
-
+
+
def do_currentstep(self,line):
'''
currentstep will return the current step in the test execution.
-
+
teston>currentstep
Currently executing test step is: 2.3
'''
@@ -187,25 +187,25 @@
print "Currently executing test step is: "+str(main.CurrentTestCaseNumber)+'.'+str(main.stepCount)
else :
print "There is no paused test "
-
-
+
+
def do_stop(self,line):
'''
Will stop the paused test, if any !
'''
if testthread:
testthread.stop()
-
+
return 'exited by user command'
-
+
def do_gettest(self,line):
'''
gettest will return the test name which is under execution or recently executed.
-
+
Test under execution:
- teston>gettest
+ teston>gettest
Currently executing Test is: PoxTest
-
+
Test recently executed:
Recently executed test is: MininetTest
'''
@@ -214,10 +214,10 @@
print "Currently executing Test is: "+main.TEST
else :
print "Recently executed test is: "+main.TEST
-
+
except NameError:
print "There is no previously executed Test"
-
+
def do_showlog(self,line):
'''
showlog will show the test's Log
@@ -231,22 +231,22 @@
try :
if testthread :
print "Currently executing Test's log is: "+main.LogFileName
-
+
else :
print "Last executed test's log is : "+main.LogFileName
-
+
logFile = main.LogFileName
logFileHandler = open(logFile, 'r')
for msg in logFileHandler.readlines() :
print msg,
-
+
logFileHandler.close()
-
+
except NameError:
print "There is no previously executed Test"
-
-
-
+
+
+
def parseArgs(self,args,options):
'''
This will parse the command line arguments.
@@ -263,9 +263,9 @@
options['testname'] = option
except IndexError,e:
print e
-
+
return options
-
+
def initOptions(self,options):
'''
This will initialize the commandline options.
@@ -276,8 +276,8 @@
options['testdir'] = None
options['testcases'] = None
options['onoscell'] = None
- return options
-
+ return options
+
def testcasesInRange(self,index,option,args,options):
'''
This method will handle testcases list,specified in range [1-10].
@@ -293,16 +293,16 @@
i = start_case
while i <= end_case:
testcases.append(i)
- i= i+1
+ i= i+1
else :
print "Please specify testcases properly like 1-5"
else :
options[option] = args[index]
return options
options[option] = str(testcases)
-
+
return options
-
+
def cmdloop(self, intro=introduction):
print introduction
while True:
@@ -330,23 +330,23 @@
def do_py( self, line ):
'''
Evaluate a Python expression.
-
+
py main.log.info("Sample Log Information")
2013-01-07 12:07:26,804 - PoxTest - INFO - Sample Log Information
-
+
'''
try:
exec( line )
except Exception, e:
output( str( e ) + '\n' )
-
+
def do_interpret(self,line):
'''
interpret will translate the single line openspeak statement to equivalent python script.
-
+
teston> interpret ASSERT result EQUALS main.TRUE ONPASS "Ping executed successfully" ONFAIL "Ping failed"
utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Ping executed successfully",onfail="Ping failed")
-
+
'''
from core import openspeak
ospk = openspeak.OpenSpeak()
@@ -355,7 +355,7 @@
print translated_code
except AttributeError, e:
print 'Dynamic params are not allowed in single statement translations'
-
+
def do_do (self,line):
'''
Do will translate and execute the openspeak statement for the paused test.
@@ -371,21 +371,21 @@
print 'Dynamic params are not allowed in single statement translations'
else :
print "Do will translate and execute the openspeak statement for the paused test.\nPlease use interpret to translate the OpenSpeak statement."
-
+
def do_compile(self,line):
'''
compile will translate the openspeak (.ospk) file into TestON test script (python).
- It will receive the openspeak file path as input and will generate
- equivalent test-script file in the same directory.
-
+ It will receive the openspeak file path as input and will generate
+ equivalent test-script file in the same directory.
+
usage:
-----
teston>compile /home/openflow/TestON/PoxTest.ospk
-
+
Auto-generated test-script file is /home/openflow/TestON/PoxTest.py
'''
from core import openspeak
- openspeak = openspeak.OpenSpeak()
+ openspeak = openspeak.OpenSpeak()
openspeakfile = line
if os.path.exists(openspeakfile) :
openspeak.compiler(openspeakfile=openspeakfile,writetofile=1)
@@ -397,7 +397,7 @@
"Exit"
if testthread:
testthread.stop()
-
+
sys.exit()
return 'exited by user command'
@@ -419,16 +419,16 @@
'''
Read shell commands from an input file and execute them sequentially.
cmdsource.txt :
-
+
"pwd
ls "
-
+
teston>source /home/openflow/cmdsource.txt
/home/openflow/TestON/bin/
cli.py __init__.py
-
+
'''
-
+
args = line.split()
if len(args) != 1:
error( 'usage: source <file>\n' )
@@ -443,15 +443,15 @@
break
except IOError:
error( 'error reading file %s\n' % args[ 0 ] )
-
+
def do_updatedriver(self,line):
'''
updatedriver will update the given driver name which exists into mentioned config file.
It will receive two optional arguments :
-
- 1. Config File Path
+
+ 1. Config File Path
2. Drivers List to be updated.
-
+
Default : config file = "~/TestON/config/updatedriver" ,
Driver List = all drivers specified in config file .
'''
@@ -464,28 +464,28 @@
index = index + 1
config = args[index]
elif option == 'drivers' :
- index = index + 1
+ index = index + 1
drivers = args[index]
except IndexError:
- pass
+ pass
import updatedriver
converter = updatedriver.UpdateDriver()
-
+
if config == '':
path = re.sub("(bin)$", "", os.getcwd())
config = path + "/config/updatedriver.cfg"
configDict = converter.configparser(config)
-
+
else :
converter.configparser(config)
configDict = converter.configparser(config)
-
-
+
+
converter.writeDriver(drivers)
-
-
-
-
+
+
+
+
def do_time( self, line ):
"Measure time taken for any command in TestON."
start = time.time()
@@ -535,7 +535,7 @@
result = self.test_on.cleanup()
self.is_stop = True
- __builtin__.testthread = False
+ __builtin__.testthread = False
def pause(self):
'''
@@ -551,17 +551,17 @@
'''
self._stopevent.clear()
cli.pause = False
-
+
def stop(self):
'''
Will stop the test execution.
'''
-
+
print "Stopping the test"
self.is_stop = True
cli.stop = True
__builtin__.testthread = False
-
+
def output(msg):
'''
Simply, print the message in console
diff --git a/TestON/bin/generatedriver.py b/TestON/bin/generatedriver.py
index 80dbd08..0bd3a0a 100644
--- a/TestON/bin/generatedriver.py
+++ b/TestON/bin/generatedriver.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
'''
Created on 11-Oct-2012
-
+
@authors: Anil Kumar (anilkumar.s@paxterrasolutions.com),
TestON is free software: you can redistribute it and/or modify
@@ -15,10 +15,10 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
-
+
'''
import pexpect
import struct, fcntl, os, sys, signal
@@ -27,7 +27,7 @@
class GenerateDriver():
'''
- This will
+ This will
'''
def __init__(self):
self.default = ''
@@ -47,28 +47,28 @@
sys.exit()
print self.config_details
self.device_name = ''
-
+
def connect(self,**connectargs):
'''
Connection will establish to the remote host using ssh.
It will take user_name ,ip_address and password as arguments<br>
- and will return the handle.
+ and will return the handle.
'''
for key in connectargs:
vars(self)[key] = connectargs[key]
-
+
ssh_newkey = 'Are you sure you want to continue connecting'
refused = "ssh: connect to host "+self.ip_address+" port 22: Connection refused"
if self.port:
self.handle =pexpect.spawn('ssh -p '+self.port+' '+self.user_name+'@'+self.ip_address,maxread=50000)
else :
self.handle =pexpect.spawn('ssh '+self.user_name+'@'+self.ip_address,maxread=50000)
-
+
self.logfile_handler = open(os.getcwd()+"/GenerateDriver.log","w+")
self.handle.logfile = self.logfile_handler
i=self.handle.expect([ssh_newkey,'password:',pexpect.EOF,pexpect.TIMEOUT,refused],10)
-
- if i==0:
+
+ if i==0:
self.handle.sendline('yes')
i=self.handle.expect([ssh_newkey,'password:',pexpect.EOF,pexpect.TIMEOUT])
return self.handle
@@ -80,16 +80,16 @@
print "ssh: connect to host "+self.ip_address+": Error"
return False
elif i==3: #timeout
-
+
print "ssh: connect to host "+self.ip_address+": Connection timed out"
return False
elif i==4:
print "ssh: connect to host "+self.ip_address+": Connection refused"
return False
- self.handle.sendline("\r")
+ self.handle.sendline("\r")
return self.handle
-
+
def execute(self, **execparams):
'''
This method will execute the command and will check for the expected prompt.
@@ -98,10 +98,10 @@
defaultPrompt = '.*[\$>\#]'
for key in execparams:
vars(self)[key] = execparams[key]
-
+
self.handle.sendline(self.cmd)
- timeoutVar = self.timeout if self.timeout else 10
-
+ timeoutVar = self.timeout if self.timeout else 10
+
index = self.handle.expect([self.prompt, "byte\s\d+", 'Command not found.', pexpect.TIMEOUT,"\n:",pexpect.EOF], timeout = timeoutVar)
if index == 0:
self.LASTRSP = self.LASTRSP + self.handle.before
@@ -118,10 +118,10 @@
self.LASTRSP = self.LASTRSP + self.handle.before
#print self.LASTRSP
elif index ==2:
- print "Command not found"
+ print "Command not found"
self.LASTRSP = self.LASTRSP + self.handle.before
elif index ==3:
- print "Expected Prompt not found , Time Out!!"
+ print "Expected Prompt not found , Time Out!!"
return False
elif index == 4:
@@ -134,21 +134,21 @@
indexMore = self.handle.expect(["\n:", self.prompt,".*",pexpect.EOF,pexpect.TIMEOUT], timeout = timeoutVar)
self.LASTRSP = self.LASTRSP + self.handle.before
-
+
return self.LASTRSP
-
+
def configure(self):
'''
Will start the Configure mode of the device.
'''
config_result = self.execute(cmd="configure",prompt='\#',timeout=10)
return config_result
-
+
def get_command_help(self,command):
'''
Will get the help of the Command
'''
-
+
self.handle.setecho(False)
help_keyword = self.config_details['device'][self.device_name]['help_keyword']
interrupt_key = self.config_details['device'][self.device_name]['interrupt_key']
@@ -157,12 +157,12 @@
self.handle.sendcontrol(interrupt_key)
#print command_details
return command_details
-
+
def get_command_details(self,command):
'''
Will Update the command_dictionary with the available commands details
'''
-
+
temp_dictionary = {}
command_resulut = self.get_command_help(command)
try :
@@ -183,15 +183,15 @@
match_command = match.group(0)
print match_command
options_list.append(match_command)
-
- temp_dictionary[command] = options_list
+
+ temp_dictionary[command] = options_list
self.command_dictionary[command] = options_list
self.print_details(self.command_dictionary)
print "temp dir: --------"
print temp_dictionary
print "-------------"
return temp_dictionary
-
+
def print_details(self,command_dictionary):
'''
Will print the details in Tree Format
@@ -207,10 +207,10 @@
if len(self.commnads_ordered_list[i]) > len(self.commnads_ordered_list[i+1]):
sorted = False
self.commnads_ordered_list[i], self.commnads_ordered_list[i+1] = self.commnads_ordered_list[i+1], self.commnads_ordered_list[i]
-
+
for key in self.commnads_ordered_list:
- print key +"\t "+str(command_dictionary[key])
- print "\n\n"
+ print key +"\t "+str(command_dictionary[key])
+ print "\n\n"
def get_details_recursive(self,main_comand):
@@ -222,7 +222,7 @@
if main_result_dcitionary :
for key in main_result_dcitionary.keys():
for index, each_option in enumerate(main_result_dcitionary[key]) :
-
+
if re.search(self.config_details['device'][self.device_name]['end_pattern']+"|^\.|^\d",str(main_result_dcitionary[key][index])):
print "Reached the last argument for this "+main_comand+" "+str(each_option)+"\n"
main_result_dcitionary[key].remove(each_option)
@@ -232,14 +232,14 @@
main_result_dcitionary[key].remove(each_option)
break
result_dcitionary = self.get_details_recursive(main_comand+" "+str(each_option))
-
+
return
def create_driver(self):
name = self.device_name
driver_file_data = 'class '+name +":\n"
driver_file_data = driver_file_data + " def __init__( self ):\n"
driver_file_data = driver_file_data + " self.prompt = '(.*)'\n self.timeout = 60 \n\n"
-
+
for index,command in enumerate(self.commnads_ordered_list) :
api_data = ' def '
command_as_api = re.sub(" ","_" , command, 0)
@@ -259,11 +259,11 @@
command_temp = command_temp + c
if command_temp[len(command_temp)-1] == "_":
command_temp = command_temp[0:len(command_temp)-1]
- command_as_api = command_temp
+ command_as_api = command_temp
#options = ''
#for option in self.command_dictionary[command]:
#options = options+',' + option
-
+
#options = re.sub("^\s*,|,$","" , options, 0)
api_data = api_data + command_as_api+"(self, *options, **def_args ):\n"
api_data = api_data + " '''Possible Options :"+str(self.command_dictionary[command])+"'''\n"
@@ -272,19 +272,19 @@
api_data = api_data + " arguments = arguments + option +' ' \n"
api_data = api_data + " prompt = def_args.setdefault('prompt',self.prompt)\n"
api_data = api_data + " timeout = def_args.setdefault('timeout',self.timeout)\n"
-
+
api_data = api_data + " self.execute( cmd= \""+ command + " \"+ arguments, prompt = prompt, timeout = timeout ) \n"
api_data = api_data + " return main.TRUE\n"
-
+
driver_file_data = driver_file_data + api_data +"\n"
driver_file = open(os.getcwd()+"/"+name.lower()+".py", 'w')
driver_file.write(driver_file_data)
print driver_file_data
-
+
def disconnect(self):
result = True
return result
-
+
import pexpect
if __name__ == "__main__":
@@ -305,11 +305,11 @@
for root_command in commandlist :
generate.get_details_recursive(root_command)
-
+
generate.create_driver()
generate.disconnect()
#generate.get_command_details(main_command)
else :
print "Connection Failed to the host"
-
-
+
+
diff --git a/TestON/bin/nec.py b/TestON/bin/nec.py
index f5e652a..ac95238 100644
--- a/TestON/bin/nec.py
+++ b/TestON/bin/nec.py
@@ -1,545 +1,545 @@
class NEC:
def __init__( self ):
self.prompt = '(.*)'
- self.timeout = 60
+ self.timeout = 60
def show(self, *options, **def_args ):
'''Possible Options :[' access-filter ', ' accounting ', ' acknowledgments ', ' auto-config ', ' axrp ', ' cfm ', ' channel-group ', ' clock ', ' config-lock-status ', ' cpu ', ' dhcp ', ' dot1x ', ' dumpfile ', ' efmoam ', ' environment ', ' file ', ' flash ', ' gsrp ', ' history ', ' igmp-snooping ', ' interfaces ', ' ip ', ' ip-dual ', ' ipv6-dhcp ', ' license ', ' lldp ', ' logging ', ' loop-detection ', ' mac-address-table ', ' mc ', ' memory ', ' mld-snooping ', ' netconf ', ' netstat ', ' ntp ', ' oadp ', ' openflow ', ' port ', ' power ', ' processes ', ' qos ', ' qos-flow ', ' sessions ', ' sflow ', ' spanning-tree ', ' ssh ', ' system ', ' tcpdump ', ' tech-support ', ' track ', ' version ', ' vlan ', ' vrrpstatus ', ' whoami ']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_ip(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show ip "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show ip "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_mc(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show mc "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show mc "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_cfm(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show cfm "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show cfm "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_ntp(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show ntp "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show ntp "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_ssh(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show ssh "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show ssh "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_qos(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show qos "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show qos "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_cpu(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show cpu "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show cpu "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_vlan(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show vlan "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show vlan "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_lldp(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show lldp "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show lldp "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_dhcp(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show dhcp "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show dhcp "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_axrp(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show axrp "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show axrp "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_oadp(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show oadp "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show oadp "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_gsrp(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show gsrp "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show gsrp "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_port(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show port "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show port "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_file(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show file "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show file "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_power(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show power "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show power "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_clock(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show clock "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show clock "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_dot1x(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show dot1x "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show dot1x "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_sflow(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show sflow "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show sflow "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_track(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show track "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show track "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_flash(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show flash "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show flash "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_system(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show system "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show system "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_whoami(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show whoami "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show whoami "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_efmoam(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show efmoam "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show efmoam "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_memory(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show memory "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show memory "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_tcpdump(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show tcpdump "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show tcpdump "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_history(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show history "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show history "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_logging(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show logging "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show logging "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_license(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show license "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show license "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_netstat(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show netstat "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show netstat "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_version(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show version "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show version "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_netconf(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show netconf "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show netconf "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_ipdual(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show ip-dual "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show ip-dual "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_sessions(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show sessions "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show sessions "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_qosflow(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show qos-flow "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show qos-flow "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_openflow(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show openflow "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show openflow "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_dumpfile(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show dumpfile "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show dumpfile "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_ipv6dhcp(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show ipv6-dhcp "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show ipv6-dhcp "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_processes(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show processes "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show processes "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_vrrpstatus(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show vrrpstatus "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show vrrpstatus "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_environment(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show environment "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show environment "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_autoconfig(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show auto-config "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show auto-config "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_techsupport(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show tech-support "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show tech-support "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_mldsnooping(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show mld-snooping "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show mld-snooping "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_igmpsnooping(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show igmp-snooping "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show igmp-snooping "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_channelgroup(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show channel-group "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show channel-group "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_spanningtree(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show spanning-tree "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show spanning-tree "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_loopdetection(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show loop-detection "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show loop-detection "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_acknowledgments(self, *options, **def_args ):
'''Possible Options :[' interface ']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show acknowledgments "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show acknowledgments "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_macaddresstable(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show mac-address-table "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show mac-address-table "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_configlockstatus(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show config-lock-status "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show config-lock-status "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_acknowledgments_interface(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show acknowledgments interface "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show acknowledgments interface "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
diff --git a/TestON/bin/pronto.py b/TestON/bin/pronto.py
index b6dcffd..0d1b834 100644
--- a/TestON/bin/pronto.py
+++ b/TestON/bin/pronto.py
@@ -1,45 +1,45 @@
class Pronto:
def __init__( self ):
self.prompt = '(.*)'
- self.timeout = 60
+ self.timeout = 60
def status(self, *options, **def_args ):
'''Possible Options :['Pronto-CLI']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "status "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "status "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def port_show_*(self, *options, **def_args ):
'''Possible Options :['Pronto-CLI']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "port show * "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "port show * "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def status_ProntoCLI(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "status Pronto-CLI "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "status Pronto-CLI "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def port_show_*_ProntoCLI(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "port show * Pronto-CLI "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "port show * Pronto-CLI "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
diff --git a/TestON/bin/updatedriver.py b/TestON/bin/updatedriver.py
index b023e5d..bd6974d 100644
--- a/TestON/bin/updatedriver.py
+++ b/TestON/bin/updatedriver.py
@@ -17,7 +17,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
@@ -29,18 +29,18 @@
self.configFile = "/home/openflow/TestON/config/ofadriver.cfg"
self.methodDict = {}
self.fileDict = {}
-
+
def getmethods(self,modulePath,Class) :
'''
This will get the list of methods in given module or class.
- It accepts the module path and class name. If there is no
+ It accepts the module path and class name. If there is no
class name then it has be mentioned as None.
'''
methodList = []
moduleList = modulePath.split("/")
newModule = ".".join([moduleList[len(moduleList) - 2],moduleList[len(moduleList) - 1]])
- print "Message : Method list is being obatined , Please wait ..."
+ print "Message : Method list is being obatined , Please wait ..."
try :
if Class :
Module = __import__(moduleList[len(moduleList) - 1], globals(), locals(), [Class], -1)
@@ -55,8 +55,8 @@
self.ClassList = ClassList
except :
print "Error : " +str(sys.exc_info()[1])
-
-
+
+
self.method = methodList
return self.method
@@ -101,7 +101,7 @@
'''
It will parse the config file (ofa.cfg) and return as dictionary
'''
-
+
matchFileName = re.match(r'(.*)\.cfg', fileName, re.M | re.I)
if matchFileName:
self.configFile = fileName
@@ -111,28 +111,28 @@
return self.configDict
except :
print "Error : Config file " + self.configFile + " not defined properly or file path error"
-
-
+
+
def getList(self):
'''
- This method will maintain the hash with module->class->methodList or
+ This method will maintain the hash with module->class->methodList or
module -> methodList .It will return the same Hash.
'''
classList = []
try :
moduleList = self.configDict['config-driver']['importTypes'][self.driver]['modules'].keys()
except KeyError,e:
- print "Error : Module Does not Exists"
+ print "Error : Module Does not Exists"
print e
return False
-
+
for index,value in enumerate(moduleList):
modulePath = self.configDict['config-driver']['importTypes'][self.driver]['modules'][value]['path']
moduleName = self.configDict['config-driver']['importTypes'][self.driver]['modules'][value]['name']
try :
pathList = self.configDict['config-driver']['importTypes'][self.driver]['modules'][value]['set-path'].split(",")
- sys.path.extend(pathList)
+ sys.path.extend(pathList)
except KeyError :
print "Error : No System Path is given "
pass
@@ -159,9 +159,9 @@
def class_ignoreList(self,module) :
'''
- It removes the ignored classes for each module mention in ofadriver.cfg
+ It removes the ignored classes for each module mention in ofadriver.cfg
'''
- class_ignoreList = []
+ class_ignoreList = []
if self.configDict['config-driver']['importTypes'][self.driver]['modules'][module]['classes'] == None :
pass
else :
@@ -176,7 +176,7 @@
if className in self.methodDict[moduleName].keys():
del self.methodDict[moduleName][className]
except AttributeError:
- pass
+ pass
return self.methodDict
def method_ignoreList(self,module,className):
@@ -195,7 +195,7 @@
try :
method_ignoreList = str(self.configDict['config-driver']['importTypes'][self.driver]['modules'][module]['classes'][className]['methods']['ignore-list']).split(",")
except TypeError :
- pass
+ pass
except KeyError :
print "Message : No Ignore-List Exists , proceeding for looking add method"
self.add_method(module,className)
@@ -213,7 +213,7 @@
print "Message : Method " + method + "Does not exist in module " + moduleName + ", Continue to rest execution"
pass
- else :
+ else :
if method in self.methodDict[moduleName][className] :
self.methodDict[moduleName][className].remove(method)
self.add_method(module,className)
@@ -221,7 +221,7 @@
def add_method(self,module,className) :
'''
- This will add the methods(mentioned in ofadriver.cfg file) into method list if it doesnot exists in list.
+ This will add the methods(mentioned in ofadriver.cfg file) into method list if it doesnot exists in list.
'''
method_List = []
try :
@@ -235,13 +235,13 @@
method_List = str(self.configDict['config-driver']['importTypes'][self.driver]['modules'][module]['classes'][className]['methods']['add-list']).split(",")
except TypeError :
pass
-
+
except KeyError :
print "Message : No Add-List Exists , Proceeding with all available methods"
return True
moduleName = self.configDict['config-driver']['importTypes'][self.driver]['modules'][module]['name']
for index, method in enumerate(method_List) :
- if className == None :
+ if className == None :
self.methodDict[moduleName] = []
self.methodDict[moduleName].append(method)
else :
@@ -256,19 +256,19 @@
moduleList = modulePath.split("/")
newModule = ".".join([moduleList[len(moduleList) - 2],moduleList[len(moduleList) - 1]])
if className == None :
- methodArgs = self.getargs(newModule,None,self.methodDict[moduleName])
- self.fileDict[moduleName] = methodArgs
+ methodArgs = self.getargs(newModule,None,self.methodDict[moduleName])
+ self.fileDict[moduleName] = methodArgs
else :
methodArgs = self.getargs(newModule,className,self.methodDict[moduleName][className])
self.fileDict[className] = methodArgs
return self.fileDict
-
+
def appendDriver(self,fileName):
'''
This will append the given driver file with methods along with arguments.
'''
matchFileName = re.match(r'(.*)\.py', fileName, re.M | re.I)
-
+
if matchFileName:
fileHandle = None
try :
@@ -294,7 +294,7 @@
print "Error : Driver file " + fileName + "does not exists"
else :
print "Error : File name " + fileName + "is not python module"
- return False
+ return False
def writeDriver(self, driver) :
@@ -314,15 +314,15 @@
for index, driverName in enumerate(self.configDict['config-driver']['importTypes'].keys()):
self.driver = driverName
result = self.getList()
- if result :
+ if result :
self.getDriverPath()
self.appendDriver(self.driverPath + self.driver + ".py")
self.driverList.append(self.driverPath + self.driver + ".py")
else :
- return False
+ return False
else :
for index, driverName in enumerate(drivers) :
-
+
self.driver = driverName
result = self.getList()
if result :
@@ -330,40 +330,40 @@
self.appendDriver(self.driverPath + self.driver + ".py")
self.driverList.append(self.driverPath + self.driver + ".py")
else :
- return False
-
+ return False
+
print "=" * 90
print " " * 30 + "Output Driver File :"
- print ",\n".join(self.driverList)
+ print ",\n".join(self.driverList)
print "=" * 90
- return True
-
+ return True
-
+
+
def getDriverPath(self):
'''
- It will set the driver path and returns it.If driver path is not specified then it will take
+ It will set the driver path and returns it.If driver path is not specified then it will take
default path (/lib/updatedriver/).
- '''
+ '''
self.driverPath = ''
- try :
+ try :
self.driverPath = self.configDict['config-driver']['importTypes'][self.driver]['driver-path']
-
+
except KeyError :
- path = re.sub("(bin)$", "", os.getcwd())
+ path = re.sub("(bin)$", "", os.getcwd())
self.driverPath = path + "/lib/updatedriver/"
return self.driverPath
def printHeader(self,driver):
content = ''
-
+
print " " * 10 +"=" * 90 + "\n"
- content = content + " " * 30 + "*-- Welcome to Updated Driver --*\n"
+ content = content + " " * 30 + "*-- Welcome to Updated Driver --*\n"
content = content + "\n" + " " * 10 + " " * 10 + "Config File : " + "/home/openflow/TestON/config/ofadriver.py"
- content = content + "\n" + " " * 10 + " " * 10 + "Drivers Name : " + driver
- print content
- print " " * 10 + "=" * 90
+ content = content + "\n" + " " * 10 + " " * 10 + "Drivers Name : " + driver
+ print content
+ print " " * 10 + "=" * 90
diff --git a/TestON/bin/vyatta.py b/TestON/bin/vyatta.py
index 31bb57e..225e578 100644
--- a/TestON/bin/vyatta.py
+++ b/TestON/bin/vyatta.py
@@ -11,692 +11,692 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
class Vyatta:
def __init__( self ):
self.prompt = '(.*)'
- self.timeout = 60
+ self.timeout = 60
def show_interfaces(self, *options, **def_args ):
'''Possible Options :['ethernet', 'loopback']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet(self, *options, **def_args ):
'''Possible Options :['eth0', 'eth1']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_loopback(self, *options, **def_args ):
'''Possible Options :['lo']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces loopback "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces loopback "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet(self, *options, **def_args ):
'''Possible Options :['eth0', 'eth1']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_loopback_lo(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces loopback lo "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces loopback lo "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0(self, *options, **def_args ):
'''Possible Options :['address', 'bond-group', 'bridge-group', 'description', 'dhcpv6-options', 'DHCPv6', 'disable', 'disable-flow-control', 'Disable', 'disable-link-detect', 'Ignore', 'duplex', 'firewall', 'hw-id', 'ip', 'ipv6', 'mac', 'mirror', 'mtu', 'policy', 'pppoe']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1(self, *options, **def_args ):
'''Possible Options :['address', 'duplex', 'hw-id', 'smp_affinity', 'speed']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth0(self, *options, **def_args ):
'''Possible Options :['duplex', 'hw-id', 'smp_affinity', 'speed']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth0 "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth0 "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip(self, *options, **def_args ):
'''Possible Options :['enable-proxy-arp', 'Enable', 'ospf', 'rip']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_hwid(self, *options, **def_args ):
'''Possible Options :['Media']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 hw-id "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 hw-id "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_DHCPv6(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 DHCPv6 "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 DHCPv6 "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_duplex(self, *options, **def_args ):
'''Possible Options :['auto', 'half', 'full']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 duplex "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 duplex "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1_hwid(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 hw-id "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 hw-id "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth0_speed(self, *options, **def_args ):
'''Possible Options :['auto']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth0 speed "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth0 speed "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1_speed(self, *options, **def_args ):
'''Possible Options :['auto']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 speed "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 speed "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth0_hwid(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth0 hw-id "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth0 hw-id "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_Ignore(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 Ignore "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 Ignore "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1_duplex(self, *options, **def_args ):
'''Possible Options :['auto']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 duplex "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 duplex "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth0_duplex(self, *options, **def_args ):
'''Possible Options :['auto']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth0 duplex "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth0 duplex "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf(self, *options, **def_args ):
'''Possible Options :['authentication', 'OSPF', 'bandwidth', 'cost', 'dead-interval', 'Interval', 'hello-interval', 'Interval', 'mtu-ignore', 'network', 'priority', 'retransmit-interval', 'Interval', 'transmit-delay', 'Link']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_Disable(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 Disable "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 Disable "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_disable(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 disable "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 disable "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_address(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 address "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 address "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall(self, *options, **def_args ):
'''Possible Options :['in', 'local', 'out']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1_address(self, *options, **def_args ):
'''Possible Options :['192.168.56.81/24']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 address "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 address "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_Enable(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip Enable "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip Enable "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_bondgroup(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 bond-group "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 bond-group "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_duplex_half(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 duplex half "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 duplex half "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_in(self, *options, **def_args ):
'''Possible Options :['ipv6-name', 'name']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall in "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall in "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1_speed_auto(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 speed auto "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 speed auto "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_description(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 description "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 description "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth0_speed_auto(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth0 speed auto "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth0 speed auto "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_hwid_Media(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 hw-id Media "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 hw-id Media "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_duplex_auto(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 duplex auto "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 duplex auto "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_duplex_full(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 duplex full "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 duplex full "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth0_duplex_auto(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth0 duplex auto "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth0 duplex auto "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf_OSPF(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf OSPF "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf OSPF "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_out(self, *options, **def_args ):
'''Possible Options :['ipv6-name', 'name']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall out "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall out "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_bridgegroup(self, *options, **def_args ):
'''Possible Options :['bridge', 'cost', 'priority']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 bridge-group "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 bridge-group "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1_duplex_auto(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 duplex auto "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 duplex auto "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf_cost(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf cost "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf cost "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth0_smp_affinity(self, *options, **def_args ):
'''Possible Options :['auto']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth0 smp_affinity "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth0 smp_affinity "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1_smp_affinity(self, *options, **def_args ):
'''Possible Options :['auto']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 smp_affinity "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 smp_affinity "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_local(self, *options, **def_args ):
'''Possible Options :['ipv6-name', 'name']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall local "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall local "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_dhcpv6options(self, *options, **def_args ):
'''Possible Options :['parameters-only', 'Acquire', 'temporary']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 dhcpv6-options "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 dhcpv6-options "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_in_name(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall in name "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall in name "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_bridgegroup_cost(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 bridge-group cost "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 bridge-group cost "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_out_name(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall out name "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall out name "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf_bandwidth(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf bandwidth "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf bandwidth "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth0_smp_affinity_auto(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth0 smp_affinity auto "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth0 smp_affinity auto "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def show_interfaces_ethernet_eth1_smp_affinity_auto(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "show interfaces ethernet eth1 smp_affinity auto "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "show interfaces ethernet eth1 smp_affinity auto "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_enableproxyarp(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip enable-proxy-arp "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip enable-proxy-arp "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_disablelinkdetect(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 disable-link-detect "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 disable-link-detect "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_local_name(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall local name "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall local name "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_bridgegroup_bridge(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 bridge-group bridge "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 bridge-group bridge "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_disableflowcontrol(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 disable-flow-control "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 disable-flow-control "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_bridgegroup_priority(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 bridge-group priority "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 bridge-group priority "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_in_ipv6name(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall in ipv6-name "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall in ipv6-name "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_dhcpv6options_Acquire(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 dhcpv6-options Acquire "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 dhcpv6-options Acquire "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_out_ipv6name(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall out ipv6-name "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall out ipv6-name "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf_authentication(self, *options, **def_args ):
'''Possible Options :['md5', 'plaintext-password', 'Plain']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_firewall_local_ipv6name(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 firewall local ipv6-name "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 firewall local ipv6-name "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_dhcpv6options_temporary(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 dhcpv6-options temporary "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 dhcpv6-options temporary "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf_authentication_md5(self, *options, **def_args ):
'''Possible Options :['key-id']'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication md5 "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication md5 "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf_authentication_Plain(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication Plain "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication Plain "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_dhcpv6options_parametersonly(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 dhcpv6-options parameters-only "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 dhcpv6-options parameters-only "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf_authentication_md5_keyid(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication md5 key-id "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication md5 key-id "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
def set_interfaces_ethernet_eth0_ip_ospf_authentication_plaintextpassword(self, *options, **def_args ):
'''Possible Options :[]'''
arguments= ''
for option in options:
- arguments = arguments + option +' '
+ arguments = arguments + option +' '
prompt = def_args.setdefault('prompt',self.prompt)
timeout = def_args.setdefault('timeout',self.timeout)
- self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication plaintext-password "+ arguments, prompt = prompt, timeout = timeout )
+ self.execute( cmd= "set interfaces ethernet eth0 ip ospf authentication plaintext-password "+ arguments, prompt = prompt, timeout = timeout )
return main.TRUE
diff --git a/TestON/core/dicttoobject.py b/TestON/core/dicttoobject.py
index 82e2828..13c2aa6 100644
--- a/TestON/core/dicttoobject.py
+++ b/TestON/core/dicttoobject.py
@@ -64,4 +64,4 @@
else:
self[k] = obj[k]
return self
-
+
diff --git a/TestON/core/iniparser.py b/TestON/core/iniparser.py
index c350a20..c416b4f 100644
--- a/TestON/core/iniparser.py
+++ b/TestON/core/iniparser.py
@@ -1,7 +1,7 @@
#/usr/bin/env python
'''
Created on 07-Jan-2013
-
+
@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
TestON is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
@@ -28,12 +28,12 @@
Test-Topology parser
Module that parses the test from plain English and topology
from a specification file and prepares for execution.
- Test sequencer
+ Test sequencer
Module that executes the tests case by case,
step by step adding ability for step by step pause and debug later.
Object loader
- Module that connects and loads all the component connection objects
- for access in the test
+ Module that connects and loads all the component connection objects
+ for access in the test
'''
def __init__(self) :
self.default = ''
diff --git a/TestON/core/jsonparser.py b/TestON/core/jsonparser.py
index fea797a..c33a9b0 100644
--- a/TestON/core/jsonparser.py
+++ b/TestON/core/jsonparser.py
@@ -1,7 +1,7 @@
#/usr/bin/env python
'''
Created on 07-Jan-2013
-
+
@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
TestON is free software: you can redistribute it and/or modify
@@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
@@ -24,7 +24,7 @@
import json
class JsonParser:
'''
- Module that parses the response Json to Dictionary and Vice versa.
+ Module that parses the response Json to Dictionary and Vice versa.
'''
def __init__(self) :
self.default = ''
@@ -38,18 +38,18 @@
response_dict = json.loads(json_response)
except Exception:
main.log.error("Json Parser is unable to parse the string")
- return response_dict
-
+ return response_dict
+
'''
-
+
def dict_json(self,response_dict):
-
+
# This will parse the Python Dictionary and return content as Json string.
-
+
json_response = {}
try :
json_response = json.dumps(response_dict)
except Exception:
main.log.error("Json Parser is unable to parse the string")
- return json_response
+ return json_response
'''
diff --git a/TestON/core/logger.py b/TestON/core/logger.py
index e77d440..c65fa49 100644
--- a/TestON/core/logger.py
+++ b/TestON/core/logger.py
@@ -191,7 +191,7 @@
logfile.close()
print newmsg
- main.log.case = case
+ main.log.case = case
def step(msg):
'''
diff --git a/TestON/core/openspeak.py b/TestON/core/openspeak.py
index 59f2769..3794910 100644
--- a/TestON/core/openspeak.py
+++ b/TestON/core/openspeak.py
@@ -1,7 +1,7 @@
#/usr/bin/env python
'''
Created on 20-Dec-2012
-
+
@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
@@ -16,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
@@ -28,34 +28,34 @@
def __init__(self):
self.default = ''
- self.flag = 0
+ self.flag = 0
self.CurrentStep = 0
self.grtrOrLssr = 0
def compiler(self,**compileParameters):
'''
- This method will parse the openspeak file and will write to a python module with the equivalent translations.
- It can accept OpenSpeak syntax in string or an OpenSpeak file as an input parameter.
+ This method will parse the openspeak file and will write to a python module with the equivalent translations.
+ It can accept OpenSpeak syntax in string or an OpenSpeak file as an input parameter.
Translated form can be written into python module if attribute "WRITETOFILE" is set to 1.
'''
-
+
args = self.parse_args(["OPENSPEAKFILE","TEXT","WRITETOFILE","FILEHANDLE"],**compileParameters)
resultString = ''
Test = "Mininet"
args["WRITETOFILE"] = args["WRITETOFILE"] if args["WRITETOFILE"] != None else 1
self.CurrentStep = 0
self.CurrentCase = ''
-
+
## here Open Speak file will be parsed by each line and translated.
if args["OPENSPEAKFILE"] !=None and args["TEXT"] ==None and args["FILEHANDLE"] == None:
self.openspeakfile = args["OPENSPEAKFILE"]
openSpeakFile = open(args["OPENSPEAKFILE"],"r").readlines()
-
- elif args["OPENSPEAKFILE"] ==None and args["TEXT"] and args["FILEHANDLE"] == None:
- openSpeakFile = args["TEXT"].split("\n")
+
+ elif args["OPENSPEAKFILE"] ==None and args["TEXT"] and args["FILEHANDLE"] == None:
+ openSpeakFile = args["TEXT"].split("\n")
elif args["FILEHANDLE"] and args["OPENSPEAKFILE"] ==None and args["TEXT"] ==None:
openSpeakFile = args["FILEHANDLE"].readlines()
-
+
index = 0
outputFile = []
testName = re.search("\/(.*)\.ospk$",self.openspeakfile,0)
@@ -64,32 +64,32 @@
testName = testName[len(testName)-1]
outputFile.append("\nclass " + testName + " :" + "\n")
outputFile.append("\n" + " " * 4 + "def __init__(self) :")
- outputFile.append("\n" + " " * 8 + "self.default = \'\'" + "\n")
-
+ outputFile.append("\n" + " " * 8 + "self.default = \'\'" + "\n")
+
while index < len(openSpeakFile):
ifelseMatch = re.match("\s+IF|\s+ELSE|\s+ELIF",openSpeakFile[index],flags=0)
line = openSpeakFile[index]
repeatMatch = re.match("\s*REPEAT", openSpeakFile[index], flags=0)
if ifelseMatch :
- result = self.verify_and_translate(line)
+ result = self.verify_and_translate(line)
initialSpaces = len(line) -len(line.lstrip())
- self.outLoopSpace = initialSpaces
+ self.outLoopSpace = initialSpaces
nextLine = openSpeakFile[index+1]
nextinitialSpaces = len(nextLine) -len(nextLine.lstrip())
-
-
+
+
while nextinitialSpaces > initialSpaces :
try :
elseMatch = re.match("\s*ELSE|\s*ELIF",nextLine,flags=0)
if elseMatch :
- self.flag = self.flag -1
- result = result + self.verify_and_translate(nextLine)
+ self.flag = self.flag -1
+ result = result + self.verify_and_translate(nextLine)
nextLine = openSpeakFile[index + 1]
nextinitialSpaces = len(nextLine) -len(nextLine.lstrip())
except IndexError:
- pass
+ pass
index = index + 1
- self.flag = 0
+ self.flag = 0
elif repeatMatch:
self.flag = 0
result = self.verify_and_translate(line)
@@ -97,15 +97,15 @@
endMatch = re.match("\s*END",openSpeakFile[index],flags=0)
while not endMatch :
try :
-
+
self.flag = self.flag + 1
result = result + self.verify_and_translate(openSpeakFile[index])
index = index + 1
-
+
except IndexError :
pass
-
-
+
+
else :
self.flag = 0
result = self.verify_and_translate(line)
@@ -119,64 +119,64 @@
testScript.write(lines)
testScript.close()
return resultString
-
+
def verify_and_translate(self,line):
'''
It will accept the each line and calls the suitable API to conver into pyton equivalent syntax .
- It will return the translated python syntax .
- '''
+ It will return the translated python syntax .
+ '''
lineSpace = re.match("^\s+",line,flags=0)
- initialSpaces = len(line) -len(line.lstrip())
- line = re.sub("^\s+","",line) if lineSpace else line
-
-
+ initialSpaces = len(line) -len(line.lstrip())
+ line = re.sub("^\s+","",line) if lineSpace else line
+
+
resultString = None
resultString = "\n" + " " * 4 if str(inspect.stack()[1][3]) == "compiler" else "\n"
- indent = " " *(4 + 4 * self.flag) if self.flag > 0 else " " * 4
+ indent = " " *(4 + 4 * self.flag) if self.flag > 0 else " " * 4
caseMatch = re.search("^CASE\s+(\d+)",line,flags=0)
nameMatch = re.match("^NAME\s+\"(.*)\"",line,flags=0)
commentMatch = re.match("^COMMENT\s+\"(.*)\"",line,flags=0)
stepMatch = re.match("^STEP\s+\"(.*)\"",line,flags=0)
connectMatch = re.match("^CONNECT\s+(\w+)\s+USING\s+(.*)",line,flags=0)
- disconnectMatch = re.match("^DISCONNECT\s+(.*)",line,flags=0)
+ disconnectMatch = re.match("^DISCONNECT\s+(.*)",line,flags=0)
ondoMatch = re.match("^ON\s+(.*)\s+DO\s+(.*)",line,flags=0)
-
+
storeMatch = re.match("^STORE\s+(.*)\s+IN\s+(.*)",line,flags=0)
- variableMatch = re.match("^(.*)\s+=\s+(.*)",line,flags=0)
+ variableMatch = re.match("^(.*)\s+=\s+(.*)",line,flags=0)
assertMatch = re.match("^ASSERT\s+(\w+)\s+(.*)\s+(.*)\s+ONPASS\s+(.*)\s+ONFAIL\s+(.*)",line,flags=0)
logMatch = re.match("^(ERROR|INFO|DEBUG|CRITICAL|REPORT|EXACT|WARN)\s+(.*)",line,flags=0)
ifloop = re.match("IF\s+(\w+)\s*(..|\w+)\s*(.*)",line,flags=0)
- elseloopMatch = re.match("ELSE\s*$",line,flags=0)
+ elseloopMatch = re.match("ELSE\s*$",line,flags=0)
elifloop = re.match("ELSE\sIF\s+(\w+)\s*(..|\w+)\s*(.*)",line,flags=0)
forloopMatch = re.match("\s*REPEAT\s+(/d+)\s+TIMES",line,flags=0)
experimentalMatch = re.match("EXPERIMENTAL\s+MODE\s+(\w+)",line,flags=0)
repeatMatch = re.match("\s*REPEAT\s+(\d+)\s+TIMES", line, flags=0)
-
+
response_pasrse = re.match("\s*PARSE\s+(\w+)\s+AS\s+(\w+)\s+INTO\s+(\w+)", line, flags=0)
-
+
if caseMatch :
self.CurrentStep = 0
self.CurrentCase = "CASE" + caseMatch.group(1)
resultString = resultString + self.translate_case_block(casenumber=caseMatch.group(1))
elif repeatMatch:
resultString = resultString + indent + self.translate_repeat(repeat=repeatMatch.group(1))
- elif nameMatch :
+ elif nameMatch :
resultString = resultString + indent + self.translate_testcase_name(testname=nameMatch.group(1))
- elif commentMatch :
+ elif commentMatch :
resultString = resultString + indent + self.translate_comment(comment=commentMatch.group(1))
elif stepMatch :
self.CurrentStep = self.CurrentStep + 1
resultString = resultString + indent + self.translate_step(step=stepMatch.group(1))
- elif connectMatch :
+ elif connectMatch :
resultString = resultString + indent + self.translate_connect(component=connectMatch.group(1),
arguments=connectMatch.group(2) )
elif disconnectMatch :
resultString = resultString + indent + self.translate_disconnect(component=disconnectMatch.group(1))
elif ondoMatch :
- resultString = resultString + indent + self.translate_onDOAs(component=ondoMatch.group(1),action=ondoMatch.group(2))
+ resultString = resultString + indent + self.translate_onDOAs(component=ondoMatch.group(1),action=ondoMatch.group(2))
elif storeMatch :
resultString = resultString + indent + self.translate_store(variable=storeMatch.group(2),
- value=storeMatch.group(1))
+ value=storeMatch.group(1))
elif variableMatch :
resultString = resultString + indent + self.translate_store(variable=variableMatch.group(1),
value=variableMatch.group(2))
@@ -185,48 +185,48 @@
operator=assertMatch.group(2),
rightvalue=assertMatch.group(3),
onpass=assertMatch.group(4),
- onfail=assertMatch.group(5))
+ onfail=assertMatch.group(5))
elif logMatch :
resultString = resultString + indent + self.translate_logs(loglevel=logMatch.group(1),
message=logMatch.group(2))
elif ifloop :
-
- self.initSpace = initialSpaces
+
+ self.initSpace = initialSpaces
operand = ifloop.group(1)
operator = ifloop.group(2)
- value = ifloop.group(3)
- resultString = resultString + indent + "if " + operand + self.translate_if_else_operator(conditionoperator=operator) + value + ":"
- self.flag = self.flag + 1
+ value = ifloop.group(3)
+ resultString = resultString + indent + "if " + operand + self.translate_if_else_operator(conditionoperator=operator) + value + ":"
+ self.flag = self.flag + 1
elif experimentalMatch :
resultString = resultString + indent + self.translate_experimental_mode(mode=experimentalMatch.group(1))
-
+
elif elseloopMatch :
if initialSpaces == self.initSpace or initialSpaces == self.outLoopSpace:
resultString = resultString + indent + "else :"
self.flag = self.flag + 1
else :
- indent = " " *(4 + 4 * (self.flag-1))
+ indent = " " *(4 + 4 * (self.flag-1))
resultString = resultString + indent + "else :"
self.flag = self.flag + 1
-
+
elif elifloop :
-
+
operand = elifloop.group(1)
operator = elifloop.group(2)
- value = elifloop.group(3)
+ value = elifloop.group(3)
if initialSpaces == self.initSpace or initialSpaces == self.outLoopSpace:
- resultString = resultString + indent + "elif " + operand + self.translate_if_else_operator(conditionoperator=operator) + value + ":"
- self.flag = self.flag + 1
+ resultString = resultString + indent + "elif " + operand + self.translate_if_else_operator(conditionoperator=operator) + value + ":"
+ self.flag = self.flag + 1
else :
- indent = " " *(4 + 4 * (self.flag-1))
- resultString = resultString + indent + "elif " + operand + self.translate_if_else_operator(conditionoperator=operator) + value + ":"
+ indent = " " *(4 + 4 * (self.flag-1))
+ resultString = resultString + indent + "elif " + operand + self.translate_if_else_operator(conditionoperator=operator) + value + ":"
self.flag = self.flag + 1
elif response_pasrse :
output_string = response_pasrse.group(1)
req_format = response_pasrse.group(2)
store_in = response_pasrse.group(3)
- resultString = resultString + indent + store_in +'= main.response_parser('+output_string+",\""+req_format+"\")"
- self.flag = self.flag + 1
+ resultString = resultString + indent + store_in +'= main.response_parser('+output_string+",\""+req_format+"\")"
+ self.flag = self.flag + 1
return resultString
@@ -234,18 +234,18 @@
'''
this will transalte the repeat statement into a python equivalen while loop
'''
-
+
args = self.parse_args(["REPEAT"],**repeatStatement)
resultString = ''
-
+
resultString = "i = 0"
resultString = resultString + "\n" + " " * 8 +"while i<" + args["REPEAT"] + " :"
return resultString
-
+
def translate_if_else_operator(self,**loopBlock):
'''
This method will translate if-else loop block into its equivalent python code.
- Whole loop block will be passed into loopBlock List.
+ Whole loop block will be passed into loopBlock List.
It returns the transalted reuslt as a string.
'''
args = self.parse_args(["CONDITIONOPERATOR"],**loopBlock)
@@ -258,19 +258,19 @@
lesserEqualMatch = re.match("LESSER\s+THAN\s+OR\s+EQUALS$|<=\s*$",args["CONDITIONOPERATOR"],flags=0)
if equalsMatch :
resultString = resultString + " == "
- elif greaterMatch :
+ elif greaterMatch :
resultString = resultString + " > "
- elif lesserMatch :
- resultString = resultString + " < "
+ elif lesserMatch :
+ resultString = resultString + " < "
elif greaterEqualMatch:
resultString = resultString + " >= "
elif lesserEqualMatch :
resultString = resultString + " <= "
else :
- print "\n Error: Given Operator is not listed "
-
- return resultString
-
+ print "\n Error: Given Operator is not listed "
+
+ return resultString
+
def translate_experimental_mode(self,**modeType):
'''
This API will translate statment EXPERIMENTAL MODE ON/OFF into python equivalent.
@@ -284,33 +284,33 @@
if ONmatch :
resultString = "main.EXPERIMENTAL_MODE = main.TRUE"
elif OFFmatch :
- resultString = "main.EXPERIMENTAL_MODE = main.FALSE"
+ resultString = "main.EXPERIMENTAL_MODE = main.FALSE"
return resultString
def interpret(self,**interpetParameters):
'''
- This method will accept the OpenSpeak syntax into a string and will return
+ This method will accept the OpenSpeak syntax into a string and will return
a python equivalent translations statement
'''
-
+
args = self.parse_args(["TEXT","WRITETOFILE"],**interpetParameters)
resultString = ''
## here Open Speak syntax will be translated into python equivalent.
resultString = self.verify_and_translate(args["TEXT"])
lineSpace = re.match("^\s+",resultString,flags=0)
-
- resultString = re.sub("^\s+","",resultString) if lineSpace else resultString
+
+ resultString = re.sub("^\s+","",resultString) if lineSpace else resultString
return resultString
def translate_logs(self,**logStatement):
'''
- This will translate the OpenSpeak log message statements into python equivalent
+ This will translate the OpenSpeak log message statements into python equivalent
to resultString and returns resultString
'''
args = self.parse_args(["LOGLEVEL","MESSAGE"],**logStatement)
resultString = ''
- # convert the statement here
+ # convert the statement here
message = self.translate_log_message(message=args["MESSAGE"])
if args["LOGLEVEL"] == "INFO" :
resultString = resultString + "main.log.info(" + message + ")"
@@ -319,21 +319,21 @@
elif args["LOGLEVEL"] == "DEBUG" :
resultString = resultString + "main.log.debug(" + message + ")"
elif args["LOGLEVEL"] == "REPORT" :
- resultString = resultString + "main.log.report(" + message + ")"
+ resultString = resultString + "main.log.report(" + message + ")"
elif args["LOGLEVEL"] == "CRITICAL" :
resultString = resultString + "main.log.critical(" + message + ")"
elif args["LOGLEVEL"] == "WARN" :
resultString = resultString + "main.log.warn(" + args["MESSAGE"] + ")"
elif args["LOGLEVEL"] == "EXACT" :
- resultString = resultString + "main.log.exact(" + args["MESSAGE"] + ")"
+ resultString = resultString + "main.log.exact(" + args["MESSAGE"] + ")"
-
+
return resultString
def translate_log_message(self,**messageStatement) :
'''
This API will translate log messages if it is a string or Variable or combination
- of string and variable.
+ of string and variable.
It will return the analysed and translate message.
'''
args = self.parse_args(["MESSAGE"],**messageStatement)
@@ -351,28 +351,28 @@
quoteWord = stringWidVariableMatch.group(1)
variableRef = stringWidVariableMatch.group(2)
varMatch = re.search("PARAMS\[(.*)\]|STEP\[(.*)\]|TOPO\[(.*)\]|CASE\[(.*)\]",variableRef,flags=0)
- varRefMatch = re.search("\<(\w+)\>",variableRef,flags=0)
+ varRefMatch = re.search("\<(\w+)\>",variableRef,flags=0)
if varMatch :
resultString = resultString + "\"" + quoteWord + "\"" + " + " + self.translate_parameters(parameters=variableRef)
elif varRefMatch :
resultString = resultString + "\"" + quoteWord + "\"" + " + " + varRefMatch.group(1)
elif varRefMatch:
resultString = resultString + varRefMatch.group(1)
- else :
- print "\nError : Syntax error , Not defined way to give log message" + args["MESSAGE"]
+ else :
+ print "\nError : Syntax error , Not defined way to give log message" + args["MESSAGE"]
- return resultString
-
+ return resultString
+
def translate_assertion(self,**assertStatement):
'''
- This will translate the ASSERT <value1> <COMPARISON OPERATOR> <value2> into python
+ This will translate the ASSERT <value1> <COMPARISON OPERATOR> <value2> into python
equivalent to resultString and returns resultString
'''
args = self.parse_args(["LEFTVALUE","OPERATOR","RIGHTVALUE","ONPASS","ONFAIL"],**assertStatement)
resultString = ''
- # convert the statement here
+ # convert the statement here
notOperatorMatch = re.search("NOT\s+(.*)",args["OPERATOR"],flags=0)
- notOperatorSymbMatch = re.search("\!(.*)",args["OPERATOR"],flags=0)
+ notOperatorSymbMatch = re.search("\!(.*)",args["OPERATOR"],flags=0)
operator = ''
lastresultMatch = re.match("LAST_RESULT",args["RIGHTVALUE"],flags=0)
lastresponseMatch = re.match("LAST_RESPONSE",args["RIGHTVALUE"],flags=0)
@@ -382,11 +382,11 @@
operator = "main.last_response"
else :
operator = args["RIGHTVALUE"]
-
+
if args["OPERATOR"] == None or args["OPERATOR"] == "" :
print "\n Error : Operator has not been specified !!!"
elif notOperatorMatch or notOperatorSymbMatch:
-
+
operators = notOperatorMatch.group(1) if notOperatorMatch else notOperatorSymbMatch.group(1)
operators = self.translate_operator(operator=operators)
if self.grtrOrLssr == 0 :
@@ -400,7 +400,7 @@
",onpass=" + self.translate_assertMessage(message=args["ONPASS"]) +\
",onfail=" + self.translate_assertMessage(message=args["ONFAIL"]) + ")"
- else :
+ else :
operators = self.translate_operator(operator=args["OPERATOR"])
if self.grtrOrLssr == 0 :
resultString = resultString + "utilities.assert_" + operators + "(expect=" +\
@@ -414,8 +414,8 @@
",actual=" + self.translate_response_result(operator=args["RIGHTVALUE"]) +\
",onpass=" + self.translate_assertMessage(message=args["ONPASS"]) +\
",onfail=" + self.translate_assertMessage(message=args["ONFAIL"]) + ")"
-
-
+
+
return resultString
def translate_response_result(self,**operatorStatement):
@@ -426,7 +426,7 @@
args = self.parse_args(["OPERATOR"],**operatorStatement)
resultString = ''
lastResultMatch = re.match("LAST_RESULT",args["OPERATOR"],flags=0)
- lastResponseMatch = re.match("LAST_RESPONSE",args["OPERATOR"],flags=0)
+ lastResponseMatch = re.match("LAST_RESPONSE",args["OPERATOR"],flags=0)
if lastResultMatch :
resultString = resultString + "main.last_result"
elif lastResponseMatch:
@@ -435,7 +435,7 @@
resultString = resultString + args["OPERATOR"]
return resultString
-
+
def translate_assertMessage(self,**messageStatement) :
'''
This API will facilitate the translation of assert ONPASS or ONFAIL messages . The message can be
@@ -443,16 +443,16 @@
It will return the translated message
'''
args = self.parse_args(["MESSAGE"],**messageStatement)
-
+
connectMatch = re.search("CONNECT\s+(\w+)\s+USING\s+(.*)",args["MESSAGE"],flags=0)
- disconnectMatch = re.search("DISCONNECT\s+(.*)",args["MESSAGE"],flags=0)
+ disconnectMatch = re.search("DISCONNECT\s+(.*)",args["MESSAGE"],flags=0)
ondoMatch = re.search("ON\s+(.*)\s+DO\s+(.*)",args["MESSAGE"],flags=0)
paramsMatch = re.search("PARAMS\[(.*)\]|STEP\[(.*)\]|TOPO\[(.*)\]|CASE\[(.*)\]",args["MESSAGE"],flags=0)
stringMatch = re.search("\"(.*)\"|\'(.*)\'",args["MESSAGE"],flags=0)
variableMatch = re.search("\<(.*)\>",args["MESSAGE"],flags=0)
resultString = ''
- if connectMatch :
+ if connectMatch :
resultString = resultString + self.translate_connect(component=connectMatch.group(1),
arguments=connectMatch.group(2) )
elif disconnectMatch :
@@ -462,22 +462,22 @@
action=ondoMatch.group(2))
elif paramsMatch :
resultString = resultString + self.translate_parameters(parameters=args["MESSAGE"])
- elif stringMatch :
+ elif stringMatch :
resultString = resultString + "\"" + stringMatch.group(1) + "\""
elif variableMatch :
- resultString = resultString + variableMatch.group(1)
+ resultString = resultString + variableMatch.group(1)
elif args["MESSAGE"] == None :
- print "\n Error : Please pass a message or action for assertion "
-
- return resultString
-
+ print "\n Error : Please pass a message or action for assertion "
+
+ return resultString
+
def translate_operator(self,**operatorStatement) :
'''
It will translate the operator for assertion , by ensuring against given arguments.
It will return the translated assertion operator.
'''
args = self.parse_args(["OPERATOR"],**operatorStatement)
-
+
resultString = ''
equalsMatch = re.match("EQUALS$|==$",args["OPERATOR"],flags=0)
greaterMatch = re.match("GREATER\s+THAN$|>$",args["OPERATOR"],flags=0)
@@ -486,26 +486,26 @@
greaterEqualMatch = re.match("GREATER\s+THAN\s+OR\s+EQUALS$|>=$",args["OPERATOR"],flags=0)
lesserEqualMatch = re.match("LESSER\s+THAN\s+OR\s+EQUALS$|<=$",args["OPERATOR"],flags=0)
if equalsMatch :
-
+
resultString = resultString + "equals"
- elif greaterMatch :
+ elif greaterMatch :
self.grtrOrLssr = self.grtrOrLssr + 1
resultString = resultString + "greater"
- elif lesserMatch :
+ elif lesserMatch :
self.grtrOrLssr = self.grtrOrLssr + 1
resultString = resultString + "lesser"
elif stringMatch :
-
+
resultString = resultString + "matches"
elif greaterEqualMatch:
-
+
resultString = resultString + "greater_equals"
elif lesserEqualMatch :
-
+
resultString = resultString + "lesser_equals"
else :
- print "\n Error: Given Operator is not listed for assertion"
- return resultString
+ print "\n Error: Given Operator is not listed for assertion"
+ return resultString
def translate_store(self,**storeStatement):
'''
@@ -527,18 +527,18 @@
return resultString
-
+
def translate_disconnect(self,**disconnectStatement):
'''
- This will translate the DISCONNECT <component_name> into python
+ This will translate the DISCONNECT <component_name> into python
equivalent to resultString and returns resultString
'''
args = self.parse_args(["COMPONENT"],**disconnectStatement)
resultString = ''
# convert the statement here
- resultString = "main." + args["COMPONENT"] + ".disconnect()"
+ resultString = "main." + args["COMPONENT"] + ".disconnect()"
return resultString
-
+
def translate_onDOAs(self,**onDoStatement):
'''
This will translate the ON <component> DO <action> USING <arg1> AS <value1>,<arg2> AS <value2>
@@ -546,17 +546,17 @@
'''
args = self.parse_args(["COMPONENT","ACTION","ARGUMENTS"],**onDoStatement)
subString = ''
-
+
usingMatch = re.match("\s*(.*)\s+USING\s+(.*)",args["ACTION"],flags=0)
action = ''
if usingMatch :
action = usingMatch.group(1)
arguments = usingMatch.group(2)
subString = self.translate_usingas(arguments=arguments)
-
+
else :
andCheck = re.search ("(.*)\s+AND\s+(.*)",args["ACTION"],flags=0)
-
+
action = action + "()"
if andCheck:
action = andCheck.group(1) + "()"
@@ -564,19 +564,19 @@
else :
action = args["ACTION"]
action = action + "()"
- # convert the statement here
- resultString = "main." + args["COMPONENT"] + "." + action + subString
+ # convert the statement here
+ resultString = "main." + args["COMPONENT"] + "." + action + subString
return resultString
-
+
def handle_conjuction(self,**conjuctStatement):
'''
This will handle the conjuctions
'''
-
+
args = self.parse_args(["STATEMENT"],**conjuctStatement)
subSentence = ''
-
+
storeMatch = re.match("\s*STORE\s+(.*)\s+IN\s+(.*)",args["STATEMENT"],flags=0)
assertMatch = re.match("\s*ASSERT\s+(\w+)\s+(.*)\s+(.*)\s+ONPASS\s+(.*)\s+ONFAIL\s+(.*)",args["STATEMENT"],flags=0)
if storeMatch :
@@ -607,16 +607,16 @@
subSentence = self.handle_conjuction(statement=andCheck.group(2))
else :
line = args["ARGUMENTS"]
-
-
-
+
+
+
argsMatch = re.search("(.*),(.*)",line,flags=0)
if args["ARGUMENTS"] == None or args["ARGUMENTS"] == '' :
subString = ''
elif argsMatch :
-
+
argsList = line.split(",")
for index, arguments in enumerate(argsList):
argMatch = re.search("(.*)\s+AS\s+(.*)",arguments,flags=0)
@@ -639,7 +639,7 @@
if index == len(argsList) - 1 :
subString = subString + arguments
else :
- subString = subString + arguments + ","
+ subString = subString + arguments + ","
else :
argMatch = re.search("(.*)\s+AS\s+(.*)",args["ARGUMENTS"],flags=0)
if argMatch:
@@ -663,36 +663,36 @@
def translate_connect(self,**connectStatement):
'''
- This will translate the CONNECT <component_name> USING1 <arg1> AS <value1>, <arg2> AS <value2>
+ This will translate the CONNECT <component_name> USING1 <arg1> AS <value1>, <arg2> AS <value2>
into python equivalent to resultString and returns resultString
'''
args = self.parse_args(["COMPONENT","ARGUMENTS"],**connectStatement)
resultString = ''
subString = self.translate_usingas(arguments=args["ARGUMENTS"])
- # convert the statement here
- resultString = "main." + args["COMPONENT"] + ".connect(" + subString + ")"
+ # convert the statement here
+ resultString = "main." + args["COMPONENT"] + ".connect(" + subString + ")"
return resultString
def translate_parameters(self,**parameterStatement):
'''
- This will translate the OpenSpeak Case and Params parameters into python equivalent
+ This will translate the OpenSpeak Case and Params parameters into python equivalent
to resultString and returns resultString
'''
args = self.parse_args(["PARAMETERS"],**parameterStatement)
argument = args["PARAMETERS"]
resultString = ''
- ### match arguments
+ ### match arguments
paramsMatch = re.search("PARAMS((\[(.*)\])*)",argument,flags=0)
stepsMatch = re.search("STEP((\[(.*)\])*)",argument,flags=0)
casesMatch = re.search("CASE((\[(.*)\])*)",argument,flags=0)
topoMatch = re.search("TOPO((\[(.*)\])*)",argument,flags=0)
lastResultMatch = re.match("LAST_RESULT",argument,flags=0)
- lastResponseMatch = re.match("LAST_RESPONSE",argument,flags=0)
+ lastResponseMatch = re.match("LAST_RESPONSE",argument,flags=0)
# convert the statement here
if paramsMatch :
params = paramsMatch.group(1)
- resultString = resultString + "main.params" + self._argsCheck(checkvar=params)
+ resultString = resultString + "main.params" + self._argsCheck(checkvar=params)
elif stepsMatch :
resultString = resultString +"main.params[\'" + self.CurrentCase +\
"\'][\'STEP" + str(self.CurrentStep) + "\']" +\
@@ -705,19 +705,19 @@
self._argsCheck(checkvar=topoMatch.group(1))
elif lastResultMatch :
resultString = resultString + "main.last_result"
- elif lastResponseMatch :
- resultString = resultString + "main.last_response"
+ elif lastResponseMatch :
+ resultString = resultString + "main.last_response"
return resultString
def _argsCheck(self,**args):
''' This API will check if given argument is varibale reference or String and will translate accordingly.
It will return the tanslate form in resultString.
- '''
+ '''
args = self.parse_args(["CHECKVAR"],**args)
params = args["CHECKVAR"]
argsList = params.split("]")
resultString = ''
- del argsList[len(argsList) - 1]
+ del argsList[len(argsList) - 1]
for index,paramArgs in enumerate(argsList) :
argsWidVariable = re.search("(\"|\')\s*(\w+)\s*(\'|\")",paramArgs,flags=0)
if argsWidVariable :
@@ -728,71 +728,71 @@
def translate_step(self,**stepStatement):
'''
- This will translate the STEP "DO SOMETHING HERE" into python equivalent
+ This will translate the STEP "DO SOMETHING HERE" into python equivalent
to resultString and returns resultString
'''
args = self.parse_args(["STEP"],**stepStatement)
resultString = ''
resultString = "main.step(\"" + args["STEP"] + "\")"
- # convert the statement here
+ # convert the statement here
return resultString
-
+
def translate_comment(self,**commentStatement):
'''
- This will translate the COMMENT "DO SOMETHING HERE" into python equivalent
+ This will translate the COMMENT "DO SOMETHING HERE" into python equivalent
to resultString and returns resultString
'''
args = self.parse_args(["COMMENT"],**commentStatement)
resultString = ''
resultString = "#" + args["COMMENT"]
- # convert the statement here
- return resultString
-
+ # convert the statement here
+ return resultString
+
def translate_testcase_name(self,**nameStatement):
'''
- This method will convert NAME "<Testcase_name>" into python equivalent statement
- to resultString and returns resultString
- '''
+ This method will convert NAME "<Testcase_name>" into python equivalent statement
+ to resultString and returns resultString
+ '''
args = self.parse_args(["TESTNAME"],**nameStatement)
-
+
resultString = ''
- resultString = "main.case(\"" + args["TESTNAME"] + "\")"
- # convert the statement here
- return resultString
-
-
+ resultString = "main.case(\"" + args["TESTNAME"] + "\")"
+ # convert the statement here
+ return resultString
+
+
def translate_case_block(self,**caseBlock):
'''
- This method will translate the case block in test script .
+ This method will translate the case block in test script .
It returns the translated equivalent python code for test script
'''
args = self.parse_args(["CASENUMBER"],**caseBlock)
resultString = ""
resultString = "def CASE" + str(args["CASENUMBER"]) + "(self,main) :\n"
- # process the caseBlock List translate all statements underlying the given case
+ # process the caseBlock List translate all statements underlying the given case
return resultString
-
-
+
+
def translate_loop_block(self,*loopBlock):
'''
This method will translate for loop block into its equivalent python code.
- Whole loop block will be passed into loopBlock List.
+ Whole loop block will be passed into loopBlock List.
It returns the transalted reuslt as a string.
'''
resultString = ''
- # process the loopBlock List translate all statements underlying the given loop block
- return resultString
-
-
+ # process the loopBlock List translate all statements underlying the given loop block
+ return resultString
+
+
def translate_conjuction(self,conjuctionStatement):
'''
- This will translate the AND conjuction statements into python equivalent
+ This will translate the AND conjuction statements into python equivalent
to resultString and returns resultString
'''
resultString = ''
- # convert the statement here
+ # convert the statement here
return resultString
@@ -804,12 +804,12 @@
for key,value in kwargs.iteritems():
#currentKey = str.upper(key)
if isinstance(args,list) and str.upper(key) in args:
- for each in args:
+ for each in args:
if each==str.upper(key):
newArgs [str(each)] = value
elif each != str.upper(key) and (newArgs.has_key(str(each)) == False ):
newArgs[str(each)] = None
-
-
-
+
+
+
return newArgs
diff --git a/TestON/core/utilities.py b/TestON/core/utilities.py
index 1ba403d..02ade72 100644
--- a/TestON/core/utilities.py
+++ b/TestON/core/utilities.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
'''
Created on 23-Oct-2012
-
+
@authors: Anil Kumar (anilkumar.s@paxterrasolutions.com),
Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
@@ -18,9 +18,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
-
+
Utilities will take care about the basic functions like :
* Extended assertion,
* parse_args for key-value pair handling
@@ -43,7 +43,7 @@
* parse_args for key-value pair handling
* Parsing the params or topology file.
'''
-
+
def __init__(self):
self.wrapped = sys.modules[__name__]
@@ -57,7 +57,7 @@
return getattr(self.wrapped, name)
except AttributeError:
def assertHandling(**kwargs):
- nameVar = re.match("^assert",name,flags=0)
+ nameVar = re.match("^assert",name,flags=0)
matchVar = re.match("assert(_not_|_)(equals|matches|greater|lesser)",name,flags=0)
notVar = 0
operators = ""
@@ -193,16 +193,16 @@
for key,value in kwargs.iteritems():
#currentKey = str.upper(key)
if isinstance(args,list) and str.upper(key) in args:
- for each in args:
+ for each in args:
if each==str.upper(key):
newArgs [str(each)] = value
elif each != str.upper(key) and (newArgs.has_key(str(each)) == False ):
newArgs[str(each)] = None
-
-
-
+
+
+
return newArgs
-
+
def send_mail(self):
# Create a text/plain message
msg = email.mime.Multipart.MIMEMultipart()
@@ -213,16 +213,16 @@
sub = "Result summary of \""+main.TEST+"\": "+str(main.TOTAL_TC_SUCCESS)+"% Passed"
except KeyError,AttributeError:
sub = "Result summary of \""+main.TEST+"\": "+str(main.TOTAL_TC_SUCCESS)+"% Passed"
-
+
msg['Subject'] = sub
msg['From'] = 'paxweb@paxterrasolutions.com'
msg['To'] = main.mail
#msg['Cc'] = 'paxweb@paxterrasolutions.com'
-
+
# The main body is just another attachment
body = email.mime.Text.MIMEText(main.logHeader+"\n"+main.testResult)
msg.attach(body)
-
+
# Attachment
for filename in os.listdir(main.logdir):
filepath = main.logdir+"/"+filename
@@ -231,32 +231,32 @@
fp.close()
att.add_header('Content-Disposition','attachment',filename=filename)
msg.attach(att)
-
+
smtp = smtplib.SMTP('198.57.211.46')
smtp.starttls()
smtp.login('paxweb@paxterrasolutions.com','pax@peace')
smtp.sendmail(msg['From'],[msg['To']], msg.as_string())
smtp.quit()
- return main.TRUE
-
-
+ return main.TRUE
+
+
def parse(self,fileName):
'''
This will parse the params or topo or cfg file and return content in the file as Dictionary
'''
self.fileName = fileName
- matchFileName = re.match(r'(.*)\.(cfg|params|topo)',self.fileName,re.M|re.I)
+ matchFileName = re.match(r'(.*)\.(cfg|params|topo)',self.fileName,re.M|re.I)
if matchFileName:
try :
parsedInfo = ConfigObj(self.fileName)
return parsedInfo
except Exception:
- print "There is no such file to parse "+fileName
+ print "There is no such file to parse "+fileName
else:
- return 0
+ return 0
if __name__ != "__main__":
import sys
-
- sys.modules[__name__] = Utilities()
+
+ sys.modules[__name__] = Utilities()
diff --git a/TestON/core/xmldict.py b/TestON/core/xmldict.py
index f873014..2cc47da 100644
--- a/TestON/core/xmldict.py
+++ b/TestON/core/xmldict.py
@@ -14,7 +14,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
diff --git a/TestON/core/xmlparser.py b/TestON/core/xmlparser.py
index a46750a..fea0ce9 100644
--- a/TestON/core/xmlparser.py
+++ b/TestON/core/xmlparser.py
@@ -1,7 +1,7 @@
#/usr/bin/env python
'''
Created on 07-Jan-2013
-
+
@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
TestON is free software: you can redistribute it and/or modify
@@ -15,7 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
@@ -24,7 +24,7 @@
import re
class xmlparser :
-
+
def __init__(self) :
self.default = ''
@@ -40,7 +40,7 @@
parsedInfo = xmldict.xml_to_dict(xml)
return parsedInfo
except Exception:
- print "There is no such file to parse " + fileName
+ print "There is no such file to parse " + fileName
else :
print "file name is not correct"
@@ -48,7 +48,7 @@
'''
It will take the params file path and will return the params dictionary
'''
- paramsPath = re.sub("\.","/",paramsPath)
+ paramsPath = re.sub("\.","/",paramsPath)
paramsPath = re.sub("tests|examples","",paramsPath)
params = self.parse(main.tests_path+paramsPath+".params")
paramsAsString = str(params)
@@ -64,4 +64,4 @@
topology = self.parse(main.tests_path+topologyPath+".topo")
topoAsString = str(topology)
return eval(topoAsString)
-
+
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 46058e7..e988577 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1860,27 +1860,42 @@
Returns a dictionary whose keys are the switch names and the value is
a dictionary containing information about the switch.
"""
- # FIXME: This currently only works with OVS Switches
+ # NOTE: To support new Mininet switch classes, just append the new
+ # class to the switchClasses variable
- # Regex patterns to parse dump output
- # Example Switch:
+ # Regex patterns to parse 'dump' output
+ # Example Switches:
# <OVSSwitch s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None,s1-eth3:None pid=5238>
# <OVSSwitch{ 'protocols': 'OpenFlow10' } s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None pid=25974>
- swRE = r"<OVSSwitch(\{.*\})?\s(?P<name>[^:]+)\:\s" +\
- "(?P<ports>([^,]+,)*[^,\s]+)"
+ # <OVSSwitchNS s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None,s1-eth3:None pid=22550>
+ # <OVSBridge s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None pid=26830>
+ # <UserSwitch s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None pid=14737>
+ switchClasses = r"(OVSSwitch)|(OVSBridge)|(OVSSwitchNS)|(IVSSwitch)|(LinuxBridge)|(UserSwitch)"
+ swRE = r"<(?P<class>" + switchClasses + r")" +\
+ r"(?P<options>\{.*\})?\s" +\
+ r"(?P<name>[^:]+)\:\s" +\
+ r"(?P<ports>([^,]+,)*[^,\s]+)" +\
+ r"\spid=(?P<pid>(\d)+)"
# Update mn port info
self.update()
output = {}
dump = self.dump().split( "\n" )
for line in dump:
- if line.startswith( "<OVSSwitch" ):
- result = re.search( swRE, line, re.I )
+ result = re.search( swRE, line, re.I )
+ if result:
name = result.group( 'name' )
dpid = str( self.getSwitchDPID( name ) ).zfill( 16 )
+ pid = result.group( 'pid' )
+ swClass = result.group( 'class' )
+ options = result.group( 'options' )
if verbose:
main.log.info( "Reading switch %s(%s)" % ( name, dpid ) )
ports = self.getPorts( name )
- output[ name ] = { "dpid": dpid, "ports": ports }
+ output[ name ] = { "dpid": dpid,
+ "ports": ports,
+ "swClass": swClass,
+ "pid": pid,
+ "options": options }
return output
def getHosts( self, verbose=False ):
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 73aa9e2..b6965d3 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -165,12 +165,12 @@
def getEpochMs( self ):
"""
Returns milliseconds since epoch
-
- When checking multiple nodes in a for loop,
- around a hundred milliseconds of difference (ascending) is
- generally acceptable due to calltime of the function.
- Few seconds, however, is not and it means clocks
- are off sync.
+
+ When checking multiple nodes in a for loop,
+ around a hundred milliseconds of difference (ascending) is
+ generally acceptable due to calltime of the function.
+ Few seconds, however, is not and it means clocks
+ are off sync.
"""
try:
self.handle.sendline( 'date +%s.%N' )
@@ -816,8 +816,8 @@
def onosCfgSet( self, ONOSIp, configName, configParam ):
"""
Uses 'onos <node-ip> cfg set' to change a parameter value of an
- application.
-
+ application.
+
ex)
onos 10.0.0.1 cfg set org.onosproject.myapp appSetting 1
ONOSIp = '10.0.0.1'
@@ -834,19 +834,19 @@
self.handle.sendline( "" )
self.handle.expect( ":~" )
self.handle.sendline( cfgStr )
- self.handle.expect("cfg set")
+ self.handle.expect("cfg set")
self.handle.expect( ":~" )
-
+
paramValue = configParam.split(" ")[1]
paramName = configParam.split(" ")[0]
-
+
checkStr = ( "onos " + str(ONOSIp) + """ cfg get " """ + str(configName) + " " + paramName + """ " """)
self.handle.sendline( checkStr )
self.handle.expect( ":~" )
if "value=" + paramValue + "," in self.handle.before:
- main.log.info("cfg " + configName + " successfully set to " + configParam)
+ main.log.info("cfg " + configName + " successfully set to " + configParam)
return main.TRUE
except pexpect.ExceptionPexpect as e:
@@ -860,17 +860,17 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanup()
main.exit()
-
+
time.sleep(5)
main.log.error("CFG SET FAILURE: " + configName + " " + configParam )
- main.ONOSbench.handle.sendline("onos $OC1 cfg get")
+ main.ONOSbench.handle.sendline("onos $OC1 cfg get")
main.ONOSbench.handle.expect("\$")
print main.ONOSbench.handle.before
main.ONOSbench.logReport( ONOSIp, ["ERROR","WARN","EXCEPT"], "d")
return main.FALSE
-
+
def onosCli( self, ONOSIp, cmdstr ):
"""
Uses 'onos' command to send various ONOS CLI arguments.
@@ -1434,8 +1434,7 @@
self.handle.sendline( "" )
self.handle.expect( "\$" )
- self.handle.sendline( "tshark -i " + str( interface ) +
- " -t e -w " + str( dirFile ) + " &" )
+ self.handle.sendline( "tshark -i " + str( interface ) + " -t e -w " + str( dirFile ) + " &" )
self.handle.sendline( "\r" )
self.handle.expect( "Capturing on" )
self.handle.sendline( "\r" )
@@ -1490,7 +1489,7 @@
* directory to store results
Optional:
* interface - default: eth0
- * grepOptions - options for grep
+ * grepOptions - options for grep
Description:
Uses tshark command to grep specific group of packets
and stores the results to specified directory.
@@ -1504,9 +1503,9 @@
grepStr = "grep "+str(grepOptions)
else:
grepStr = "grep"
-
- self.handle.sendline(
- "tshark -i " +
+
+ cmd = (
+ "sudo tshark -i " +
str( interface ) +
" -t e | " +
grepStr + " --line-buffered \"" +
@@ -1514,9 +1513,10 @@
"\" >" +
directory +
" &" )
- self.handle.sendline( "\r" )
+ self.handle.sendline(cmd)
+ main.log.info(cmd)
self.handle.expect( "Capturing on" )
- self.handle.sendline( "\r" )
+ self.handle.sendline( "\n" )
self.handle.expect( "\$" )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
@@ -1853,37 +1853,37 @@
def createLinkGraphFile( self, benchIp, ONOSIpList, deviceCount):
'''
- Create/formats the LinkGraph.cfg file based on arguments
- -only creates a linear topology and connects islands
- -evenly distributes devices
+ Create/formats the LinkGraph.cfg file based on arguments
+ -only creates a linear topology and connects islands
+ -evenly distributes devices
-must be called by ONOSbench
- ONOSIpList - list of all of the node IPs to be used
-
- deviceCount - number of switches to be assigned
+ ONOSIpList - list of all of the node IPs to be used
+
+ deviceCount - number of switches to be assigned
'''
main.log.step("Creating link graph configuration file." )
linkGraphPath = self.home + "/tools/package/etc/linkGraph.cfg"
- tempFile = "/tmp/linkGraph.cfg"
+ tempFile = "/tmp/linkGraph.cfg"
linkGraph = open(tempFile, 'w+')
linkGraph.write("# NullLinkProvider topology description (config file).\n")
linkGraph.write("# The NodeId is only added if the destination is another node's device.\n")
linkGraph.write("# Bugs: Comments cannot be appended to a line to be read.\n")
-
+
clusterCount = len(ONOSIpList)
-
- if type(deviceCount) is int or type(deviceCount) is str:
+
+ if type(deviceCount) is int or type(deviceCount) is str:
deviceCount = int(deviceCount)
switchList = [0]*(clusterCount+1)
baselineSwitchCount = deviceCount/clusterCount
-
+
for node in range(1, clusterCount + 1):
switchList[node] = baselineSwitchCount
for node in range(1, (deviceCount%clusterCount)+1):
switchList[node] += 1
-
+
if type(deviceCount) is list:
main.log.info("Using provided device distribution")
switchList = [0]
@@ -1901,48 +1901,48 @@
continue
linkGraph.write("graph " + ONOSIpList[node] + " {\n")
-
+
if node > 1:
#connect to last device on previous node
- line = ("\t0:5 -> " + str(lastSwitch) + ":6:" + lastIp + "\n") #ONOSIpList[node-1]
- linkGraph.write(line)
-
- lastSwitch = 0
- for switch in range (0, switchList[node]-1):
+ line = ("\t0:5 -> " + str(lastSwitch) + ":6:" + lastIp + "\n") #ONOSIpList[node-1]
+ linkGraph.write(line)
+
+ lastSwitch = 0
+ for switch in range (0, switchList[node]-1):
line = ""
line = ("\t" + str(switch) + ":" + str(myPort))
line += " -- "
line += (str(switch+1) + ":" + str(myPort-1) + "\n")
linkGraph.write(line)
- lastSwitch = switch+1
+ lastSwitch = switch+1
lastIp = ONOSIpList[node]
-
+
#lastSwitch += 1
- if node < (clusterCount):
+ if node < (clusterCount):
#connect to first device on the next node
- line = ("\t" + str(lastSwitch) + ":6 -> 0:5:" + ONOSIpList[node+1] + "\n")
+ line = ("\t" + str(lastSwitch) + ":6 -> 0:5:" + ONOSIpList[node+1] + "\n")
linkGraph.write(line)
-
+
linkGraph.write("}\n")
linkGraph.close()
#SCP
- os.system( "scp " + tempFile + " " + self.user_name + "@" + benchIp + ":" + linkGraphPath)
+ os.system( "scp " + tempFile + " " + self.user_name + "@" + benchIp + ":" + linkGraphPath)
main.log.info("linkGraph.cfg creation complete")
def configNullDev( self, ONOSIpList, deviceCount, numPorts=10):
-
+
'''
- ONOSIpList = list of Ip addresses of nodes switches will be devided amongst
- deviceCount = number of switches to distribute, or list of values to use as custom distribution
+ ONOSIpList = list of Ip addresses of nodes switches will be devided amongst
+ deviceCount = number of switches to distribute, or list of values to use as custom distribution
numPorts = number of ports per device. Defaults to 10 both in this function and in ONOS. Optional arg
'''
main.log.step("Configuring Null Device Provider" )
clusterCount = len(ONOSIpList)
- try:
-
+ try:
+
if type(deviceCount) is int or type(deviceCount) is str:
main.log.step("Creating device distribution")
deviceCount = int(deviceCount)
@@ -1954,22 +1954,22 @@
for node in range(1, (deviceCount%clusterCount)+1):
switchList[node] += 1
-
- if type(deviceCount) is list:
- main.log.info("Using provided device distribution")
-
- if len(deviceCount) == clusterCount:
+
+ if type(deviceCount) is list:
+ main.log.info("Using provided device distribution")
+
+ if len(deviceCount) == clusterCount:
switchList = ['0']
switchList.extend(deviceCount)
-
- if len(deviceCount) == (clusterCount + 1):
- if deviceCount[0] == '0' or deviceCount[0] == 0:
+
+ if len(deviceCount) == (clusterCount + 1):
+ if deviceCount[0] == '0' or deviceCount[0] == 0:
switchList = deviceCount
assert len(switchList) == (clusterCount + 1)
-
+
except AssertionError:
- main.log.error( "Bad device/Ip list match")
+ main.log.error( "Bad device/Ip list match")
except TypeError:
main.log.exception( self.name + ": Object not as expected" )
return None
@@ -1981,14 +1981,14 @@
ONOSIp = [0]
ONOSIp.extend(ONOSIpList)
-
+
devicesString = "devConfigs = "
for node in range(1, len(ONOSIp)):
devicesString += (ONOSIp[node] + ":" + str(switchList[node] ))
if node < clusterCount:
devicesString += (",")
-
- try:
+
+ try:
self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.device.impl.NullDeviceProvider devConfigs " + devicesString )
self.handle.expect(":~")
self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.device.impl.NullDeviceProvider numPorts " + str(numPorts) )
@@ -2004,7 +2004,7 @@
time.sleep(1)
assert ("value=" + str(numPorts)) in verification and (" value=" + devicesString) in verification
-
+
except AssertionError:
main.log.error("Incorrect Config settings: " + verification)
except Exception:
@@ -2012,30 +2012,30 @@
main.cleanup()
main.exit()
- def configNullLink( self,fileName="/opt/onos/apache-karaf-3.0.3/etc/linkGraph.cfg", eventRate=0):
+ def configNullLink( self,fileName="/opt/onos/apache-karaf-3.0.3/etc/linkGraph.cfg", eventRate=0):
'''
- fileName default is currently the same as the default on ONOS, specify alternate file if
+ fileName default is currently the same as the default on ONOS, specify alternate file if
you want to use a different topology file than linkGraph.cfg
'''
-
- try:
- self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.link.impl.NullLinkProvider eventRate " + str(eventRate))
- self.handle.expect(":~")
+
+ try:
+ self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.link.impl.NullLinkProvider eventRate " + str(eventRate))
+ self.handle.expect(":~")
self.handle.sendline("onos $OC1 cfg set org.onosproject.provider.nil.link.impl.NullLinkProvider cfgFile " + fileName )
self.handle.expect(":~")
-
- for i in range(10):
- self.handle.sendline("onos $OC1 cfg get org.onosproject.provider.nil.link.impl.NullLinkProvider")
+
+ for i in range(10):
+ self.handle.sendline("onos $OC1 cfg get org.onosproject.provider.nil.link.impl.NullLinkProvider")
self.handle.expect(":~")
verification = self.handle.before
- if (" value=" + str(eventRate)) in verification and (" value=" + fileName) in verification:
+ if (" value=" + str(eventRate)) in verification and (" value=" + fileName) in verification:
break
- else:
+ else:
time.sleep(1)
-
+
assert ("value=" + str(eventRate)) in verification and (" value=" + fileName) in verification
-
+
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
main.log.error( self.name + ": " + self.handle.before )
@@ -2043,7 +2043,7 @@
main.exit()
except AssertionError:
main.log.info("Settings did not post to ONOS")
- main.log.error(varification)
+ main.log.error(varification)
except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
main.log.error(varification)
@@ -2060,33 +2060,33 @@
def logReport( self, nodeIp, searchTerms, outputMode="s" ):
'''
- accepts either a list or a string for "searchTerms" these
- terms will be searched for in the log and have their
- instances counted
+ terms will be searched for in the log and have their
+ instances counted
- - nodeIp is the ip of the node whos log is to be scanned
+ - nodeIp is the ip of the node whos log is to be scanned
- - output modes:
- "s" - Simple. Quiet output mode that just prints
- the occurences of each search term
+ - output modes:
+ "s" - Simple. Quiet output mode that just prints
+ the occurences of each search term
"d" - Detailed. Prints number of occurences as well as the entire
- line for each of the last 5 occurences
+ line for each of the last 5 occurences
- returns total of the number of instances of all search terms
'''
main.log.info("========================== Log Report ===========================\n")
- if type(searchTerms) is str:
+ if type(searchTerms) is str:
searchTerms = [searchTerms]
logLines = [ [" "] for i in range(len(searchTerms)) ]
- for term in range(len(searchTerms)):
+ for term in range(len(searchTerms)):
logLines[term][0] = searchTerms[term]
- totalHits = 0
- for term in range(len(searchTerms)):
- cmd = "onos-ssh " + nodeIp + " cat /opt/onos/log/karaf.log | grep " + searchTerms[term]
+ totalHits = 0
+ for term in range(len(searchTerms)):
+ cmd = "onos-ssh " + nodeIp + " cat /opt/onos/log/karaf.log | grep " + searchTerms[term]
self.handle.sendline(cmd)
self.handle.expect(":~")
before = (self.handle.before).splitlines()
@@ -2095,25 +2095,25 @@
for line in before:
if searchTerms[term] in line and "grep" not in line:
- count[1] += 1
+ count[1] += 1
if before.index(line) > ( len(before) - 7 ):
logLines[term].append(line)
main.log.info( str(count[0]) + ": " + str(count[1]) )
- if term == len(searchTerms)-1:
+ if term == len(searchTerms)-1:
print("\n")
- totalHits += int(count[1])
+ totalHits += int(count[1])
- if outputMode != "s" and outputMode != "S":
+ if outputMode != "s" and outputMode != "S":
outputString = ""
for i in logLines:
- outputString = i[0] + ": \n"
- for x in range(1,len(i)):
- outputString += ( i[x] + "\n" )
-
+ outputString = i[0] + ": \n"
+ for x in range(1,len(i)):
+ outputString += ( i[x] + "\n" )
+
if outputString != (i[0] + ": \n"):
- main.log.info(outputString)
-
+ main.log.info(outputString)
+
main.log.info("================================================================\n")
return totalHits
@@ -2174,7 +2174,7 @@
main.exit()
def jvmSet(self, memory=8):
-
+
import os
homeDir = os.path.expanduser('~')
@@ -2192,22 +2192,22 @@
serviceConfig.close()
def createDBFile(self, testData):
-
+
filename = main.TEST + "DB"
DBString = ""
-
+
for item in testData:
- if type(item) is string:
+ if type(item) is string:
item = "'" + item + "'"
if testData.index(item) < len(testData-1):
item += ","
- DBString += str(item)
+ DBString += str(item)
DBFile = open(filename, "a")
DBFile.write(DBString)
DBFile.close()
- def verifySummary(self, ONOSIp,*deviceCount):
+ def verifySummary(self, ONOSIp,*deviceCount):
self.handle.sendline("onos " + ONOSIp + " summary")
self.handle.expect(":~")
@@ -2219,12 +2219,12 @@
#if deviceCount:
# passed = "devices=" + str(deviceCount) + "," not in summaryStr
-
+
if "SCC(s)=1," in summaryStr:
passed = True
print("Summary is verifed")
- else:
- print("Summary failed")
+ else:
+ print("Summary failed")
if deviceCount:
print" ============================="
@@ -2232,8 +2232,8 @@
print "Checkstr: " + checkStr
if checkStr not in summaryStr:
passed = False
- print("Device count failed")
- else:
- print "device count verified"
+ print("Device count failed")
+ else:
+ print "device count verified"
return passed
diff --git a/TestON/drivers/common/cli/quaggaclidriver.py b/TestON/drivers/common/cli/quaggaclidriver.py
index d325232..e89047e 100644
--- a/TestON/drivers/common/cli/quaggaclidriver.py
+++ b/TestON/drivers/common/cli/quaggaclidriver.py
@@ -381,7 +381,7 @@
chunk_size = 20
if len(routes) > chunk_size:
- num_iter = (int) (len(routes) / chunk_size)
+ num_iter = (int) (len(routes) / chunk_size)
else:
num_iter = 1;
@@ -403,7 +403,7 @@
except Exception:
main.log.warn( "Failed to add route" )
self.disconnect()
-
+
# waitTimer = 1.00 / routeRate
main.log.info("Total routes so far " + ((str) (total)) + " wait for 0 sec")
#time.sleep( 1 )
diff --git a/TestON/drivers/common/cli/tool/dpctlclidriver.py b/TestON/drivers/common/cli/tool/dpctlclidriver.py
index 1e5f839..504567c 100644
--- a/TestON/drivers/common/cli/tool/dpctlclidriver.py
+++ b/TestON/drivers/common/cli/tool/dpctlclidriver.py
@@ -44,10 +44,10 @@
self.name = self.options[ 'name' ]
self.handle = super(
- DpctlCliDriver, self ).connect( user_name=self.user_name,
- ip_address=self.ip_address,
- port=None,
- pwd=self.pwd )
+ DpctlCliDriver, self ).connect( user_name=self.user_name,
+ ip_address=self.ip_address,
+ port=None,
+ pwd=self.pwd )
if self.handle:
main.log.info( "Connected to the host" )
return main.TRUE
@@ -64,12 +64,12 @@
addFlow create a new flow entry into flow table using "dpctl"
"""
args = utilities.parse_args( [
- "TCPIP",
+ "TCPIP",
"TCPPORT",
"INPORT",
"ACTION",
"TIMEOUT" ],
- **flowParameters )
+ **flowParameters )
cmd = "dpctl add-flow tcp:"
tcpIP = args[ "TCPIP" ] if args[ "TCPIP" ] is not None else "127.0.0.1"
@@ -250,10 +250,10 @@
desc_set Sets the switch description ( as returned in ofp_desc_stats ) to string ( max length is DESC_STR_LEN )
"""
args = utilities.parse_args( [
- "TCPIP",
+ "TCPIP",
"TCPPORT",
"STRING" ],
- **flowParameters )
+ **flowParameters )
tcpIP = args[ "TCPIP" ] if args[ "TCPIP" ] is not None else "127.0.0.1"
tcpPort = args[ "TCPPORT" ] if args[
@@ -278,10 +278,10 @@
dumpDesc Sets the switch description ( as returned in ofp_desc_stats ) to string ( max length is DESC_STR_LEN )
"""
args = utilities.parse_args( [
- "TCPIP",
+ "TCPIP",
"TCPPORT",
"STRING" ],
- **flowParameters )
+ **flowParameters )
tcpIP = args[ "TCPIP" ] if args[ "TCPIP" ] is not None else "127.0.0.1"
tcpPort = args[ "TCPPORT" ] if args[
diff --git a/TestON/examples/Assert/Assert.py b/TestON/examples/Assert/Assert.py
index bc2ce2e..0df0a49 100644
--- a/TestON/examples/Assert/Assert.py
+++ b/TestON/examples/Assert/Assert.py
@@ -11,7 +11,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
'''
@@ -22,24 +22,24 @@
def CASE1(self,main) :
-
+
main.case("Using assert to verify the result")
main.step("Using assert_equal to verify the result is equivalent or not")
expect = main.TRUE
actual = main.TRUE
main.log.warn(main.response_parser('<real></real><imag>2</imag><__complex__>true</__complex__>', "json"))
utilities.assert_equals(expect=expect,actual=actual,onpass="expect is equal to actual",onfail="expect is not equal to actual")
-
+
main.step("Using assert_matches to verify the result matches or not")
expect = "Res(.*)"
actual = "Result"
utilities.assert_matches(expect=expect,actual=actual,onpass="expect is macthes to actual",onfail="expect is not matches to actual")
-
+
main.step("Using assert_greater to verify the result greater or not")
expect = 10
actual = 5
utilities.assert_greater(expect=actual,actual=expect,onpass="expect is greater than the actual",onfail="expect is not greater than the actual")
-
+
main.step("Using assert_lesser to verify the result lesser or not")
expect = 5
actual = 10
diff --git a/TestON/examples/CaseParams/CaseParams.py b/TestON/examples/CaseParams/CaseParams.py
index 0502c46..d988c14 100644
--- a/TestON/examples/CaseParams/CaseParams.py
+++ b/TestON/examples/CaseParams/CaseParams.py
@@ -15,27 +15,27 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
-'''
+'''
class CaseParams:
'''
This example shows the usage of the CASE level parameters, in params file the
[[CASE]]
'destination' = 'h2'
-
+
We can get this CASE level parameter like :
main.params['CASE1']['destination']
-
-
+
+
cd ~/bin/
ofautomation>run CaseParams example 1
will execute this example.
'''
-
+
def __init__(self):
self.default = ""
-
+
def CASE1(self,main):
'''
This test case will showcase usage of CASE level parameters to specify the host as h2
@@ -44,8 +44,8 @@
main.step("Host IP Checking using checkIP")
result = main.Mininet1.checkIP(main.params['CASE1']['destination'])
main.step("Verifying the result")
- utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
-
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
+
def CASE2(self,main):
'''
@@ -55,4 +55,4 @@
main.step("Host IP Checking using checkIP")
result = main.Mininet1.checkIP(main.params['CASE2']['destination'])
main.step("Verifying the result")
- utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h3 IP address configured",onfail="Host h3 IP address didn't configured")
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h3 IP address configured",onfail="Host h3 IP address didn't configured")
diff --git a/TestON/examples/ExperimentTest/ExperimentTest.py b/TestON/examples/ExperimentTest/ExperimentTest.py
index 7630703..9e80dd2 100644
--- a/TestON/examples/ExperimentTest/ExperimentTest.py
+++ b/TestON/examples/ExperimentTest/ExperimentTest.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
-'''
+'''
Created on 26-Nov-2012
-
+
@author: Raghav Kashyap(raghavkashyap@paxterrasolutions.com)
@@ -16,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
Testing of the Experimental Mode
@@ -25,13 +25,13 @@
'''
class ExperimentTest:
'''
- Testing of the Experimental Mode
-
+ Testing of the Experimental Mode
+
'''
-
+
def __init__(self):
self.default = ""
-
+
def CASE1(self,main):
'''
Testing the configuration of the host by using checkIP functionof Mininet driver
@@ -41,8 +41,8 @@
main.step("Host IP Checking using checkIP")
result = main.Mininet1.checkIP(main.params['CASE1']['destination'])
main.step("Verifying the result")
- utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
- main.step("Calling Non Existing API for Experimental Mode")
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
+ main.step("Calling Non Existing API for Experimental Mode")
testReturn = main.POX2.verify_flow(returns=main.TRUE)
utilities.assert_equals(expect=main.TRUE,actual=testReturn,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
@@ -56,7 +56,7 @@
result = main.Mininet1.pingall()
main.step("Verifying the result")
utilities.assert_equals(expect=main.TRUE,actual=result,onpass="All hosts are reacchable",onfail="Hosts are not reachable")
- main.step("Calling Non Existing API for Experimental Mode")
+ main.step("Calling Non Existing API for Experimental Mode")
testReturn = main.Mininet1.verify_flow(returns=main.TRUE)
utilities.assert_equals(expect=main.TRUE,actual=testReturn,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
-
+
diff --git a/TestON/examples/StepParams/StepParams.py b/TestON/examples/StepParams/StepParams.py
index 10cfd69..7e4c2fa 100644
--- a/TestON/examples/StepParams/StepParams.py
+++ b/TestON/examples/StepParams/StepParams.py
@@ -16,24 +16,24 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
-'''
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
+'''
class StepParams:
- '''
+ '''
This example shows the usage of the STEP level parameters, in params file the
[[CASE1]]
[[[STEP1]]]
'host' = 'h2'
-
+
We can get this STEP level parameter like :
main.params['CASE1']['STEP1']['host']
-
-
- ofautomation>run StepParams example 1
+
+
+ ofautomation>run StepParams example 1
'''
def __init__(self):
self.default = ""
-
+
def CASE1(self,main):
'''
This example will showcase the usage of STEP level parameters to specify the host as h2
@@ -42,8 +42,8 @@
main.step("Host IP Checking using checkIP")
result = main.Mininet1.checkIP(main.params['CASE1']['STEP1']['host'])
main.step("Verifying the result")
- utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
-
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
+
def CASE2(self,main):
'''
@@ -53,4 +53,4 @@
main.step("Host IP Checking using checkIP")
result = main.Mininet1.checkIP(main.params['CASE2']['STEP1']['host'])
main.step("Verifying the result")
- utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h3 IP address configured",onfail="Host h3 IP address didn't configured")
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h3 IP address configured",onfail="Host h3 IP address didn't configured")
diff --git a/TestON/examples/Topology/Topology.py b/TestON/examples/Topology/Topology.py
index 775535c..efccde9 100644
--- a/TestON/examples/Topology/Topology.py
+++ b/TestON/examples/Topology/Topology.py
@@ -16,33 +16,33 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with TestON. If not, see <http://www.gnu.org/licenses/>.
-'''
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
+'''
class Topology:
'''
-
+
This example shows, how we can use the topology file:
-
+
In topo file we can specify the component like below:
- [TOPOLOGY]
-
+ [TOPOLOGY]
+
[[COMPONENT]]
[[["Mininet1"]]]
-
+
The usage of this component in the test script like below:
-
+
main.Mininet1.checkIP(main.params['CASE1']['destination'])
-
- Here we are using the Mininet1 which of type Mininet
-
-
-
+
+ Here we are using the Mininet1 which of type Mininet
+
+
+
ofautomation>run Topology example 1
will execute this example.
'''
def __init__(self):
self.default = ""
-
+
def CASE1(self,main):
'''
This will showcase the usage of Topology
@@ -51,6 +51,6 @@
main.step("Mininet1 specified in Topology , using the Mininet1 to check host ip")
result = main.Mininet1.checkIP(main.params['CASE1']['destination'])
main.step("Verifying the result")
- utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
-
-
+ utilities.assert_equals(expect=main.TRUE,actual=result,onpass="Host h2 IP address configured",onfail="Host h2 IP address didn't configured")
+
+
diff --git a/TestON/lib/configobj-4.7.2/._configobj.py b/TestON/lib/configobj-4.7.2/._configobj.py
index a276d79..07fbd90 100644
--- a/TestON/lib/configobj-4.7.2/._configobj.py
+++ b/TestON/lib/configobj-4.7.2/._configobj.py
Binary files differ
diff --git a/TestON/lib/configobj-4.7.2/._setup.py b/TestON/lib/configobj-4.7.2/._setup.py
index 7fb7ea2..2ec4b3d 100644
--- a/TestON/lib/configobj-4.7.2/._setup.py
+++ b/TestON/lib/configobj-4.7.2/._setup.py
Binary files differ
diff --git a/TestON/lib/configobj-4.7.2/._validate.py b/TestON/lib/configobj-4.7.2/._validate.py
index a217e20..286fe7c 100644
--- a/TestON/lib/configobj-4.7.2/._validate.py
+++ b/TestON/lib/configobj-4.7.2/._validate.py
Binary files differ
diff --git a/TestON/lib/configobj-4.7.2/configobj.py b/TestON/lib/configobj-4.7.2/configobj.py
index c1f6e6d..eae556a 100644
--- a/TestON/lib/configobj-4.7.2/configobj.py
+++ b/TestON/lib/configobj-4.7.2/configobj.py
@@ -153,29 +153,29 @@
class Builder(object):
-
+
def build(self, o):
m = getattr(self, 'build_' + o.__class__.__name__, None)
if m is None:
raise UnknownType(o.__class__.__name__)
return m(o)
-
+
def build_List(self, o):
return map(self.build, o.getChildren())
-
+
def build_Const(self, o):
return o.value
-
+
def build_Dict(self, o):
d = {}
i = iter(map(self.build, o.getChildren()))
for el in i:
d[el] = i.next()
return d
-
+
def build_Tuple(self, o):
return tuple(self.build_List(o))
-
+
def build_Name(self, o):
if o.name == 'None':
return None
@@ -183,10 +183,10 @@
return True
if o.name == 'False':
return False
-
+
# An undefined Name
raise UnknownType('Undefined Name')
-
+
def build_Add(self, o):
real, imag = map(self.build_Const, o.getChildren())
try:
@@ -196,14 +196,14 @@
if not isinstance(imag, complex) or imag.real != 0.0:
raise UnknownType('Add')
return real+imag
-
+
def build_Getattr(self, o):
parent = self.build(o.expr)
return getattr(parent, o.attrname)
-
+
def build_UnarySub(self, o):
return -self.build_Const(o.getChildren()[0])
-
+
def build_UnaryAdd(self, o):
return self.build_Const(o.getChildren()[0])
@@ -317,7 +317,7 @@
# short-cut
if not self._cookie in value:
return value
-
+
def recursive_interpolate(key, value, section, backtrail):
"""The function that does the actual work.
@@ -417,7 +417,7 @@
(e.g., if we interpolated "$$" and returned "$").
"""
raise NotImplementedError()
-
+
class ConfigParserInterpolation(InterpolationEngine):
@@ -466,27 +466,27 @@
def __newobj__(cls, *args):
# Hack for pickle
- return cls.__new__(cls, *args)
+ return cls.__new__(cls, *args)
class Section(dict):
"""
A dictionary-like object that represents a section in a config file.
-
+
It does string interpolation if the 'interpolation' attribute
of the 'main' object is set to True.
-
+
Interpolation is tried first from this object, then from the 'DEFAULT'
section of this object, next from the parent and its 'DEFAULT' section,
and so on until the main object is reached.
-
+
A Section will behave like an ordered dictionary - following the
order of the ``scalars`` and ``sections`` attributes.
You can use this to change the order of members.
-
+
Iteration follows the order: scalars, then sections.
"""
-
+
def __setstate__(self, state):
dict.update(self, state[0])
self.__dict__.update(state[1])
@@ -494,8 +494,8 @@
def __reduce__(self):
state = (dict(self), self.__dict__)
return (__newobj__, (self.__class__,), state)
-
-
+
+
def __init__(self, parent, depth, main, indict=None, name=None):
"""
* parent is the section above
@@ -520,8 +520,8 @@
# (rather than just passing to ``dict.__init__``)
for entry, value in indict.iteritems():
self[entry] = value
-
-
+
+
def _initialise(self):
# the sequence of scalar values in this Section
self.scalars = []
@@ -565,7 +565,7 @@
def __getitem__(self, key):
"""Fetch the item and do string interpolation."""
val = dict.__getitem__(self, key)
- if self.main.interpolation:
+ if self.main.interpolation:
if isinstance(val, basestring):
return self._interpolate(key, val)
if isinstance(val, list):
@@ -582,20 +582,20 @@
def __setitem__(self, key, value, unrepr=False):
"""
Correctly set a value.
-
+
Making dictionary values Section instances.
(We have to special case 'Section' instances - which are also dicts)
-
+
Keys must be strings.
Values need only be strings (or lists of strings) if
``main.stringify`` is set.
-
+
``unrepr`` must be set when setting a value to a dictionary, without
creating a new sub-section.
"""
if not isinstance(key, basestring):
raise ValueError('The key "%s" is not a string.' % key)
-
+
# add the comment
if key not in self.comments:
self.comments[key] = []
@@ -696,7 +696,7 @@
"""
A version of clear that also affects scalars/sections
Also clears comments and configspec.
-
+
Leaves other attributes alone :
depth/main/parent are not affected
"""
@@ -770,10 +770,10 @@
def dict(self):
"""
Return a deepcopy of self as a dictionary.
-
+
All members that are ``Section`` instances are recursively turned to
ordinary dictionaries - by calling their ``dict`` method.
-
+
>>> n = a.dict()
>>> n == a
1
@@ -798,7 +798,7 @@
def merge(self, indict):
"""
A recursive update - useful for merging config files.
-
+
>>> a = '''[section1]
... option1 = True
... [[subsection]]
@@ -818,17 +818,17 @@
if (key in self and isinstance(self[key], dict) and
isinstance(val, dict)):
self[key].merge(val)
- else:
+ else:
self[key] = val
def rename(self, oldkey, newkey):
"""
Change a keyname to another, without changing position in sequence.
-
+
Implemented so that transformations can be made on keys,
as well as on values. (used by encode and decode)
-
+
Also renames comments.
"""
if oldkey in self.scalars:
@@ -856,30 +856,30 @@
call_on_sections=False, **keywargs):
"""
Walk every member and call a function on the keyword and value.
-
+
Return a dictionary of the return values
-
+
If the function raises an exception, raise the errror
unless ``raise_errors=False``, in which case set the return value to
``False``.
-
+
Any unrecognised keyword arguments you pass to walk, will be pased on
to the function you pass in.
-
+
Note: if ``call_on_sections`` is ``True`` then - on encountering a
subsection, *first* the function is called for the *whole* subsection,
and then recurses into it's members. This means your function must be
able to handle strings, dictionaries and lists. This allows you
to change the key of subsections as well as for ordinary members. The
return value when called on the whole subsection has to be discarded.
-
+
See the encode and decode methods for examples, including functions.
-
+
.. admonition:: caution
-
+
You can use ``walk`` to transform the names of members of a section
but you mustn't add or delete members.
-
+
>>> config = '''[XXXXsection]
... XXXXkey = XXXXvalue'''.splitlines()
>>> cfg = ConfigObj(config)
@@ -942,17 +942,17 @@
Accepts a key as input. The corresponding value must be a string or
the objects (``True`` or 1) or (``False`` or 0). We allow 0 and 1 to
retain compatibility with Python 2.2.
-
- If the string is one of ``True``, ``On``, ``Yes``, or ``1`` it returns
+
+ If the string is one of ``True``, ``On``, ``Yes``, or ``1`` it returns
``True``.
-
- If the string is one of ``False``, ``Off``, ``No``, or ``0`` it returns
+
+ If the string is one of ``False``, ``Off``, ``No``, or ``0`` it returns
``False``.
-
+
``as_bool`` is not case sensitive.
-
+
Any other input will raise a ``ValueError``.
-
+
>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_bool('a')
@@ -984,10 +984,10 @@
def as_int(self, key):
"""
A convenience method which coerces the specified value to an integer.
-
+
If the value is an invalid literal for ``int``, a ``ValueError`` will
be raised.
-
+
>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_int('a')
@@ -1007,10 +1007,10 @@
def as_float(self, key):
"""
A convenience method which coerces the specified value to a float.
-
+
If the value is an invalid literal for ``float``, a ``ValueError`` will
be raised.
-
+
>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_float('a')
@@ -1024,13 +1024,13 @@
3.2000000000000002
"""
return float(self[key])
-
-
+
+
def as_list(self, key):
"""
A convenience method which fetches the specified value, guaranteeing
that it is a list.
-
+
>>> a = ConfigObj()
>>> a['a'] = 1
>>> a.as_list('a')
@@ -1046,15 +1046,15 @@
if isinstance(result, (tuple, list)):
return list(result)
return [result]
-
+
def restore_default(self, key):
"""
Restore (and return) default value for the specified key.
-
+
This method will only work for a ConfigObj that was created
with a configspec and has been validated.
-
+
If there is no default value for this key, ``KeyError`` is raised.
"""
default = self.default_values[key]
@@ -1063,20 +1063,20 @@
self.defaults.append(key)
return default
-
+
def restore_defaults(self):
"""
Recursively restore default values to all members
that have them.
-
+
This method will only work for a ConfigObj that was created
with a configspec and has been validated.
-
+
It doesn't delete or modify entries without default values.
"""
for key in self.default_values:
self.restore_default(key)
-
+
for section in self.sections:
self[section].restore_defaults()
@@ -1191,7 +1191,7 @@
write_empty_values=False, _inspec=False):
"""
Parse a config file or create a config file object.
-
+
``ConfigObj(infile=None, configspec=None, encoding=None,
interpolation=True, raise_errors=False, list_values=True,
create_empty=False, file_error=False, stringify=True,
@@ -1201,9 +1201,9 @@
self._inspec = _inspec
# init the superclass
Section.__init__(self, self, 0, self)
-
+
infile = infile or []
-
+
_options = {'configspec': configspec,
'encoding': encoding, 'interpolation': interpolation,
'raise_errors': raise_errors, 'list_values': list_values,
@@ -1219,7 +1219,7 @@
warnings.warn('Passing in an options dictionary to ConfigObj() is '
'deprecated. Use **options instead.',
DeprecationWarning, stacklevel=2)
-
+
# TODO: check the values too.
for entry in options:
if entry not in OPTION_DEFAULTS:
@@ -1230,18 +1230,18 @@
keyword_value = _options[entry]
if value != keyword_value:
options[entry] = keyword_value
-
+
# XXXX this ignores an explicit list_values = True in combination
# with _inspec. The user should *never* do that anyway, but still...
if _inspec:
options['list_values'] = False
-
+
self._initialise(options)
configspec = options['configspec']
self._original_configspec = configspec
self._load(infile, configspec)
-
-
+
+
def _load(self, infile, configspec):
if isinstance(infile, basestring):
self.filename = infile
@@ -1261,10 +1261,10 @@
h.write('')
h.close()
infile = []
-
+
elif isinstance(infile, (list, tuple)):
infile = list(infile)
-
+
elif isinstance(infile, dict):
# initialise self
# the Section class handles creating subsections
@@ -1277,18 +1277,18 @@
this_section[section] = {}
set_section(in_section[section], this_section[section])
set_section(infile, self)
-
+
else:
for entry in infile:
self[entry] = infile[entry]
del self._errors
-
+
if configspec is not None:
self._handle_configspec(configspec)
else:
self.configspec = None
return
-
+
elif getattr(infile, 'read', MISSING) is not MISSING:
# This supports file like objects
infile = infile.read() or []
@@ -1296,7 +1296,7 @@
# in case it's not an 8 bit encoding
else:
raise TypeError('infile must be a filename, file like object, or list of lines.')
-
+
if infile:
# don't do it for the empty ConfigObj
infile = self._handle_bom(infile)
@@ -1314,7 +1314,7 @@
break
infile = [line.rstrip('\r\n') for line in infile]
-
+
self._parse(infile)
# if we had any errors, now is the time to raise them
if self._errors:
@@ -1332,17 +1332,17 @@
raise error
# delete private attributes
del self._errors
-
+
if configspec is None:
self.configspec = None
else:
self._handle_configspec(configspec)
-
-
+
+
def _initialise(self, options=None):
if options is None:
options = OPTION_DEFAULTS
-
+
# initialise a few variables
self.filename = None
self._errors = []
@@ -1359,48 +1359,48 @@
self.newlines = None
self.write_empty_values = options['write_empty_values']
self.unrepr = options['unrepr']
-
+
self.initial_comment = []
self.final_comment = []
self.configspec = None
-
+
if self._inspec:
self.list_values = False
-
+
# Clear section attributes as well
Section._initialise(self)
-
-
+
+
def __repr__(self):
def _getval(key):
try:
return self[key]
except MissingInterpolationOption:
return dict.__getitem__(self, key)
- return ('ConfigObj({%s})' %
- ', '.join([('%s: %s' % (repr(key), repr(_getval(key))))
+ return ('ConfigObj({%s})' %
+ ', '.join([('%s: %s' % (repr(key), repr(_getval(key))))
for key in (self.scalars + self.sections)]))
-
-
+
+
def _handle_bom(self, infile):
"""
Handle any BOM, and decode if necessary.
-
+
If an encoding is specified, that *must* be used - but the BOM should
still be removed (and the BOM attribute set).
-
+
(If the encoding is wrongly specified, then a BOM for an alternative
encoding won't be discovered or removed.)
-
+
If an encoding is not specified, UTF8 or UTF16 BOM will be detected and
removed. The BOM attribute will be set. UTF16 will be decoded to
unicode.
-
+
NOTE: This method must not be called with an empty ``infile``.
-
+
Specifying the *wrong* encoding is likely to cause a
``UnicodeDecodeError``.
-
+
``infile`` must always be returned as a list of lines, but may be
passed in as a single string.
"""
@@ -1410,7 +1410,7 @@
# the encoding specified doesn't have one
# just decode
return self._decode(infile, self.encoding)
-
+
if isinstance(infile, (list, tuple)):
line = infile[0]
else:
@@ -1432,18 +1432,18 @@
##self.BOM = True
# Don't need to remove BOM
return self._decode(infile, encoding)
-
+
# If we get this far, will *probably* raise a DecodeError
# As it doesn't appear to start with a BOM
return self._decode(infile, self.encoding)
-
+
# Must be UTF8
BOM = BOM_SET[enc]
if not line.startswith(BOM):
return self._decode(infile, self.encoding)
-
+
newline = line[len(BOM):]
-
+
# BOM removed
if isinstance(infile, (list, tuple)):
infile[0] = newline
@@ -1451,7 +1451,7 @@
infile = newline
self.BOM = True
return self._decode(infile, self.encoding)
-
+
# No encoding specified - so we need to check for UTF8/UTF16
for BOM, (encoding, final_encoding) in BOMS.items():
if not line.startswith(BOM):
@@ -1475,7 +1475,7 @@
return infile
# UTF16 - have to decode
return self._decode(infile, encoding)
-
+
# No BOM discovered and no encoding specified, just return
if isinstance(infile, basestring):
# infile read from a file will be a single string
@@ -1494,7 +1494,7 @@
def _decode(self, infile, encoding):
"""
Decode infile to unicode. Using the specified encoding.
-
+
if is a string, it also needs converting to a list.
"""
if isinstance(infile, basestring):
@@ -1535,14 +1535,14 @@
temp_list_values = self.list_values
if self.unrepr:
self.list_values = False
-
+
comment_list = []
done_start = False
this_section = self
maxline = len(infile) - 1
cur_index = -1
reset_comment = False
-
+
while cur_index < maxline:
if reset_comment:
comment_list = []
@@ -1554,13 +1554,13 @@
reset_comment = False
comment_list.append(line)
continue
-
+
if not done_start:
# preserve initial comment
self.initial_comment = comment_list
comment_list = []
done_start = True
-
+
reset_comment = True
# first we check if it's a section marker
mat = self._sectionmarker.match(line)
@@ -1574,7 +1574,7 @@
self._handle_error("Cannot compute the section depth at line %s.",
NestingError, infile, cur_index)
continue
-
+
if cur_depth < this_section.depth:
# the new section is dropping back to a previous level
try:
@@ -1593,13 +1593,13 @@
else:
self._handle_error("Section too nested at line %s.",
NestingError, infile, cur_index)
-
+
sect_name = self._unquote(sect_name)
if sect_name in parent:
self._handle_error('Duplicate section name at line %s.',
DuplicateError, infile, cur_index)
continue
-
+
# create the new section
this_section = Section(
parent,
@@ -1702,7 +1702,7 @@
"""
Given a section and a depth level, walk back through the sections
parents to see if the depth level matches a previous section.
-
+
Return a reference to the right section,
or raise a SyntaxError.
"""
@@ -1720,7 +1720,7 @@
def _handle_error(self, text, ErrorClass, infile, cur_index):
"""
Handle an error according to the error settings.
-
+
Either raise the error or store it.
The error will have occured at ``cur_index``
"""
@@ -1749,19 +1749,19 @@
def _quote(self, value, multiline=True):
"""
Return a safely quoted version of a value.
-
+
Raise a ConfigObjError if the value cannot be safely quoted.
If multiline is ``True`` (default) then use triple quotes
if necessary.
-
+
* Don't quote values that don't need it.
* Recursively quote members of a list and return a comma joined list.
* Multiline is ``False`` for lists.
* Obey list syntax for empty and single member lists.
-
+
If ``list_values=False`` then the value is only quoted if it contains
a ``\\n`` (is multiline) or '#'.
-
+
If ``write_empty_values`` is set, and the value is an empty string, it
won't be quoted.
"""
@@ -1769,7 +1769,7 @@
# Only if multiline is set, so that it is used for values not
# keys, and not values that are part of a list
return ''
-
+
if multiline and isinstance(value, (list, tuple)):
if not value:
return ','
@@ -1785,12 +1785,12 @@
if not value:
return '""'
-
+
no_lists_no_quotes = not self.list_values and '\n' not in value and '#' not in value
need_triple = multiline and ((("'" in value) and ('"' in value)) or ('\n' in value ))
hash_triple_quote = multiline and not need_triple and ("'" in value) and ('"' in value) and ('#' in value)
check_for_single = (no_lists_no_quotes or not need_triple) and not hash_triple_quote
-
+
if check_for_single:
if not self.list_values:
# we don't quote if ``list_values=False``
@@ -1808,13 +1808,13 @@
else:
# if value has '\n' or "'" *and* '"', it will need triple quotes
quot = self._get_triple_quote(value)
-
+
if quot == noquot and '#' in value and self.list_values:
quot = self._get_single_quote(value)
-
+
return quot % value
-
-
+
+
def _get_single_quote(self, value):
if ("'" in value) and ('"' in value):
raise ConfigObjError('Value "%s" cannot be safely quoted.' % value)
@@ -1823,15 +1823,15 @@
else:
quot = dquot
return quot
-
-
+
+
def _get_triple_quote(self, value):
if (value.find('"""') != -1) and (value.find("'''") != -1):
raise ConfigObjError('Value "%s" cannot be safely quoted.' % value)
if value.find('"""') == -1:
quot = tdquot
else:
- quot = tsquot
+ quot = tsquot
return quot
@@ -1921,7 +1921,7 @@
def _handle_configspec(self, configspec):
"""Parse the configspec."""
- # FIXME: Should we check that the configspec was created with the
+ # FIXME: Should we check that the configspec was created with the
# correct settings ? (i.e. ``list_values=False``)
if not isinstance(configspec, ConfigObj):
try:
@@ -1935,11 +1935,11 @@
raise ConfigspecError('Parsing configspec failed: %s' % e)
except IOError, e:
raise IOError('Reading configspec failed: %s' % e)
-
- self.configspec = configspec
-
-
+ self.configspec = configspec
+
+
+
def _set_configspec(self, section, copy):
"""
Called by validate. Handles setting the configspec on subsections
@@ -1951,7 +1951,7 @@
for entry in section.sections:
if entry not in configspec:
section[entry].configspec = many
-
+
for entry in configspec.sections:
if entry == '__many__':
continue
@@ -1962,11 +1962,11 @@
# copy comments
section.comments[entry] = configspec.comments.get(entry, [])
section.inline_comments[entry] = configspec.inline_comments.get(entry, '')
-
+
# Could be a scalar when we expect a section
if isinstance(section[entry], Section):
section[entry].configspec = configspec[entry]
-
+
def _write_line(self, indent_string, entry, this_entry, comment):
"""Write an individual line, for the write method"""
@@ -2006,9 +2006,9 @@
def write(self, outfile=None, section=None):
"""
Write the current ConfigObj as a file
-
+
tekNico: FIXME: use StringIO instead of real files
-
+
>>> filename = a.filename
>>> a.filename = 'test.ini'
>>> a.write()
@@ -2021,7 +2021,7 @@
if self.indent_type is None:
# this can be true if initialised from a dictionary
self.indent_type = DEFAULT_INDENT_TYPE
-
+
out = []
cs = self._a_to_u('#')
csp = self._a_to_u('# ')
@@ -2035,7 +2035,7 @@
if stripped_line and not stripped_line.startswith(cs):
line = csp + line
out.append(line)
-
+
indent_string = self.indent_type * section.depth
for entry in (section.scalars + section.sections):
if entry in section.defaults:
@@ -2048,7 +2048,7 @@
out.append(indent_string + comment_line)
this_entry = section[entry]
comment = self._handle_comment(section.inline_comments[entry])
-
+
if isinstance(this_entry, dict):
# a section
out.append(self._write_marker(
@@ -2063,7 +2063,7 @@
entry,
this_entry,
comment))
-
+
if section is self:
for line in self.final_comment:
line = self._decode_element(line)
@@ -2072,10 +2072,10 @@
line = csp + line
out.append(line)
self.interpolation = int_val
-
+
if section is not self:
return out
-
+
if (self.filename is None) and (outfile is None):
# output a list of lines
# might need to encode
@@ -2089,7 +2089,7 @@
out.append('')
out[0] = BOM_UTF8 + out[0]
return out
-
+
# Turn the list to a string, joined with correct newlines
newline = self.newlines or os.linesep
if (getattr(outfile, 'mode', None) is not None and outfile.mode == 'w'
@@ -2102,7 +2102,7 @@
if self.BOM and ((self.encoding is None) or match_utf8(self.encoding)):
# Add the UTF8 BOM
output = BOM_UTF8 + output
-
+
if not output.endswith(newline):
output += newline
if outfile is not None:
@@ -2117,34 +2117,34 @@
section=None):
"""
Test the ConfigObj against a configspec.
-
+
It uses the ``validator`` object from *validate.py*.
-
+
To run ``validate`` on the current ConfigObj, call: ::
-
+
test = config.validate(validator)
-
+
(Normally having previously passed in the configspec when the ConfigObj
was created - you can dynamically assign a dictionary of checks to the
``configspec`` attribute of a section though).
-
+
It returns ``True`` if everything passes, or a dictionary of
pass/fails (True/False). If every member of a subsection passes, it
will just have the value ``True``. (It also returns ``False`` if all
members fail).
-
+
In addition, it converts the values from strings to their native
types if their checks pass (and ``stringify`` is set).
-
+
If ``preserve_errors`` is ``True`` (``False`` is default) then instead
of a marking a fail with a ``False``, it will preserve the actual
exception object. This can contain info about the reason for failure.
For example the ``VdtValueTooSmallError`` indicates that the value
supplied was too small. If a value (or section) is missing it will
still be marked as ``False``.
-
+
You must have the validate module to use ``preserve_errors=True``.
-
+
You can then use the ``flatten_errors`` function to turn your nested
results dictionary into a flattened list of failures - useful for
displaying meaningful error messages.
@@ -2157,7 +2157,7 @@
# Which makes importing configobj faster
from validate import VdtMissingValue
self._vdtMissingValue = VdtMissingValue
-
+
section = self
if copy:
@@ -2167,23 +2167,23 @@
section.BOM = section.configspec.BOM
section.newlines = section.configspec.newlines
section.indent_type = section.configspec.indent_type
-
+
#
# section.default_values.clear() #??
configspec = section.configspec
self._set_configspec(section, copy)
-
+
def validate_entry(entry, spec, val, missing, ret_true, ret_false):
section.default_values.pop(entry, None)
-
+
try:
section.default_values[entry] = validator.get_default_value(configspec[entry])
except (KeyError, AttributeError, validator.baseErrorClass):
# No default, bad default or validator has no 'get_default_value'
# (e.g. SimpleVal)
pass
-
+
try:
check = validator.check(spec,
val,
@@ -2217,16 +2217,16 @@
if not copy and missing and entry not in section.defaults:
section.defaults.append(entry)
return ret_true, ret_false
-
+
#
out = {}
ret_true = True
ret_false = True
-
+
unvalidated = [k for k in section.scalars if k not in configspec]
- incorrect_sections = [k for k in configspec.sections if k in section.scalars]
+ incorrect_sections = [k for k in configspec.sections if k in section.scalars]
incorrect_scalars = [k for k in configspec.scalars if k in section.sections]
-
+
for entry in configspec.scalars:
if entry in ('__many__', '___many___'):
# reserved names
@@ -2246,16 +2246,16 @@
else:
missing = False
val = section[entry]
-
- ret_true, ret_false = validate_entry(entry, configspec[entry], val,
+
+ ret_true, ret_false = validate_entry(entry, configspec[entry], val,
missing, ret_true, ret_false)
-
+
many = None
if '__many__' in configspec.scalars:
many = configspec['__many__']
elif '___many___' in configspec.scalars:
many = configspec['___many___']
-
+
if many is not None:
for entry in unvalidated:
val = section[entry]
@@ -2279,7 +2279,7 @@
ret_false = False
msg = 'Section %r was provided as a single value' % entry
out[entry] = validator.baseErrorClass(msg)
-
+
# Missing sections will have been created as empty ones when the
# configspec was read.
for entry in section.sections:
@@ -2300,7 +2300,7 @@
ret_false = False
else:
ret_true = False
-
+
section.extra_values = unvalidated
if preserve_errors and not section._created:
# If the section wasn't created (i.e. it wasn't missing)
@@ -2329,12 +2329,12 @@
self.configspec = None
# Just to be sure ;-)
self._original_configspec = None
-
-
+
+
def reload(self):
"""
Reload a ConfigObj from file.
-
+
This method raises a ``ReloadError`` if the ConfigObj doesn't have
a filename attribute pointing to a file.
"""
@@ -2347,31 +2347,31 @@
if entry == 'configspec':
continue
current_options[entry] = getattr(self, entry)
-
+
configspec = self._original_configspec
current_options['configspec'] = configspec
-
+
self.clear()
self._initialise(current_options)
self._load(filename, configspec)
-
+
class SimpleVal(object):
"""
A simple validator.
Can be used to check that all members expected are present.
-
+
To use it, provide a configspec with all your members in (the value given
will be ignored). Pass an instance of ``SimpleVal`` to the ``validate``
method of your ``ConfigObj``. ``validate`` will return ``True`` if all
members are present, or a dictionary with True/False meaning
present/missing. (Whole missing sections will be replaced with ``False``)
"""
-
+
def __init__(self):
self.baseErrorClass = ConfigObjError
-
+
def check(self, check, member, missing=False):
"""A dummy check method, always returns the value unchanged."""
if missing:
@@ -2383,32 +2383,32 @@
"""
An example function that will turn a nested dictionary of results
(as returned by ``ConfigObj.validate``) into a flat list.
-
+
``cfg`` is the ConfigObj instance being checked, ``res`` is the results
dictionary returned by ``validate``.
-
+
(This is a recursive function, so you shouldn't use the ``levels`` or
``results`` arguments - they are used by the function.)
-
+
Returns a list of keys that failed. Each member of the list is a tuple::
-
+
([list of sections...], key, result)
-
+
If ``validate`` was called with ``preserve_errors=False`` (the default)
then ``result`` will always be ``False``.
*list of sections* is a flattened list of sections that the key was found
in.
-
+
If the section was missing (or a section was expected and a scalar provided
- or vice-versa) then key will be ``None``.
-
+
If the value (or section) was missing then ``result`` will be ``False``.
-
+
If ``validate`` was called with ``preserve_errors=True`` and a value
was present, but failed the check, then ``result`` will be the exception
object returned. You can use this as a string that describes the failure.
-
+
For example *The value "3" is of the wrong type*.
"""
if levels is None:
@@ -2443,21 +2443,21 @@
"""
Find all the values and sections not in the configspec from a validated
ConfigObj.
-
+
``get_extra_values`` returns a list of tuples where each tuple represents
either an extra section, or an extra value.
-
- The tuples contain two values, a tuple representing the section the value
+
+ The tuples contain two values, a tuple representing the section the value
is in and the name of the extra values. For extra values in the top level
section the first member will be an empty tuple. For values in the 'foo'
section the first member will be ``('foo',)``. For members in the 'bar'
subsection of the 'foo' section the first member will be ``('foo', 'bar')``.
-
+
NOTE: If you call ``get_extra_values`` on a ConfigObj instance that hasn't
been validated it will return an empty list.
"""
out = []
-
+
out.extend([(_prepend, name) for name in conf.extra_values])
for name in conf.sections:
if name not in conf.extra_values:
diff --git a/TestON/lib/configobj-4.7.2/validate.py b/TestON/lib/configobj-4.7.2/validate.py
index 73dbdb8..9da84ac 100644
--- a/TestON/lib/configobj-4.7.2/validate.py
+++ b/TestON/lib/configobj-4.7.2/validate.py
@@ -17,114 +17,114 @@
# Comments, suggestions and bug reports welcome.
"""
- The Validator object is used to check that supplied values
+ The Validator object is used to check that supplied values
conform to a specification.
-
+
The value can be supplied as a string - e.g. from a config file.
In this case the check will also *convert* the value to
the required type. This allows you to add validation
as a transparent layer to access data stored as strings.
The validation checks that the data is correct *and*
converts it to the expected type.
-
+
Some standard checks are provided for basic data types.
Additional checks are easy to write. They can be
provided when the ``Validator`` is instantiated or
added afterwards.
-
+
The standard functions work with the following basic data types :
-
+
* integers
* floats
* booleans
* strings
* ip_addr
-
+
plus lists of these datatypes
-
+
Adding additional checks is done through coding simple functions.
-
- The full set of standard checks are :
-
+
+ The full set of standard checks are :
+
* 'integer': matches integer values (including negative)
Takes optional 'min' and 'max' arguments : ::
-
+
integer()
integer(3, 9) # any value from 3 to 9
integer(min=0) # any positive value
integer(max=9)
-
+
* 'float': matches float values
Has the same parameters as the integer check.
-
+
* 'boolean': matches boolean values - ``True`` or ``False``
Acceptable string values for True are :
true, on, yes, 1
Acceptable string values for False are :
false, off, no, 0
-
+
Any other value raises an error.
-
+
* 'ip_addr': matches an Internet Protocol address, v.4, represented
by a dotted-quad string, i.e. '1.2.3.4'.
-
+
* 'string': matches any string.
Takes optional keyword args 'min' and 'max'
to specify min and max lengths of the string.
-
+
* 'list': matches any list.
Takes optional keyword args 'min', and 'max' to specify min and
max sizes of the list. (Always returns a list.)
-
+
* 'tuple': matches any tuple.
Takes optional keyword args 'min', and 'max' to specify min and
max sizes of the tuple. (Always returns a tuple.)
-
+
* 'int_list': Matches a list of integers.
Takes the same arguments as list.
-
+
* 'float_list': Matches a list of floats.
Takes the same arguments as list.
-
+
* 'bool_list': Matches a list of boolean values.
Takes the same arguments as list.
-
+
* 'ip_addr_list': Matches a list of IP addresses.
Takes the same arguments as list.
-
+
* 'string_list': Matches a list of strings.
Takes the same arguments as list.
-
- * 'mixed_list': Matches a list with different types in
+
+ * 'mixed_list': Matches a list with different types in
specific positions. List size must match
the number of arguments.
-
+
Each position can be one of :
'integer', 'float', 'ip_addr', 'string', 'boolean'
-
+
So to specify a list with two strings followed
by two integers, you write the check as : ::
-
+
mixed_list('string', 'string', 'integer', 'integer')
-
+
* 'pass': This check matches everything ! It never fails
and the value is unchanged.
-
+
It is also the default if no check is specified.
-
+
* 'option': This check matches any from a list of options.
You specify this check with : ::
-
+
option('option 1', 'option 2', 'option 3')
-
+
You can supply a default value (returned if no value is supplied)
using the default keyword argument.
-
+
You specify a list argument for default using a list constructor syntax in
the check : ::
-
+
checkname(arg1, arg2, default=list('val 1', 'val 2', 'val 3'))
-
+
A badly formatted set of arguments will raise a ``VdtParamError``.
"""
@@ -259,7 +259,7 @@
def dottedQuadToNum(ip):
"""
Convert decimal dotted quad string to long integer
-
+
>>> int(dottedQuadToNum('1 '))
1
>>> int(dottedQuadToNum(' 1.2'))
@@ -274,10 +274,10 @@
Traceback (most recent call last):
ValueError: Not a good dotted-quad IP: 255.255.255.256
"""
-
+
# import here to avoid it when ip_addr values are not used
import socket, struct
-
+
try:
return struct.unpack('!L',
socket.inet_aton(ip.strip()))[0]
@@ -293,7 +293,7 @@
def numToDottedQuad(num):
"""
Convert long int to dotted quad string
-
+
>>> numToDottedQuad(-1L)
Traceback (most recent call last):
ValueError: Not a good numeric IP: -1
@@ -311,10 +311,10 @@
Traceback (most recent call last):
ValueError: Not a good numeric IP: 4294967296
"""
-
+
# import here to avoid it when ip_addr values are not used
import socket, struct
-
+
# no need to intercept here, 4294967295L is fine
if num > 4294967295L or num < 0:
raise ValueError('Not a good numeric IP: %s' % num)
@@ -329,10 +329,10 @@
"""
This error indicates that the check failed.
It can be the base class for more specific errors.
-
+
Any check function that fails ought to raise this error.
(or a subclass)
-
+
>>> raise ValidateError
Traceback (most recent call last):
ValidateError
@@ -381,7 +381,7 @@
class VdtValueError(ValidateError):
"""The value supplied was of the correct type, but was not an allowed value."""
-
+
def __init__(self, value):
"""
>>> raise VdtValueError('jedi')
@@ -445,18 +445,18 @@
"""
Validator is an object that allows you to register a set of 'checks'.
These checks take input and test that it conforms to the check.
-
+
This can also involve converting the value from a string into
the correct datatype.
-
+
The ``check`` method takes an input string which configures which
check is to be used and applies that check to a supplied value.
-
+
An example input string would be:
'int_range(param1, param2)'
-
+
You would then provide something like:
-
+
>>> def int_range_check(value, min, max):
... # turn min and max from strings to integers
... min = int(min)
@@ -479,7 +479,7 @@
... if not value <= max:
... raise VdtValueTooBigError(value)
... return value
-
+
>>> fdict = {'int_range': int_range_check}
>>> vtr1 = Validator(fdict)
>>> vtr1.check('int_range(20, 40)', '30')
@@ -487,25 +487,25 @@
>>> vtr1.check('int_range(20, 40)', '60')
Traceback (most recent call last):
VdtValueTooBigError: the value "60" is too big.
-
+
New functions can be added with : ::
-
- >>> vtr2 = Validator()
+
+ >>> vtr2 = Validator()
>>> vtr2.functions['int_range'] = int_range_check
-
- Or by passing in a dictionary of functions when Validator
+
+ Or by passing in a dictionary of functions when Validator
is instantiated.
-
+
Your functions *can* use keyword arguments,
but the first argument should always be 'value'.
-
+
If the function doesn't take additional arguments,
the parentheses are optional in the check.
It can be written with either of : ::
-
+
keyword = function_name
keyword = function_name()
-
+
The first program to utilise Validator() was Michael Foord's
ConfigObj, an alternative to ConfigParser which supports lists and
can validate a config file using a config schema.
@@ -565,35 +565,35 @@
def check(self, check, value, missing=False):
"""
Usage: check(check, value)
-
+
Arguments:
check: string representing check to apply (including arguments)
value: object to be checked
Returns value, converted to correct type if necessary
-
+
If the check fails, raises a ``ValidateError`` subclass.
-
+
>>> vtor.check('yoda', '')
Traceback (most recent call last):
VdtUnknownCheckError: the check "yoda" is unknown.
>>> vtor.check('yoda()', '')
Traceback (most recent call last):
VdtUnknownCheckError: the check "yoda" is unknown.
-
+
>>> vtor.check('string(default="")', '', missing=True)
''
"""
fun_name, fun_args, fun_kwargs, default = self._parse_with_caching(check)
-
+
if missing:
if default is None:
# no information needed here - to be handled by caller
raise VdtMissingValue()
value = self._handle_none(default)
-
+
if value is None:
return None
-
+
return self._check_value(value, fun_name, fun_args, fun_kwargs)
@@ -618,8 +618,8 @@
fun_kwargs = dict([(str(key), value) for (key, value) in fun_kwargs.items()])
self._cache[check] = fun_name, list(fun_args), dict(fun_kwargs), default
return fun_name, fun_args, fun_kwargs, default
-
-
+
+
def _check_value(self, value, fun_name, fun_args, fun_kwargs):
try:
fun = self.functions[fun_name]
@@ -657,7 +657,7 @@
val = self._unquote(val)
fun_kwargs[keymatch.group(1)] = val
continue
-
+
fun_args.append(self._unquote(arg))
else:
# allows for function names without (args)
@@ -689,20 +689,20 @@
def _pass(self, value):
"""
Dummy check that always passes
-
+
>>> vtor.check('', 0)
0
>>> vtor.check('', '0')
'0'
"""
return value
-
-
+
+
def get_default_value(self, check):
"""
Given a check, return the default value for the check
(converted to the right type).
-
+
If the check doesn't specify a default value then a
``KeyError`` will be raised.
"""
@@ -718,11 +718,11 @@
def _is_num_param(names, values, to_float=False):
"""
Return numbers from inputs or raise VdtParamError.
-
+
Lets ``None`` pass through.
Pass in keyword argument ``to_float=True`` to
use float for the conversion rather than int.
-
+
>>> _is_num_param(('', ''), (0, 1.0))
[0, 1]
>>> _is_num_param(('', ''), (0, 1.0), to_float=True)
@@ -757,10 +757,10 @@
A check that tests that a given value is an integer (int, or long)
and optionally, between bounds. A negative value is accepted, while
a float will fail.
-
+
If the value is a string, then the conversion is done - if possible.
Otherwise a VdtError is raised.
-
+
>>> vtor.check('integer', '-1')
-1
>>> vtor.check('integer', '0')
@@ -812,17 +812,17 @@
"""
A check that tests that a given value is a float
(an integer will be accepted), and optionally - that it is between bounds.
-
+
If the value is a string, then the conversion is done - if possible.
Otherwise a VdtError is raised.
-
+
This can accept negative values.
-
+
>>> vtor.check('float', '2')
2.0
-
+
From now on we multiply the value to avoid comparing decimals
-
+
>>> vtor.check('float', '-6.8') * 10
-68.0
>>> vtor.check('float', '12.2') * 10
@@ -861,7 +861,7 @@
bool_dict = {
- True: True, 'on': True, '1': True, 'true': True, 'yes': True,
+ True: True, 'on': True, '1': True, 'true': True, 'yes': True,
False: False, 'off': False, '0': False, 'false': False, 'no': False,
}
@@ -869,7 +869,7 @@
def is_boolean(value):
"""
Check if the value represents a boolean.
-
+
>>> vtor.check('boolean', 0)
0
>>> vtor.check('boolean', False)
@@ -908,7 +908,7 @@
>>> vtor.check('boolean', 'up')
Traceback (most recent call last):
VdtTypeError: the value "up" is of the wrong type.
-
+
"""
if isinstance(value, basestring):
try:
@@ -930,7 +930,7 @@
"""
Check that the supplied value is an Internet Protocol address, v.4,
represented by a dotted-quad string, i.e. '1.2.3.4'.
-
+
>>> vtor.check('ip_addr', '1 ')
'1'
>>> vtor.check('ip_addr', ' 1.2')
@@ -966,11 +966,11 @@
def is_list(value, min=None, max=None):
"""
Check that the value is a list of values.
-
+
You can optionally specify the minimum and maximum number of members.
-
+
It does no check on list members.
-
+
>>> vtor.check('list', ())
[]
>>> vtor.check('list', [])
@@ -1011,11 +1011,11 @@
def is_tuple(value, min=None, max=None):
"""
Check that the value is a tuple of values.
-
+
You can optionally specify the minimum and maximum number of members.
-
+
It does no check on members.
-
+
>>> vtor.check('tuple', ())
()
>>> vtor.check('tuple', [])
@@ -1045,9 +1045,9 @@
def is_string(value, min=None, max=None):
"""
Check that the supplied value is a string.
-
+
You can optionally specify the minimum and maximum number of members.
-
+
>>> vtor.check('string', '0')
'0'
>>> vtor.check('string', 0)
@@ -1081,11 +1081,11 @@
def is_int_list(value, min=None, max=None):
"""
Check that the value is a list of integers.
-
+
You can optionally specify the minimum and maximum number of members.
-
+
Each list member is checked that it is an integer.
-
+
>>> vtor.check('int_list', ())
[]
>>> vtor.check('int_list', [])
@@ -1104,11 +1104,11 @@
def is_bool_list(value, min=None, max=None):
"""
Check that the value is a list of booleans.
-
+
You can optionally specify the minimum and maximum number of members.
-
+
Each list member is checked that it is a boolean.
-
+
>>> vtor.check('bool_list', ())
[]
>>> vtor.check('bool_list', [])
@@ -1129,11 +1129,11 @@
def is_float_list(value, min=None, max=None):
"""
Check that the value is a list of floats.
-
+
You can optionally specify the minimum and maximum number of members.
-
+
Each list member is checked that it is a float.
-
+
>>> vtor.check('float_list', ())
[]
>>> vtor.check('float_list', [])
@@ -1152,11 +1152,11 @@
def is_string_list(value, min=None, max=None):
"""
Check that the value is a list of strings.
-
+
You can optionally specify the minimum and maximum number of members.
-
+
Each list member is checked that it is a string.
-
+
>>> vtor.check('string_list', ())
[]
>>> vtor.check('string_list', [])
@@ -1178,11 +1178,11 @@
def is_ip_addr_list(value, min=None, max=None):
"""
Check that the value is a list of IP addresses.
-
+
You can optionally specify the minimum and maximum number of members.
-
+
Each list member is checked that it is an IP address.
-
+
>>> vtor.check('ip_addr_list', ())
[]
>>> vtor.check('ip_addr_list', [])
@@ -1201,11 +1201,11 @@
Check that a value is a list, coercing strings into
a list with one member. Useful where users forget the
trailing comma that turns a single value into a list.
-
+
You can optionally specify the minimum and maximum number of members.
A minumum of greater than one will fail if the user only supplies a
string.
-
+
>>> vtor.check('force_list', ())
[]
>>> vtor.check('force_list', [])
@@ -1216,8 +1216,8 @@
if not isinstance(value, (list, tuple)):
value = [value]
return is_list(value, min, max)
-
-
+
+
fun_dict = {
'integer': is_integer,
@@ -1233,20 +1233,20 @@
Check that the value is a list.
Allow specifying the type of each member.
Work on lists of specific lengths.
-
+
You specify each member as a positional argument specifying type
-
+
Each type should be one of the following strings :
'integer', 'float', 'ip_addr', 'string', 'boolean'
-
+
So you can specify a list of two strings, followed by
two integers as :
-
+
mixed_list('string', 'string', 'integer', 'integer')
-
+
The length of the list must match the number of positional
arguments you supply.
-
+
>>> mix_str = "mixed_list('integer', 'float', 'ip_addr', 'string', 'boolean')"
>>> check_res = vtor.check(mix_str, (1, 2.0, '1.2.3.4', 'a', True))
>>> check_res == [1, 2.0, '1.2.3.4', 'a', True]
@@ -1266,10 +1266,10 @@
>>> vtor.check(mix_str, 0)
Traceback (most recent call last):
VdtTypeError: the value "0" is of the wrong type.
-
+
This test requires an elaborate setup, because of a change in error string
output from the interpreter between Python 2.2 and 2.3 .
-
+
>>> res_seq = (
... 'passed an incorrect value "',
... 'yoda',
@@ -1299,7 +1299,7 @@
def is_option(value, *options):
"""
This check matches the value to any of a set of options.
-
+
>>> vtor.check('option("yoda", "jedi")', 'yoda')
'yoda'
>>> vtor.check('option("yoda", "jedi")', 'jed')
@@ -1319,7 +1319,7 @@
def _test(value, *args, **keywargs):
"""
A function that exists for test purposes.
-
+
>>> checks = [
... '3, 6, min=1, max=3, test=list(a, b, c)',
... '3',
@@ -1353,7 +1353,7 @@
(3, ('3',), {'test': ['a', 'b', 'c'], 'max': '3'})
(3, ('3',), {'test': ["'a'", 'b', 'x=(c)'], 'max': '3'})
(3, (), {'test': 'x=fish(3)'})
-
+
>>> v = Validator()
>>> v.check('integer(default=6)', '3')
3
@@ -1371,7 +1371,7 @@
KeyError: 'Check "pass" has no default value.'
>>> v.get_default_value('pass(default=list(1, 2, 3, 4))')
['1', '2', '3', '4']
-
+
>>> v = Validator()
>>> v.check("pass(default=None)", None, True)
>>> v.check("pass(default='None')", None, True)
@@ -1380,18 +1380,18 @@
'None'
>>> v.check('pass(default=list(1, 2, 3, 4))', None, True)
['1', '2', '3', '4']
-
+
Bug test for unicode arguments
>>> v = Validator()
>>> v.check(u'string(min=4)', u'test')
u'test'
-
+
>>> v = Validator()
>>> v.get_default_value(u'string(min=4, default="1234")')
u'1234'
>>> v.check(u'string(min=4, default="1234")', u'test')
u'test'
-
+
>>> v = Validator()
>>> default = v.get_default_value('string(default=None)')
>>> default == None
@@ -1402,7 +1402,7 @@
def _test2():
"""
- >>>
+ >>>
>>> v = Validator()
>>> v.get_default_value('string(default="#ff00dd")')
'#ff00dd'
@@ -1436,8 +1436,8 @@
>>> vtor.check("string_list(default=list('\n'))", '', missing=True)
['\n']
"""
-
-
+
+
if __name__ == '__main__':
# run the code tests in doctest format
import sys
diff --git a/TestON/lib/pox/core.py b/TestON/lib/pox/core.py
index 8b31e7a..dc8cab6 100644
--- a/TestON/lib/pox/core.py
+++ b/TestON/lib/pox/core.py
@@ -306,26 +306,26 @@
log.warn("Warning: Registered '%s' multipled times" % (name,))
self.components[name] = component
self.raiseEventNoErrors(ComponentRegistered, name, component)
-
+
def listenToDependencies(self, sink, components):
"""
If a component depends on having other components
- registered with core before it can boot, it can use this method to
+ registered with core before it can boot, it can use this method to
check for registration, and listen to events on those dependencies.
-
+
Note that event handlers named with the _handle* pattern in the sink must
include the name of the desired source as a prefix. For example, if topology is a
dependency, a handler for topology's SwitchJoin event must be labeled:
def _handle_topology_SwitchJoin(...)
-
+
sink - the component waiting on dependencies
components - a list of dependent component names
-
+
Returns whether all of the desired components are registered.
"""
if components == None or len(components) == 0:
return True
-
+
got = set()
for c in components:
if self.hasComponent(c):
diff --git a/TestON/lib/updatedriver/fvtadd.py b/TestON/lib/updatedriver/fvtadd.py
index bba273e..93528bc 100644
--- a/TestON/lib/updatedriver/fvtadd.py
+++ b/TestON/lib/updatedriver/fvtadd.py
@@ -1,8 +1,8 @@
class FVTADD :
def __init__(self):
self.default = ''
-
-
+
+
def runTest(self,self) :
return TemplateTest.runTest(self)
diff --git a/TestON/lib/updatedriver/fvtdriver.py b/TestON/lib/updatedriver/fvtdriver.py
index dc6c4c0..df2bd01 100644
--- a/TestON/lib/updatedriver/fvtdriver.py
+++ b/TestON/lib/updatedriver/fvtdriver.py
@@ -1,7 +1,7 @@
class driver :
def __init__(self):
self.default = ''
-
+
def runTest(self,self) :
return TemplateTest.runTest(self)
diff --git a/TestON/tests/CHOtest/CHOtest.py b/TestON/tests/CHOtest/CHOtest.py
index 994a710..140d089 100644
--- a/TestON/tests/CHOtest/CHOtest.py
+++ b/TestON/tests/CHOtest/CHOtest.py
@@ -116,7 +116,7 @@
onpass="Test step PASS",
onfail="Test step FAIL" )
statusResult = ( statusResult and onos_status )
-
+
main.step( "Start ONOS CLI on all nodes" )
cliResult = main.TRUE
main.log.step(" Start ONOS cli using thread ")
@@ -135,7 +135,7 @@
t.join()
startCliResult = startCliResult and t.result
time2 = time.time()
-
+
if not startCliResult:
main.log.info("ONOS CLI did not start up properly")
main.cleanup()
@@ -168,7 +168,7 @@
"________________________________________________________________________" )
main.case(
"Assign and Balance all Mininet switches across controllers" )
-
+
main.step( "Stop any previous Mininet network topology" )
cliResult = main.TRUE
if main.newTopo == main.params['TOPO3']['topo']:
@@ -177,7 +177,7 @@
main.step( "Start Mininet with Att topology" )
main.newTopo = main.params['TOPO1']['topo']
startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
-
+
main.step( "Assign switches to controllers" )
for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
main.Mininet1.assignSwController(
@@ -202,7 +202,7 @@
main.step( "Balance devices across controllers" )
balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
+ # giving some breathing time for ONOS to complete re-balance
time.sleep( 5 )
topology_output = main.ONOScli1.topology()
@@ -260,10 +260,10 @@
main.log.report( "Controller assignment successfull" )
else:
main.log.report( "Controller assignment failed" )
-
+
main.step( "Balance devices across controllers" )
balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
+ # giving some breathing time for ONOS to complete re-balance
time.sleep( 5 )
case21Result = switch_mastership
@@ -273,7 +273,7 @@
actual=case21Result,
onpass="Starting new Chordal topology test PASS",
onfail="Starting new Chordal topology test FAIL" )
-
+
def CASE22( self, main ):
"""
This test script Loads a new Topology (Spine) on CHO setup and balances all switches
@@ -287,7 +287,7 @@
main.numMNlinks = int ( main.params[ 'TOPO3' ][ 'numLinks' ] )
main.numMNhosts = int ( main.params[ 'TOPO3' ][ 'numHosts' ] )
main.pingTimeout = 600
-
+
main.log.report(
"Load Spine and Leaf topology and Balance all Mininet switches across controllers" )
main.log.report(
@@ -314,7 +314,7 @@
switch_mastership = switch_mastership and main.TRUE
else:
switch_mastership = main.FALSE
-
+
if switch_mastership == main.TRUE:
main.log.report( "Controller assignment successfull" )
else:
@@ -347,7 +347,7 @@
main.deviceLinks = []
main.deviceActiveLinksCount = []
main.devicePortsEnabledCount = []
-
+
main.log.report(
"Collect and Store topology details from ONOS before running any Tests" )
main.log.report(
@@ -410,7 +410,7 @@
main.step( "Collect and store each Device active links Count" )
time1 = time.time()
-
+
for i in xrange( 1,( main.numMNswitches + 1 ), int( main.numCtrls) ):
pool = []
for cli in main.CLIs:
@@ -434,13 +434,13 @@
main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1))
else:
- main.log.info("Devices (expected): %s, Links (expected): %s" %
+ main.log.info("Devices (expected): %s, Links (expected): %s" %
( str( main.numMNswitches ), str( main.numMNlinks ) ) )
main.log.info("Devices (actual): %s, Links (actual): %s" %
( numOnosDevices , numOnosLinks ) )
main.log.info("Topology does not match, exiting CHO test...")
topoResult = main.FALSE
- # It's better exit here from running the test
+ # It's better exit here from running the test
main.cleanup()
main.exit()
@@ -481,7 +481,7 @@
if appCheck != main.TRUE:
main.log.warn( main.CLIs[0].apps() )
main.log.warn( main.CLIs[0].appIDs() )
-
+
time.sleep( 10 )
main.step( "Verify Pingall" )
@@ -501,7 +501,7 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
-
+
main.log.info( "Uninstall reactive forwarding app" )
appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
@@ -561,7 +561,7 @@
if appCheck != main.TRUE:
main.log.warn( main.CLIs[0].apps() )
main.log.warn( main.CLIs[0].appIDs() )
-
+
time.sleep( 10 )
main.step( "Verify Pingall" )
@@ -581,7 +581,7 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
-
+
main.log.info( "Uninstall reactive forwarding app" )
appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
@@ -641,7 +641,7 @@
if appCheck != main.TRUE:
main.log.warn( main.CLIs[0].apps() )
main.log.warn( main.CLIs[0].appIDs() )
-
+
time.sleep( 10 )
main.step( "Verify Pingall" )
@@ -661,7 +661,7 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
-
+
main.log.info( "Uninstall reactive forwarding app" )
appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
@@ -694,7 +694,7 @@
Compare current ONOS topology with reference data
"""
import re
-
+
devicesDPIDTemp = []
hostMACsTemp = []
deviceLinksTemp = []
@@ -732,12 +732,12 @@
time2 = time.time()
main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1))
main.log.info (
- "Device Enabled ports EXPECTED: %s" %
- str( main.devicePortsEnabledCount ) )
+ "Device Enabled ports EXPECTED: %s" %
+ str( main.devicePortsEnabledCount ) )
main.log.info (
- "Device Enabled ports ACTUAL: %s" %
+ "Device Enabled ports ACTUAL: %s" %
str( devicePortsEnabledCountTemp ) )
-
+
if ( cmp( main.devicePortsEnabledCount,
devicePortsEnabledCountTemp ) == 0 ):
stepResult1 = main.TRUE
@@ -799,8 +799,8 @@
main.case( "Install 300 host intents" )
main.step( "Add host Intents" )
intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
+ hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+
intentIdList = []
time1 = time.time()
for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
@@ -865,15 +865,15 @@
main.log.report( "Add 600 host intents and verify pingall (Chordal Topo)" )
main.log.report( "_______________________________________" )
import itertools
-
+
main.case( "Install 600 host intents" )
main.step( "Add host Intents" )
intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
+ hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+
intentIdList = []
time1 = time.time()
-
+
for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
pool = []
for cli in main.CLIs:
@@ -913,7 +913,7 @@
onfail="PING ALL FAIL" )
case14Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case14Result,
@@ -927,11 +927,11 @@
main.log.report( "Add 2278 host intents and verify pingall (Spine Topo)" )
main.log.report( "_______________________________________" )
import itertools
-
+
main.case( "Install 2278 host intents" )
main.step( "Add host Intents" )
intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+ hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
main.pingTimeout = 300
intentIdList = []
time1 = time.time()
@@ -974,7 +974,7 @@
onfail="PING ALL FAIL" )
case15Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case15Result,
@@ -1282,9 +1282,9 @@
Randomly bring some links down and verify ping all ( Host Intents-Chordal Topo)
"""
import random
- import itertools
+ import itertools
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
+
main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Chordal Topo)" )
main.log.report( "___________________________________________________________________________" )
main.case( "Host intents - Randomly bring some core links down and verify ping all" )
@@ -1296,7 +1296,7 @@
main.randomLinks = random.sample(switchesLinksComb, 5 )
print main.randomLinks
main.step( "Cut links on random devices" )
-
+
for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
@@ -1341,7 +1341,7 @@
"""
import random
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
+
main.log.report(
"Bring the core links up that are down and verify ping all (Host Intents-Chordal Topo" )
main.log.report(
@@ -1349,7 +1349,7 @@
main.case(
"Host intents - Bring the core links up that are down and verify ping all" )
main.step( "Bring randomly cut links on devices up" )
-
+
for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
@@ -1394,9 +1394,9 @@
Randomly bring some links down and verify ping all ( Point Intents-Chordal Topo)
"""
import random
- import itertools
+ import itertools
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
+
main.log.report( "Randomly bring some core links down and verify ping all ( Point Intents-Chordal Topo)" )
main.log.report( "___________________________________________________________________________" )
main.case( "Point intents - Randomly bring some core links down and verify ping all" )
@@ -1408,7 +1408,7 @@
main.randomLinks = random.sample(switchesLinksComb, 5 )
print main.randomLinks
main.step( "Cut links on random devices" )
-
+
for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
@@ -1453,7 +1453,7 @@
"""
import random
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
+
main.log.report(
"Bring the core links up that are down and verify ping all ( Point Intents-Chordal Topo" )
main.log.report(
@@ -1461,7 +1461,7 @@
main.case(
"Point intents - Bring the core links up that are down and verify ping all" )
main.step( "Bring randomly cut links on devices up" )
-
+
for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
@@ -1518,10 +1518,10 @@
link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' )
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.pingTimeout = 400
-
+
main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
main.log.report( "___________________________________________________________________________" )
-
+
linkIndex = range(4)
linkIndexS9 = random.sample(linkIndex,1)[0]
linkIndex.remove(linkIndexS9)
@@ -1624,7 +1624,7 @@
utilities.assert_equals( expect=main.TRUE, actual=caseResult84,
onpass="Link Up Test PASS",
onfail="Link Up Test FAIL" )
-
+
def CASE90( self ):
"""
Install 600 point intents and verify ping all (Att Topology)
@@ -1636,8 +1636,8 @@
main.case( "Install 600 point intents" )
main.step( "Add point Intents" )
intentResult = main.TRUE
- deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
+
intentIdList = []
time1 = time.time()
for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
@@ -1680,7 +1680,7 @@
onfail="PING ALL FAIL" )
case90Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case90Result,
@@ -1698,8 +1698,8 @@
main.case( "Install 600 point intents" )
main.step( "Add point Intents" )
intentResult = main.TRUE
- deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
+
intentIdList = []
time1 = time.time()
for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
@@ -1743,13 +1743,13 @@
onfail="PING ALL FAIL" )
case91Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case91Result,
onpass="Install 600 point Intents and Ping All test PASS",
onfail="Install 600 point Intents and Ping All test FAIL" )
-
+
def CASE92( self ):
"""
Install 4556 point intents and verify ping all (Spine Topology)
@@ -1809,13 +1809,13 @@
onfail="PING ALL FAIL" )
case92Result = ( intentResult and pingResult )
-
+
utilities.assert_equals(
expect=main.TRUE,
actual=case92Result,
onpass="Install 4556 point Intents and Ping All test PASS",
onfail="Install 4556 point Intents and Ping All test FAIL" )
-
+
def CASE93( self ):
"""
Install multi-single point intents and verify Ping all works
@@ -1866,7 +1866,7 @@
checkIntentStateResult = main.ONOScli3.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
checkIntentStateResult = main.ONOScli4.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
checkIntentStateResult = main.ONOScli5.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
-
+
if checkIntentStateResult:
main.log.info( "All intents are installed correctly " )
@@ -1890,7 +1890,7 @@
actual=case93Result,
onpass="Install 25 multi to single point Intents and Ping All test PASS",
onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
-
+
def CASE94( self ):
"""
Install multi-single point intents and verify Ping all works
@@ -1927,7 +1927,7 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
@@ -1946,7 +1946,7 @@
actual=case94Result,
onpass="Install 25 multi to single point Intents and Ping All test PASS",
onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
-
+
#def CASE95 multi-single point intent for Spine
def CASE96( self ):
@@ -1984,7 +1984,7 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
@@ -2039,7 +2039,7 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
@@ -2101,7 +2101,7 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
@@ -2246,13 +2246,13 @@
pool.append(t)
t.start()
threadID = threadID + 1
-
+
results = []
for thread in pool:
thread.join()
results.append(thread.result)
time2 = time.time()
-
+
if( all(result == main.TRUE for result in results) == False):
main.log.info("Did not install onos-app-ifwd feature properly")
#main.cleanup()
@@ -2261,7 +2261,7 @@
main.log.info("Successful feature:install onos-app-ifwd")
installResult = main.TRUE
main.log.info("Time for feature:install onos-app-ifwd: %2f seconds" %(time2-time1))
-
+
main.step( "Verify Pingall" )
ping_result = main.FALSE
time1 = time.time()
@@ -2272,7 +2272,7 @@
"Time taken for Ping All: " +
str( timeDiff ) +
" seconds" )
-
+
if ping_result == main.TRUE:
main.log.report( "Pingall Test in Reactive mode successful" )
else:
@@ -2280,7 +2280,7 @@
main.step( "Disable Intent based Reactive forwarding" )
uninstallResult = main.FALSE
-
+
pool = []
time1 = time.time()
for cli,feature in main.CLIs:
@@ -2289,13 +2289,13 @@
pool.append(t)
t.start()
threadID = threadID + 1
-
+
results = []
for thread in pool:
thread.join()
results.append(thread.result)
time2 = time.time()
-
+
if( all(result == main.TRUE for result in results) == False):
main.log.info("Did not uninstall onos-app-ifwd feature properly")
uninstallResult = main.FALSE
diff --git a/TestON/tests/FUNCintent/Dependency/newFuncTopo.py b/TestON/tests/FUNCintent/Dependency/newFuncTopo.py
index 5552aa9..5edf7f7 100755
--- a/TestON/tests/FUNCintent/Dependency/newFuncTopo.py
+++ b/TestON/tests/FUNCintent/Dependency/newFuncTopo.py
@@ -16,121 +16,121 @@
class VLANHost( Host ):
def config( self, vlan=100, **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- newName = '%s.%d' % ( intf, vlan )
- intf.name = newName
- self.nameToIntf[ newName ] = intf
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ newName = '%s.%d' % ( intf, vlan )
+ intf.name = newName
+ self.nameToIntf[ newName ] = intf
+ return r
class IPv6Host( Host ):
def config( self, v6Addr='1000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class dualStackHost( Host ):
def config( self, v6Addr='2000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class MyTopo( Topo ):
- def __init__( self ):
- # Initialize topology
- Topo.__init__( self )
- # Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ def __init__( self ):
+ # Initialize topology
+ Topo.__init__( self )
+ # Switch S5 Hosts
+ host1=self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ #VLAN hosts
+ host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host6=self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7=self.addHost( 'h7', ip='12.1.0.2/24' )
+ #Multicast Sender
+ host8=self.addHost( 'h8', ip='10.1.0.4/24' )
- # Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ # Switch S6 Hosts
+ host9=self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ #VLAN hosts
+ host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host14=self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15=self.addHost( 'h15', ip='12.1.0.3/24' )
+ #Multicast Receiver
+ host16=self.addHost( 'h16', ip='10.1.0.7/24' )
- # Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ # Switch S7 Hosts
+ host17=self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ #VLAN hosts
+ host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host22=self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23=self.addHost( 'h23', ip='12.1.0.4/24' )
+ #Multicast Receiver
+ host24=self.addHost( 'h24', ip='10.1.0.10/24' )
- s1 = self.addSwitch( 's1' )
- s2 = self.addSwitch( 's2' )
- s3 = self.addSwitch( 's3' )
- s4 = self.addSwitch( 's4' )
- s5 = self.addSwitch( 's5' )
- s6 = self.addSwitch( 's6' )
- s7 = self.addSwitch( 's7' )
+ s1 = self.addSwitch( 's1' )
+ s2 = self.addSwitch( 's2' )
+ s3 = self.addSwitch( 's3' )
+ s4 = self.addSwitch( 's4' )
+ s5 = self.addSwitch( 's5' )
+ s6 = self.addSwitch( 's6' )
+ s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink(s5,host1)
+ self.addLink(s5,host2)
+ self.addLink(s5,host3)
+ self.addLink(s5,host4)
+ self.addLink(s5,host5)
+ self.addLink(s5,host6)
+ self.addLink(s5,host7)
+ self.addLink(s5,host8)
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink(s6,host9)
+ self.addLink(s6,host10)
+ self.addLink(s6,host11)
+ self.addLink(s6,host12)
+ self.addLink(s6,host13)
+ self.addLink(s6,host14)
+ self.addLink(s6,host15)
+ self.addLink(s6,host16)
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink(s7,host17)
+ self.addLink(s7,host18)
+ self.addLink(s7,host19)
+ self.addLink(s7,host20)
+ self.addLink(s7,host21)
+ self.addLink(s7,host22)
+ self.addLink(s7,host23)
+ self.addLink(s7,host24)
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
- self.addLink(s4,s7)
- topos = { 'mytopo': ( lambda: MyTopo() ) }
+ self.addLink(s1,s2)
+ self.addLink(s1,s3)
+ self.addLink(s1,s4)
+ self.addLink(s1,s5)
+ self.addLink(s2,s3)
+ self.addLink(s2,s5)
+ self.addLink(s2,s6)
+ self.addLink(s3,s4)
+ self.addLink(s3,s6)
+ self.addLink(s4,s7)
+ topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
diff --git a/TestON/tests/HAclusterRestart/dependencies/obelisk.py b/TestON/tests/HAclusterRestart/dependencies/obelisk.py
index fb6ccdb..4378a9b 100755
--- a/TestON/tests/HAclusterRestart/dependencies/obelisk.py
+++ b/TestON/tests/HAclusterRestart/dependencies/obelisk.py
@@ -9,9 +9,9 @@
leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
+ rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
-
+
topHost = self.addHost( 'h1' )
leftTopHost = self.addHost('h2')
rightTopHost = self.addHost('h5')
diff --git a/TestON/tests/HAminorityRestart/dependencies/obelisk.py b/TestON/tests/HAminorityRestart/dependencies/obelisk.py
index fb6ccdb..4378a9b 100755
--- a/TestON/tests/HAminorityRestart/dependencies/obelisk.py
+++ b/TestON/tests/HAminorityRestart/dependencies/obelisk.py
@@ -9,9 +9,9 @@
leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
+ rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
-
+
topHost = self.addHost( 'h1' )
leftTopHost = self.addHost('h2')
rightTopHost = self.addHost('h5')
diff --git a/TestON/tests/HAsanity/dependencies/obelisk.py b/TestON/tests/HAsanity/dependencies/obelisk.py
index fb6ccdb..4378a9b 100755
--- a/TestON/tests/HAsanity/dependencies/obelisk.py
+++ b/TestON/tests/HAsanity/dependencies/obelisk.py
@@ -9,9 +9,9 @@
leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
+ rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
-
+
topHost = self.addHost( 'h1' )
leftTopHost = self.addHost('h2')
rightTopHost = self.addHost('h5')
diff --git a/TestON/tests/HAsingleInstanceRestart/dependencies/obelisk.py b/TestON/tests/HAsingleInstanceRestart/dependencies/obelisk.py
index fb6ccdb..4378a9b 100755
--- a/TestON/tests/HAsingleInstanceRestart/dependencies/obelisk.py
+++ b/TestON/tests/HAsingleInstanceRestart/dependencies/obelisk.py
@@ -9,9 +9,9 @@
leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
+ rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
-
+
topHost = self.addHost( 'h1' )
leftTopHost = self.addHost('h2')
rightTopHost = self.addHost('h5')
diff --git a/TestON/tests/SAMPscaleTopo/Dependency/newFuncTopo.py b/TestON/tests/SAMPscaleTopo/Dependency/newFuncTopo.py
index 5552aa9..5edf7f7 100755
--- a/TestON/tests/SAMPscaleTopo/Dependency/newFuncTopo.py
+++ b/TestON/tests/SAMPscaleTopo/Dependency/newFuncTopo.py
@@ -16,121 +16,121 @@
class VLANHost( Host ):
def config( self, vlan=100, **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- newName = '%s.%d' % ( intf, vlan )
- intf.name = newName
- self.nameToIntf[ newName ] = intf
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ newName = '%s.%d' % ( intf, vlan )
+ intf.name = newName
+ self.nameToIntf[ newName ] = intf
+ return r
class IPv6Host( Host ):
def config( self, v6Addr='1000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class dualStackHost( Host ):
def config( self, v6Addr='2000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class MyTopo( Topo ):
- def __init__( self ):
- # Initialize topology
- Topo.__init__( self )
- # Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ def __init__( self ):
+ # Initialize topology
+ Topo.__init__( self )
+ # Switch S5 Hosts
+ host1=self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ #VLAN hosts
+ host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host6=self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7=self.addHost( 'h7', ip='12.1.0.2/24' )
+ #Multicast Sender
+ host8=self.addHost( 'h8', ip='10.1.0.4/24' )
- # Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ # Switch S6 Hosts
+ host9=self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ #VLAN hosts
+ host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host14=self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15=self.addHost( 'h15', ip='12.1.0.3/24' )
+ #Multicast Receiver
+ host16=self.addHost( 'h16', ip='10.1.0.7/24' )
- # Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ # Switch S7 Hosts
+ host17=self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ #VLAN hosts
+ host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host22=self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23=self.addHost( 'h23', ip='12.1.0.4/24' )
+ #Multicast Receiver
+ host24=self.addHost( 'h24', ip='10.1.0.10/24' )
- s1 = self.addSwitch( 's1' )
- s2 = self.addSwitch( 's2' )
- s3 = self.addSwitch( 's3' )
- s4 = self.addSwitch( 's4' )
- s5 = self.addSwitch( 's5' )
- s6 = self.addSwitch( 's6' )
- s7 = self.addSwitch( 's7' )
+ s1 = self.addSwitch( 's1' )
+ s2 = self.addSwitch( 's2' )
+ s3 = self.addSwitch( 's3' )
+ s4 = self.addSwitch( 's4' )
+ s5 = self.addSwitch( 's5' )
+ s6 = self.addSwitch( 's6' )
+ s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink(s5,host1)
+ self.addLink(s5,host2)
+ self.addLink(s5,host3)
+ self.addLink(s5,host4)
+ self.addLink(s5,host5)
+ self.addLink(s5,host6)
+ self.addLink(s5,host7)
+ self.addLink(s5,host8)
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink(s6,host9)
+ self.addLink(s6,host10)
+ self.addLink(s6,host11)
+ self.addLink(s6,host12)
+ self.addLink(s6,host13)
+ self.addLink(s6,host14)
+ self.addLink(s6,host15)
+ self.addLink(s6,host16)
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink(s7,host17)
+ self.addLink(s7,host18)
+ self.addLink(s7,host19)
+ self.addLink(s7,host20)
+ self.addLink(s7,host21)
+ self.addLink(s7,host22)
+ self.addLink(s7,host23)
+ self.addLink(s7,host24)
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
- self.addLink(s4,s7)
- topos = { 'mytopo': ( lambda: MyTopo() ) }
+ self.addLink(s1,s2)
+ self.addLink(s1,s3)
+ self.addLink(s1,s4)
+ self.addLink(s1,s5)
+ self.addLink(s2,s3)
+ self.addLink(s2,s5)
+ self.addLink(s2,s6)
+ self.addLink(s3,s4)
+ self.addLink(s3,s6)
+ self.addLink(s4,s7)
+ topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
diff --git a/TestON/tests/SAMPstartTemplate/Dependency/newFuncTopo.py b/TestON/tests/SAMPstartTemplate/Dependency/newFuncTopo.py
index 57ad42f..7fe68c1 100755
--- a/TestON/tests/SAMPstartTemplate/Dependency/newFuncTopo.py
+++ b/TestON/tests/SAMPstartTemplate/Dependency/newFuncTopo.py
@@ -16,125 +16,125 @@
class VLANHost( Host ):
def config( self, vlan=100, **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- newName = '%s.%d' % ( intf, vlan )
- intf.name = newName
- self.nameToIntf[ newName ] = intf
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ newName = '%s.%d' % ( intf, vlan )
+ intf.name = newName
+ self.nameToIntf[ newName ] = intf
+ return r
class IPv6Host( Host ):
def config( self, v6Addr='1000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ifconfig %s inet 0' % intf )
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ifconfig %s inet 0' % intf )
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class dualStackHost( Host ):
def config( self, v6Addr='2000:1/64', **params ):
- r = super( Host, self ).config( **params )
- intf = self.defaultIntf()
- self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
- return r
+ r = super( Host, self ).config( **params )
+ intf = self.defaultIntf()
+ self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
+ return r
class MyTopo( Topo ):
- def __init__( self ):
- # Initialize topology
- Topo.__init__( self )
-
- # Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ def __init__( self ):
+ # Initialize topology
+ Topo.__init__( self )
- # Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ # Switch S5 Hosts
+ host1=self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ #VLAN hosts
+ host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host6=self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7=self.addHost( 'h7', ip='12.1.0.2/24' )
+ #Multicast Sender
+ host8=self.addHost( 'h8', ip='10.1.0.4/24' )
- # Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ # Switch S6 Hosts
+ host9=self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ #VLAN hosts
+ host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host14=self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15=self.addHost( 'h15', ip='12.1.0.3/24' )
+ #Multicast Receiver
+ host16=self.addHost( 'h16', ip='10.1.0.7/24' )
- s1 = self.addSwitch( 's1' )
- s2 = self.addSwitch( 's2' )
- s3 = self.addSwitch( 's3' )
- s4 = self.addSwitch( 's4' )
- s5 = self.addSwitch( 's5' )
- s6 = self.addSwitch( 's6' )
- s7 = self.addSwitch( 's7' )
-
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ # Switch S7 Hosts
+ host17=self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ #VLAN hosts
+ host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ #VPN-1 and VPN-2 Hosts
+ host22=self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23=self.addHost( 'h23', ip='12.1.0.4/24' )
+ #Multicast Receiver
+ host24=self.addHost( 'h24', ip='10.1.0.10/24' )
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ s1 = self.addSwitch( 's1' )
+ s2 = self.addSwitch( 's2' )
+ s3 = self.addSwitch( 's3' )
+ s4 = self.addSwitch( 's4' )
+ s5 = self.addSwitch( 's5' )
+ s6 = self.addSwitch( 's6' )
+ s7 = self.addSwitch( 's7' )
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink(s5,host1)
+ self.addLink(s5,host2)
+ self.addLink(s5,host3)
+ self.addLink(s5,host4)
+ self.addLink(s5,host5)
+ self.addLink(s5,host6)
+ self.addLink(s5,host7)
+ self.addLink(s5,host8)
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
-
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
+ self.addLink(s6,host9)
+ self.addLink(s6,host10)
+ self.addLink(s6,host11)
+ self.addLink(s6,host12)
+ self.addLink(s6,host13)
+ self.addLink(s6,host14)
+ self.addLink(s6,host15)
+ self.addLink(s6,host16)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
-
- self.addLink(s4,s7)
- topos = { 'mytopo': ( lambda: MyTopo() ) }
+ self.addLink(s7,host17)
+ self.addLink(s7,host18)
+ self.addLink(s7,host19)
+ self.addLink(s7,host20)
+ self.addLink(s7,host21)
+ self.addLink(s7,host22)
+ self.addLink(s7,host23)
+ self.addLink(s7,host24)
+
+ self.addLink(s1,s2)
+ self.addLink(s1,s3)
+ self.addLink(s1,s4)
+ self.addLink(s1,s5)
+
+ self.addLink(s2,s3)
+ self.addLink(s2,s5)
+ self.addLink(s2,s6)
+
+ self.addLink(s3,s4)
+ self.addLink(s3,s6)
+
+ self.addLink(s4,s7)
+ topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
diff --git a/TestON/tests/SCPFcbench/SCPFcbench.py b/TestON/tests/SCPFcbench/SCPFcbench.py
index fd15862..647bf52 100644
--- a/TestON/tests/SCPFcbench/SCPFcbench.py
+++ b/TestON/tests/SCPFcbench/SCPFcbench.py
@@ -14,19 +14,19 @@
def __init__( self ):
self.default = ''
- def CASE1( self, main ):
-
- import time
- import os
- global init
+ def CASE1( self, main ):
+
+ import time
+ import os
+ global init
main.case("pre-condition for cbench test.")
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
#Load values from params file
checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
gitPull = main.params[ 'GIT' ][ 'autopull' ]
@@ -36,25 +36,25 @@
MN1Ip = os.environ[ main.params[ 'MN' ][ 'ip1' ] ]
maxNodes = int(main.params[ 'availableNodes' ])
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
- global scale
-
+ global scale
+
clusterCount = 0
ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
- #Populate ONOSIp with ips from params
- for i in range(1, maxNodes + 1):
+ #Populate ONOSIp with ips from params
+ for i in range(1, maxNodes + 1):
ipString = os.environ[main.params['CTRL']['ip1']]
- ONOSIp.append(ipString)
-
+ ONOSIp.append(ipString)
+
#mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
if skipMvn != "yes":
mvnResult = main.ONOSbench.cleanInstall()
@@ -69,46 +69,46 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
# -- END OF INIT SECTION --#
-
+
clusterCount = int(scale[0])
- scale.remove(scale[0])
-
- #kill off all onos processes
+ scale.remove(scale[0])
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(1, maxNodes + 1):
main.ONOSbench.onosDie(ONOSIp[node])
-
+
#Uninstall everywhere
main.log.step( "Cleaning Enviornment..." )
for i in range(1, maxNodes + 1):
main.log.info(" Uninstalling ONOS " + str(i) )
main.ONOSbench.onosUninstall( ONOSIp[i] )
-
+
time.sleep(10)
main.ONOSbench.handle.sendline(" ")
main.ONOSbench.handle.expect(":~")
- print "pexpect: \n" + main.ONOSbench.handle.before
+ print "pexpect: \n" + main.ONOSbench.handle.before
print "Cellname is: "+ cellName + "ONOS IP is: " + str(ONOSIp)
main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,"drivers,openflow,fwd",[ONOSIp[1]])
-
+
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
- #main.ONOSbench.handle.sendline(" ")
- #main.ONOSbench.handle.expect(":~")
- #print "pexpect: \n" + main.ONOSbench.handle.before
+ #main.ONOSbench.handle.sendline(" ")
+ #main.ONOSbench.handle.expect(":~")
+ #print "pexpect: \n" + main.ONOSbench.handle.before
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.log.report( "Initializing " + str( clusterCount ) + " node cluster." )
for node in range(1, clusterCount + 1):
main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
@@ -124,53 +124,53 @@
main.log.report( "ONOS " + str(node) + " didn't start!" )
main.log.info("Startup sequence complete")
- for i in range(5):
+ for i in range(5):
main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.fwd.ReactiveForwarding","packetOutOnly true")
time.sleep(5)
- main.ONOSbench.handle.sendline("onos $OC1 cfg get|grep packetOutOnly")
- main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.sendline("onos $OC1 cfg get|grep packetOutOnly")
+ main.ONOSbench.handle.expect(":~")
check = main.ONOSbench.handle.before
if "value=true" in check:
- main.log.info("cfg set successful")
+ main.log.info("cfg set successful")
stepResult = main.TRUE
- break
- if i == 4:
+ break
+ if i == 4:
main.log.info("Cfg set failed")
stepResult = main.FALSE
- else:
+ else:
time.sleep(5)
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully configure onos for cbench test ",
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully configure onos for cbench test ",
onfail="Failed to configure onos for cbench test" )
-
-
-
+
+
+
def CASE2( self, main ):
main.case("Running Cbench")
main.step("Issuing cbench commands and grab returned results")
validFlag = False
mode = main.params[ 'TEST' ][ 'mode' ]
if mode != "t":
- mode = " "
+ mode = " "
runCbench = ( "ssh " + CBENCHuser + "@" + ONOSIp[1] + " cbench -c localhost -p 6633 -m 1000 -l 25 -s 16 -M 100000 -w 15 -D 10000 -" + mode )
main.ONOSbench.handle.sendline(runCbench)
time.sleep(30)
- main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.expect(":~")
output = main.ONOSbench.handle.before
main.log.info(output)
output = output.splitlines()
- for line in output:
+ for line in output:
if "RESULT: " in line:
validFlag = True
print line
- resultLine = line.split(" ")
+ resultLine = line.split(" ")
for word in resultLine:
- if word == "min/max/avg/stdev":
+ if word == "min/max/avg/stdev":
resultsIndex = resultLine.index(word)
print resultsIndex
break
@@ -180,27 +180,27 @@
finalDataList = finalDataString.split("/")
avg = finalDataList[2]
stdev = finalDataList[3]
-
- main.log.info("Average: \t\t\t" + avg)
- main.log.info("Standard Deviation: \t" + stdev)
-
+
+ main.log.info("Average: \t\t\t" + avg)
+ main.log.info("Standard Deviation: \t" + stdev)
+
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
try:
dbFileName="/tmp/CbenchDB"
- dbfile = open(dbFileName, "w+")
- temp = "'" + commit + "',"
- temp += "'" + mode + "',"
+ dbfile = open(dbFileName, "w+")
+ temp = "'" + commit + "',"
+ temp += "'" + mode + "',"
temp += "'" + avg + "',"
- temp += "'" + stdev + "'\n"
+ temp += "'" + stdev + "'\n"
dbfile.write(temp)
dbfile.close()
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
except IOError:
main.log.warn("Error opening " + dbFileName + " to write results.")
-
+
stepResult = main.TRUE
break
if ( validFlag == False ):
diff --git a/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.params b/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.params
index 25a7b5c..76e05ba 100644
--- a/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.params
+++ b/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.params
@@ -2,7 +2,6 @@
<testcases>1,2,1,2,1,2,1,2,1,2,1,2,1,2</testcases>
- <isOnBaremetal>True</isOnBaremetal>
<SCALE>1,3,3,5,5,7,7</SCALE>
<max>7</max>
diff --git a/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.py b/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.py
index 3c1805a..525fe74 100644
--- a/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.py
+++ b/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.py
@@ -13,7 +13,7 @@
def __init__( self ):
self.default = ''
- def CASE1( self, main ):
+ def CASE1( self, main ):
import time
global init
@@ -32,8 +32,8 @@
BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
main.maxNodes = int(main.params[ 'max' ])
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+
main.log.info("==========DEBUG VERSION 3===========")
# -- INIT SECTION, ONLY RUNS ONCE -- #
@@ -71,7 +71,7 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
@@ -84,7 +84,7 @@
scale.remove(scale[0])
main.log.info("CLUSTER COUNT: " + str(clusterCount))
- #kill off all onos processes
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(1, main.maxNodes + 1):
@@ -100,16 +100,16 @@
main.log.info("Creating cell file")
cellIp = []
for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
-
+ cellIp.append(ONOSIp[node])
+
main.ONOSbench.createCellFile(BENCHIp,cellName,"localhost",str(Apps), cellIp)
main.log.info("Cell Ip list: " + str(cellIp))
-
+
main.step( "Set Cell" )
- main.ONOSbench.setCell(cellName)
-
+ main.ONOSbench.setCell(cellName)
+
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
@@ -127,21 +127,21 @@
break
if not isup:
main.log.report( "ONOS " + str(node) + " didn't start!" )
-
+
for node in range(1, clusterCount + 1):
exec "a = main.ONOS%scli.startOnosCli" %str(node)
a(ONOSIp[node])
-
+
main.log.info("Startup sequence complete")
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
def CASE2( self, main ):
#
- # This is the flow TP test
+ # This is the flow TP test
#
- import os.path
- import numpy
+ import os.path
+ import numpy
import math
- import time
+ import time
import datetime
import traceback
@@ -164,7 +164,6 @@
testCMD[0] = main.params[ 'TEST' ][ 'testCMD0' ]
testCMD[1] = main.params[ 'TEST' ][ 'testCMD1' ]
main.maxNodes = main.params[ 'max' ]
- onBaremetal = main.params['isOnBaremetal']
cooldown = main.params[ 'TEST' ][ 'cooldown' ]
cellName = main.params[ 'ENV' ][ 'cellName' ]
BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
@@ -174,9 +173,9 @@
flowRuleBackup = str(main.params[ 'TEST' ][ 'enableFlowRuleStoreBackup' ])
main.log.info("Flow Rule Backup is set to:" + flowRuleBackup)
- servers = str(clusterCount)
-
- if clusterCount == 1:
+ servers = str(clusterCount)
+
+ if clusterCount == 1:
neighborList = ['0']
currentNeighbors = "r"
else:
@@ -184,45 +183,41 @@
neighborList = [str(clusterCount-1)]
currentNeighbors = "r"
else:
- neighborList = ['0']
+ neighborList = ['0']
main.log.info("neightborlist: " + str(neighborList))
ts = time.time()
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
- #write file to change mem limit to 32 gigs (BAREMETAL ONLY!)
- if onBaremetal == "true":
- main.ONOSbench.jvmSet()
-
for n in neighborList:
main.log.step("\tSTARTING TEST")
- main.log.step("\tLOADING FROM SERVERS: \t" + str(clusterCount) )
- main.log.step("\tNEIGHBORS:\t" + n )
+ main.log.step("\tLOADING FROM SERVERS: \t" + str(clusterCount) )
+ main.log.step("\tNEIGHBORS:\t" + n )
main.log.info("=============================================================")
main.log.info("=============================================================")
#write file to configure nil link
ipCSV = ""
for i in range (1, int(main.maxNodes) + 1):
tempstr = "ip" + str(i)
- ipCSV += main.params[ 'CTRL' ][ tempstr ]
+ ipCSV += main.params[ 'CTRL' ][ tempstr ]
if i < int(main.maxNodes):
ipCSV +=","
-
+
for i in range(3):
main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "deviceCount 35")
main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
- main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
+ main.ONOSbench.onosCfgSet(ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
time.sleep(5)
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
check = main.ONOSbench.handle.before
- main.log.info("\nStart up check: \n" + check + "\n")
- if "SCC(s)=1," in check:
- break
+ main.log.info("\nStart up check: \n" + check + "\n")
+ if "SCC(s)=1," in check:
+ break
time.sleep(5)
-
+
#devide flows
flows = int(main.params[ 'TEST' ][ 'flows' ])
main.log.info("Flow Target = " + str(flows))
@@ -235,99 +230,99 @@
serverEnvVars = ""
for i in range (1,int(servers)+1):
serverEnvVars += ("-s " + ONOSIp[i] + " ")
-
+
data = [[""]*int(servers)]*int(sampleSize)
maxes = [""]*int(sampleSize)
flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1]
- flowCMD += " " + str(n) + " " + str(serverEnvVars) + "-j"
+ flowCMD += " " + str(n) + " " + str(serverEnvVars) + "-j"
main.log.info(flowCMD)
#time.sleep(60)
-
- for test in range(0, warmUp + sampleSize):
- if test < warmUp:
+
+ for test in range(0, warmUp + sampleSize):
+ if test < warmUp:
main.log.info("Warm up " + str(test + 1) + " of " + str(warmUp))
- else:
- main.log.info("====== Test run: " + str(test-warmUp+1) + " ======")
+ else:
+ main.log.info("====== Test run: " + str(test-warmUp+1) + " ======")
main.ONOSbench.handle.sendline(flowCMD)
main.ONOSbench.handle.expect(":~")
rawResult = main.ONOSbench.handle.before
main.log.info("Raw results: \n" + rawResult + "\n")
- if "failed" in rawResult:
+ if "failed" in rawResult:
main.log.report("FLOW_TESTER.PY FAILURE")
main.log.report( " \n" + rawResult + " \n")
for i in range(clusterCount):
main.log.report("=======================================================")
- main.log.report(" ONOS " + str(i) + "LOG REPORT")
+ main.log.report(" ONOS " + str(i) + "LOG REPORT")
main.ONOSbench.logReport(ONOSIp[i], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
- main.ONOSbench.handle.sendline("onos $OC1 flows")
- main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.sendline("onos $OC1 flows")
+ main.ONOSbench.handle.expect(":~")
main.log.info(main.ONOSbench.handle.before)
break
-
+
########################################################################################
result = [""]*(clusterCount)
-
+
#print("rawResult: " + rawResult)
rawResult = rawResult.splitlines()
- for node in range(1, clusterCount + 1):
+ for node in range(1, clusterCount + 1):
for line in rawResult:
- #print("line: " + line)
+ #print("line: " + line)
if ONOSIp[node] in line and "server" in line:
- temp = line.split(" ")
+ temp = line.split(" ")
for word in temp:
- #print ("word: " + word)
- if "elapsed" in repr(word):
+ #print ("word: " + word)
+ if "elapsed" in repr(word):
index = temp.index(word) + 1
myParsed = (temp[index]).replace(",","")
myParsed = myParsed.replace("}","")
myParsed = int(myParsed)
result[node-1] = myParsed
main.log.info( ONOSIp[node] + " : " + str(myParsed))
- break
+ break
if test >= warmUp:
- for i in result:
- if i == "":
+ for i in result:
+ if i == "":
main.log.error("Missing data point, critical failure incoming")
print result
maxes[test-warmUp] = max(result)
main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize))
- main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")
+ main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")
data[test-warmUp] = result
- # wait for flows = 0
- for checkCount in range(0,5):
+ # wait for flows = 0
+ for checkCount in range(0,5):
time.sleep(10)
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
flowCheck = main.ONOSbench.handle.before
- if "flows=0," in flowCheck:
+ if "flows=0," in flowCheck:
main.log.info("Flows removed")
break
- else:
- for line in flowCheck.splitlines():
- if "flows=" in line:
- main.log.info("Current Summary: " + line)
- if checkCount == 2:
+ else:
+ for line in flowCheck.splitlines():
+ if "flows=" in line:
+ main.log.info("Current Summary: " + line)
+ if checkCount == 2:
main.log.info("Flows are stuck, moving on ")
time.sleep(5)
-
+
main.log.info("raw data: " + str(data))
main.log.info("maxes:" + str(maxes))
-
+
# report data
print("")
main.log.info("\t Results (measurments are in milliseconds)")
@@ -335,16 +330,16 @@
nodeString = ""
for i in range(1, int(servers) + 1):
- nodeString += ("\tNode " + str(i))
-
+ nodeString += ("\tNode " + str(i))
+
for test in range(0, sampleSize ):
main.log.info("\t Test iteration " + str(test + 1) )
main.log.info("\t------------------")
- main.log.info(nodeString)
+ main.log.info(nodeString)
resultString = ""
for i in range(0, int(servers) ):
- resultString += ("\t" + str(data[test][i]) )
+ resultString += ("\t" + str(data[test][i]) )
main.log.info(resultString)
print("\n")
@@ -353,19 +348,19 @@
main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes))
stdOfMaxes = numpy.std(maxes)
- main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))
+ main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))
print("\n\n")
avgTP = int(main.params[ 'TEST' ][ 'flows' ]) / avgOfMaxes #result in kflows/second
-
+
tp = []
- for i in maxes:
+ for i in maxes:
tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i ))
stdTP = numpy.std(tp)
main.log.info("Average thoughput: " + str(avgTP) + " Kflows/second" )
- main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second")
+ main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second")
resultsLog = open("/tmp/flowTP1gDB","a")
resultString = ("'" + commit + "',")
@@ -374,9 +369,9 @@
resultString += (str(clusterCount) + ",")
resultString += (str(n) + ",")
resultString += (str(avgTP) + "," + str(stdTP) + "\n")
- resultsLog.write(resultString)
+ resultsLog.write(resultString)
resultsLog.close()
-
+
main.log.report("Result line to file: " + resultString)
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
+
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
diff --git a/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.topo b/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.topo
index 01370b6..2810f55 100644
--- a/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.topo
+++ b/TestON/tests/SCPFflowTp1g/SCPFflowTp1g.topo
@@ -112,7 +112,6 @@
<connect_order>12</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOS4>
-
<ONOS5>
<host>OC5</host>
diff --git a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.params b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.params
index d1689de..cbd8a8d 100644
--- a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.params
+++ b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.params
@@ -2,7 +2,6 @@
<testcases>1,2,1,2,1,2,1,2,1,2,1,2,1,2</testcases>
- <isOnBaremetal></isOnBaremetal>
<debugMode></debugMode> #nothing means false
<ENV>
diff --git a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
index 06fc028..fb3f7db 100644
--- a/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
@@ -35,24 +35,23 @@
BENCHUser = main.params[ 'BENCH' ][ 'user' ]
MN1Ip = main.params[ 'MN' ][ 'ip1' ]
maxNodes = int(main.params[ 'max' ])
- main.maxNodes = maxNodes
+ main.maxNodes = maxNodes
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
cellName = main.params[ 'ENV' ][ 'cellName' ]
numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
flowRuleBU = main.params[ 'TEST' ][ 'flowRuleBUEnabled' ]
- onBaremetal = main.params['isOnBaremetal']
homeDir = os.path.expanduser('~')
main.exceptions = [0]*11
main.warnings = [0]*11
main.errors = [0]*11
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
- global scale
+ global scale
global commit
clusterCount = 0
@@ -60,10 +59,10 @@
print ONOSIp
print main.ONOSbench.onosIps.values()
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
- #Populate ONOSIp with ips from params
+ #Populate ONOSIp with ips from params
ONOSIp.extend(main.ONOSbench.getOnosIps())
#mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
@@ -81,31 +80,31 @@
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
- main.log.step("Grabbing commit number")
+ main.log.step("Grabbing commit number")
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
-
- main.log.step("Creating results file")
+
+ main.log.step("Creating results file")
resultsDB = open("/tmp/IntentEventTPDB", "w+")
resultsDB.close()
# -- END OF INIT SECTION --#
- main.log.step("Adjusting scale")
- print str(scale)
+ main.log.step("Adjusting scale")
+ print str(scale)
print str(ONOSIp)
clusterCount = int(scale[0])
- scale.remove(scale[0])
-
+ scale.remove(scale[0])
+
MN1Ip = ONOSIp[len(ONOSIp) -1]
BENCHIp = ONOSIp[len(ONOSIp) -2]
-
- #kill off all onos processes
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(maxNodes):
main.ONOSbench.onosDie(ONOSIp[node])
-
+
MN1Ip = ONOSIp[len(ONOSIp) -1]
BENCHIp = ONOSIp[len(ONOSIp) -2]
@@ -118,13 +117,13 @@
time.sleep(10)
main.ONOSbench.handle.sendline(" ")
main.ONOSbench.handle.expect(":~")
-
+
#construct the cell file
main.log.info("Creating cell file")
cellIp = []
for node in range (clusterCount):
cellIp.append(ONOSIp[node])
-
+
main.ONOSbench.createCellFile("localhost",cellName,MN1Ip,str(Apps), cellIp)
main.step( "Set Cell" )
@@ -134,31 +133,12 @@
for node in range (clusterCount):
myDistribution.append(numSwitches[node])
- #main.ONOSbench.createLinkGraphFile( BENCHIp,cellIp,myDistribution)
-
- if onBaremetal == "True":
- filename = "/onos/tools/package/bin/onos-service"
- serviceConfig = open(homeDir + filename, 'w+')
- serviceConfig.write("#!/bin/bash\n ")
- serviceConfig.write("#------------------------------------- \n ")
- serviceConfig.write("# Starts ONOS Apache Karaf container\n ")
- serviceConfig.write("#------------------------------------- \n ")
- serviceConfig.write("#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}\n ")
- serviceConfig.write("""export JAVA_OPTS="${JAVA_OPTS:--Xms8G -Xmx8G}" \n """)
- serviceConfig.write("")
- serviceConfig.write("ONOS_HOME=/opt/onos \n ")
- serviceConfig.write("")
- serviceConfig.write("[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..\n")
- serviceConfig.write("""${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@" \n """)
- serviceConfig.close()
- main.log.info("Set /onos/tools/package/bin/onos-service with 8G Xms/Xmx Options.")
-
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
for node in range(clusterCount):
main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
@@ -178,9 +158,11 @@
main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled false")
+ devices = int(clusterCount)*10
+
main.log.step("Setting up null provider")
for i in range(3):
- main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "deviceCount 8")
+ main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "deviceCount " + str(devices))
main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "enabled true")
time.sleep(5)
@@ -189,7 +171,7 @@
main.ONOSbench.handle.expect(":~")
before = main.ONOSbench.handle.before
- if "devices=8" in before and "links=14" in before:
+ if ("devices=" + str(devices)) in before:
break
main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
@@ -206,7 +188,7 @@
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
-
+
main.log.info("before" + main.ONOSbench.handle.before)
clusterCheck = main.ONOSbench.handle.before
print("\nBefore: " + str(clusterCheck))
@@ -224,7 +206,7 @@
lastOutput = clusterCheck
time.sleep(5)
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
- def CASE2( self, main ):
+ def CASE2( self, main ):
import time
import json
import string
@@ -245,7 +227,7 @@
currentNeighbors = "a"
neighbors = ['0']
else:
- currentNeighbors = "r"
+ currentNeighbors = "r"
neighbors = ['a']
if clusterCount == 1:
@@ -261,21 +243,21 @@
debug = main.params[ 'debugMode' ]
numKeys = main.params[ 'TEST' ][ 'numKeys' ]
cyclePeriod = main.params[ 'TEST' ][ 'cyclePeriod' ]
- #neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
+ #neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
metricList = [intentsRate, intentsWithdrawn, intentsFailed]
- for n in range(0, len(neighbors)):
- if neighbors[n] == 'a':
+ for n in range(0, len(neighbors)):
+ if neighbors[n] == 'a':
neighbors[n] = str(clusterCount -1)
if int(clusterCount) == 1:
neighbors = neighbors.pop()
-
+
for n in neighbors:
- main.log.info("Run with " + n + " neighbors")
+ main.log.info("Run with " + n + " neighbors")
time.sleep(5)
main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numKeys " + numKeys )
main.ONOSbench.handle.expect(":~")
- main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numNeighbors " + n )
+ main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numNeighbors " + n )
main.ONOSbench.handle.expect(":~")
main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller cyclePeriod " + cyclePeriod )
main.ONOSbench.handle.expect(":~")
@@ -339,9 +321,9 @@
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
main.log.info("Stopping intentperf" )
-
+
resultsDB = open("/tmp/IntentEventTPDB", "a")
- for node in groupResult:
+ for node in groupResult:
resultString = "'" + commit + "',"
resultString += "'1gig',"
@@ -351,8 +333,8 @@
resultString += str(node) + ","
resultString += str(0) + "\n" #no stddev
resultsDB.write(resultString)
-
- resultsDB.close()
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+
+ resultsDB.close()
+
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
diff --git a/TestON/tests/SCPFintentEventTp/temp b/TestON/tests/SCPFintentEventTp/temp
new file mode 100644
index 0000000..01370b6
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTp/temp
@@ -0,0 +1,147 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ <home>~/onos</home>
+ <nodes>7</nodes>
+ </COMPONENTS>
+ </ONOSbench>
+
+ <ONOS1cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1cli>
+
+ <ONOS2cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2cli>
+
+ <ONOS3cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3cli>
+
+ <ONOS4cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>5</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4cli>
+
+ <ONOS5cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>6</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5cli>
+
+ <ONOS6cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>7</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6cli>
+
+ <ONOS7cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>8</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7cli>
+
+ <ONOS1>
+ <host>OC1</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>9</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1>
+
+ <ONOS2>
+ <host>OC2</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>10</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2>
+
+ <ONOS3>
+ <host>OC3</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>11</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3>
+
+ <ONOS4>
+ <host>OC4</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>12</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4>
+
+
+ <ONOS5>
+ <host>OC5</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>13</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5>
+
+ <ONOS6>
+ <host>OC6</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>14</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6>
+
+ <ONOS7>
+ <host>OC7</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>15</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7>
+
+ </COMPONENT>
+
+</TOPOLOGY>
+
diff --git a/TestON/tests/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py b/TestON/tests/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
index ef92e58..582afb7 100644
--- a/TestON/tests/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
+++ b/TestON/tests/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
@@ -13,16 +13,16 @@
def __init__( self ):
self.default = ''
- def CASE1( self, main ):
-
- import time
- global init
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
+ def CASE1( self, main ):
+
+ import time
+ global init
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
#Load values from params file
checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
gitPull = main.params[ 'GIT' ][ 'autopull' ]
@@ -33,23 +33,23 @@
MN1Ip = main.params[ 'MN' ][ 'ip1' ]
main.maxNodes = int(main.params[ 'max' ])
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
switchCount = main.params[ 'TEST' ][ 'switchCount' ]
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
- global scale
- global commit
-
+ global scale
+ global commit
+
clusterCount = 0
ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
- #Populate ONOSIp with ips from params
+ #Populate ONOSIp with ips from params
ONOSIp = [0]
ONOSIp.extend(main.ONOSbench.getOnosIps())
@@ -67,7 +67,7 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
@@ -75,22 +75,22 @@
resultsDB.close()
# -- END OF INIT SECTION --#
-
- clusterCount = int(scale[0])
- scale.remove(scale[0])
- #kill off all onos processes
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(1, main.maxNodes + 1):
main.ONOSbench.onosDie(ONOSIp[node])
-
+
#Uninstall everywhere
main.log.step( "Cleaning Enviornment..." )
for i in range(1, main.maxNodes + 1):
main.log.info(" Uninstalling ONOS " + str(i) )
main.ONOSbench.onosUninstall( ONOSIp[i] )
-
+
#construct the cell file
main.log.info("Creating cell file")
cellIp = []
@@ -101,13 +101,13 @@
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
-
+
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
for node in range(1, clusterCount + 1):
main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
@@ -124,24 +124,24 @@
main.ONOS1cli.startOnosCli( ONOSIp[1] )
main.log.info("Startup sequence complete")
-
+
time.sleep(30)
-
+
for i in range(3):
- main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", ("deviceCount " + str(switchCount)) )
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", ("deviceCount " + str(switchCount)) )
main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
if main.ONOSbench.verifySummary(ONOSIp[1], switchCount):
break
- else:
- print "Failed- looping"
+ else:
+ print "Failed- looping"
main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
main.ONOSbench.handle.expect(":~")
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
def CASE2( self, main ):
-
+
import time
import numpy
@@ -169,18 +169,18 @@
time.sleep(2)
links = "--"
- for i in range(8):
+ for i in range(8):
if debug: main.log.info("top of loop")
main.ONOSbench.handle.sendline("onos $OC1 links")
main.ONOSbench.handle.expect(":~")
links = main.ONOSbench.handle.before
if "=null:" in links:
- break
+ break
if debug: main.log.info(str(links))
- if i > 3:
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
- if i == 7:
- main.log.error("link data missing")
+ if i > 3:
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
+ if i == 7:
+ main.log.error("link data missing")
time.sleep(3)
links = links.splitlines()
@@ -236,21 +236,21 @@
if "withdraw" in line:
withdrawn.append(int(line.split(" ")[5]))
- for line in myRawResult:
- if "Failure:" in line:
+ for line in myRawResult:
+ if "Failure:" in line:
main.log.error("INTENT TEST FAILURE, ABORTING TESTCASE")
testStatus = "fail"
- if testStatus == "fail":
- break
-
+ if testStatus == "fail":
+ break
+
print("installed: " + str(installed))
print("withraw: " + str(withdrawn) + "\n")
- if withdrawn[len(withdrawn) -1] > 1000 or installed[len(installed) -1] > 1000:
+ if withdrawn[len(withdrawn) -1] > 1000 or installed[len(installed) -1] > 1000:
main.log.info("ABNORMAL VALUE, CHECKING LOG")
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
- if testStatus == "fail":
- break
+ if testStatus == "fail":
+ break
main.log.report("----------------------------------------------------")
main.log.report("Scale: " + str(clusterCount) + "\tIntent batch size: " + str(intentSize))
main.log.report("Data samples: " + str(sampleSize) + "\tWarm up tests: " + str(warmUp))
diff --git a/TestON/tests/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index 07871f9..3b74dcf 100644
--- a/TestON/tests/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -36,20 +36,20 @@
skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
cellName = main.params[ 'ENV' ][ 'cellName' ]
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
init = True
global clusterCount #number of nodes running
global ONOSIp #list of ONOS IP addresses
- global scale
+ global scale
global commit
clusterCount = 0
ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
+ scale = (main.params[ 'SCALE' ]).split(",")
clusterCount = int(scale[0])
- #Populate ONOSIp with ips from params
+ #Populate ONOSIp with ips from params
ONOSIp = [0]
ONOSIp.extend(main.ONOSbench.getOnosIps())
@@ -68,7 +68,7 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
+
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
@@ -76,22 +76,22 @@
resultsDB.close()
# -- END OF INIT SECTION --#
-
+
clusterCount = int(scale[0])
- scale.remove(scale[0])
-
- #kill off all onos processes
+ scale.remove(scale[0])
+
+ #kill off all onos processes
main.log.step("Safety check, killing all ONOS processes")
main.log.step("before initiating enviornment setup")
for node in range(1, main.maxNodes + 1):
main.ONOSbench.onosDie(ONOSIp[node])
-
+
#Uninstall everywhere
main.log.step( "Cleaning Enviornment..." )
for i in range(1, main.maxNodes + 1):
main.log.info(" Uninstalling ONOS " + str(i) )
main.ONOSbench.onosUninstall( ONOSIp[i] )
-
+
#construct the cell file
main.log.info("Creating cell file")
cellIp = []
@@ -102,13 +102,13 @@
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
-
+
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage()
main.step( "verify cells" )
verifyCellResult = main.ONOSbench.verifyCell()
-
+
main.log.report( "Initializing " + str( clusterCount ) + " node cluster." )
for node in range(1, clusterCount + 1):
main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
@@ -123,7 +123,7 @@
if not isup:
main.log.report( "ONOS " + str(node) + " didn't start!" )
main.log.info("Startup sequence complete")
-
+
deviceMastership = (main.params[ 'TEST' ][ "s" + str(clusterCount) ]).split(",")
print("Device mastership list: " + str(deviceMastership))
@@ -149,9 +149,9 @@
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
time.sleep(4)
-
- cmd = ( "onos $OC" + node + " roles|grep 00000" + str(index))
- main.log.info(cmd)
+
+ cmd = ( "onos $OC" + node + " roles|grep 00000" + str(index))
+ main.log.info(cmd)
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
check = main.ONOSbench.handle.before
@@ -163,7 +163,7 @@
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
def CASE2( self, main ):
-
+
import time
import numpy
import datetime
@@ -233,7 +233,7 @@
#main.ONOSbench.logReport(ONOSIp[(clusterCount-1)], ["ERROR", "WARNING", "EXCEPT"], "d")
main.ONOSbench.sendline("onos $OC1 summary")
main.ONOSbench.sendline("onos $OC1 devices")
- main.ONOSbench.sendline("onos $OC1 links")
+ main.ONOSbench.sendline("onos $OC1 links")
main.ONOSbench.expect(":~")
main.log.info(main.ONOSbench.before)
@@ -265,7 +265,7 @@
break
cutTimestamp = (temp.split(" "))[0] + " " + (temp.split(" "))[1]
- if debug: main.log.info("Cut timestamp: " + cutTimestamp)
+ if debug: main.log.info("Cut timestamp: " + cutTimestamp)
#validate link count and flow count
for i in range(0, 40):
@@ -279,7 +279,7 @@
main.log.error("Link or flow count incorrect, data invalid." + linkCheck)
main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
- time.sleep(5) #trying to avoid negative values
+ time.sleep(5) #trying to avoid negative values
#intents events metrics installed timestamp
IEMtimestamps = [0]*(clusterCount + 1)
@@ -340,12 +340,12 @@
if debug: main.log.info(cmd)
main.ONOSbench.handle.sendline(cmd)
main.ONOSbench.handle.expect(":~")
-
+
#wait for intent withdraw
main.ONOSbench.handle.sendline(withdrawCmd)
- main.log.info(withdrawCmd)
+ main.log.info(withdrawCmd)
main.ONOSbench.handle.expect(":~")
- if debug: main.log.info(main.ONOSbench.handle.before)
+ if debug: main.log.info(main.ONOSbench.handle.before)
main.ONOSbench.handle.sendline("onos $OC1 intents|grep WITHDRAWN|wc -l")
main.ONOSbench.handle.expect(":~")
intentWithdrawCheck = main.ONOSbench.handle.before
@@ -373,7 +373,7 @@
for i in myResult:
latTemp.append(i[0])
nodeTemp.append(i[1])
-
+
mode = {}
for i in nodeTemp:
if i in mode:
@@ -398,7 +398,7 @@
main.log.report("________________________________________________________")
resultsDB = open("/tmp/IntentRerouteLatDB", "a")
- resultsDB.write("'" + commit + "',")
+ resultsDB.write("'" + commit + "',")
resultsDB.write(str(clusterCount) + ",")
resultsDB.write(str(intents) + ",")
resultsDB.write(str(average) + ",")
diff --git a/TestON/tests/SCPFportLat/SCPFportLat.params b/TestON/tests/SCPFportLat/SCPFportLat.params
index a453767..00c8c19 100644
--- a/TestON/tests/SCPFportLat/SCPFportLat.params
+++ b/TestON/tests/SCPFportLat/SCPFportLat.params
@@ -72,9 +72,7 @@
<DB>
<postToDB>no</postToDB>
- <portEventResultPath>
- /tmp/portEventResultDb.log
- </portEventResultPath>
+ <portEventResultPath>/tmp/portEventResultDb</portEventResultPath>
</DB>
<JSON>
diff --git a/TestON/tests/SCPFswitchLat/Dependency/topo-perf-1sw.py b/TestON/tests/SCPFswitchLat/Dependency/topo-perf-1sw.py
new file mode 100644
index 0000000..fad98d2
--- /dev/null
+++ b/TestON/tests/SCPFswitchLat/Dependency/topo-perf-1sw.py
@@ -0,0 +1,13 @@
+'''
+Simple 1 switch topology for topologoy performance test
+'''
+
+from mininet.topo import Topo
+
+class MyTopo( Topo ):
+ def __init__(self):
+ Topo.__init__(self)
+
+ s3 = self.addSwitch( "s3", dpid="0000000000000001")
+
+topos = { 'mytopo': ( lambda: MyTopo() ) }
diff --git a/TestON/tests/SCPFswitchLat/SCPFswitchLat.params b/TestON/tests/SCPFswitchLat/SCPFswitchLat.params
new file mode 100644
index 0000000..64ac34e
--- /dev/null
+++ b/TestON/tests/SCPFswitchLat/SCPFswitchLat.params
@@ -0,0 +1,83 @@
+<PARAMS>
+ <testcases>1,2,1,2,1,2,1,2</testcases>
+
+ <SCALE>1,3,5,7</SCALE>
+ <max>7</max>
+
+ <ENV>
+ <cellName>topo_perf_test</cellName>
+ <cellApps>drivers,metrics,openflow</cellApps>
+ </ENV>
+
+ <GIT>
+ <autopull>off</autopull>
+ <checkout>master</checkout>
+ </GIT>
+
+ <CTRL>
+ <user>admin</user>
+ <ip1>OC1</ip1>
+ <ip2>OC2</ip2>
+ <ip3>OC3</ip3>
+ <ip4>OC4</ip4>
+ <ip5>OC5</ip5>
+ <ip6>OC6</ip6>
+ <ip7>OC7</ip7>
+ </CTRL>
+
+ <MN>
+ <ip1>localhost</ip1>
+ <ip2>localhost</ip2>
+ </MN>
+
+ <BENCH>
+ <ip>localhost</ip>
+ </BENCH>
+
+ <TSHARK>
+ <ofpPortStatus>OF 1.3 146</ofpPortStatus>
+ <ofpRoleReply>OF 1.3 90 of_role_reply</ofpRoleReply>
+ <featureReply>OF 1.3 98 of_features_reply</featureReply>
+ <roleRequest>OF 1.3 90 of_role_request</roleRequest>
+ <tcpSynAck>TCP 74 6633</tcpSynAck>
+ <finAckSequence>FIN</finAckSequence>
+ </TSHARK>
+
+ <TEST>
+ #'on' or 'off' debug mode.
+ #If on, logging will be more verbose and
+ #tshark pcap will be enabled
+ #pcap file located at /tmp/'capture_name'
+ <debugMode>off</debugMode>
+ <onosLogFile>/opt/onos/log/karaf*</onosLogFile>
+ <mci>off</mci>
+
+ <topoConfigFile>
+ single_topo_event_accumulator.cfg
+ </topoConfigFile>
+ <topoConfigName>
+ org.onlab.onos.net.topology.impl.DefaultTopologyProvider.cfg
+ </topoConfigName>
+
+ #Number of times to iterate each case
+ <numIter>13</numIter>
+ <numSwitch>2</numSwitch>
+ #Number of iterations to ignore initially
+ <iterIgnore>2</iterIgnore>
+
+ <singleSwThreshold>0,1000</singleSwThreshold>
+
+ <tabletFile>tablets_3node.json</tabletFile>
+ </TEST>
+
+ <DB>
+ <switchEventResultPath>/tmp/switchEventResultDb</switchEventResultPath>
+ </DB>
+
+ <JSON>
+ <deviceTimestamp>topologyDeviceEventTimestamp</deviceTimestamp>
+ <hostTimestamp>topologyHostEventTimestamp</hostTimestamp>
+ <linkTimestamp>topologyLinkEventTimestamp</linkTimestamp>
+ <graphTimestamp>topologyGraphEventTimestamp</graphTimestamp>
+ </JSON>
+</PARAMS>
diff --git a/TestON/tests/SCPFswitchLat/SCPFswitchLat.py b/TestON/tests/SCPFswitchLat/SCPFswitchLat.py
new file mode 100644
index 0000000..439efff
--- /dev/null
+++ b/TestON/tests/SCPFswitchLat/SCPFswitchLat.py
@@ -0,0 +1,848 @@
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+class SCPFswitchLat:
+
+ def __init__( self ):
+ self.default = ''
+
+ def CASE1( self, main ):
+ import sys
+ import os.path
+ import os
+ import time
+
+ global init
+ try:
+ if type(init) is not bool:
+ init = Fals
+ except NameError:
+ init = False
+
+ #Load values from params file
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ Apps = main.params[ 'ENV' ][ 'cellApps' ]
+ BENCHIp = main.params[ 'BENCH' ][ 'ip' ]
+ MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+ main.maxNodes = int(main.params[ 'max' ])
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ homeDir = os.path.expanduser('~')
+ topoCfgFile = main.params['TEST']['topoConfigFile']
+ topoCfgName = main.params['TEST']['topoConfigName']
+ switchEventResultPath = main.params['DB']['switchEventResultPath']
+ skipMvn = main.params ['TEST']['mci']
+ testONpath = os.getcwd() #testON/bin
+ user = main.params[ 'CTRL' ][ 'user' ]
+
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
+ init = True
+ global clusterCount #number of nodes running
+ global scale
+ global commit
+ global timeToPost
+ global runNum
+ global jenkinsBuildNumber
+ global CLIs
+ CLIs = []
+ main.ONOSIp = []
+
+ for i in range( 1, 8 ):
+ CLIs.append( getattr( main, 'ONOS' + str( i ) + 'cli' ) )
+
+ timeToPost = time.strftime('%Y-%m-%d %H:%M:%S')
+ runNum = time.strftime('%d%H%M%S')
+
+ try:
+ jenkinsBuildNumber = str(os.environ['BUILD_NUMBER'])
+ main.log.report( 'Jenkins build number: ' + jenkinsBuildNumber )
+ except KeyError:
+ jenkinsBuildNumber = str(0)
+ main.log.info( 'Job is not run by jenkins. ' + 'Build number set to: ' + jenkinsBuildNumber)
+
+ clusterCount = 0
+ main.ONOSIp = main.ONOSbench.getOnosIps()
+
+ scale = (main.params[ 'SCALE' ]).split(",")
+ clusterCount = int(scale[0])
+
+ #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+ if skipMvn != "off":
+ mvnResult = main.ONOSbench.cleanInstall()
+
+ #git
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
+
+ else:
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
+
+ main.log.step("Grabbing commit number")
+ commit = main.ONOSbench.getVersion() ####
+ commit = (commit.split(" "))[1]
+
+ temp = testONpath.replace("bin","") + "tests/SCPFswitchLat/Dependency/"
+ main.ONOSbench.copyMininetFile("topo-perf-1sw.py", temp, user, "localhost" )
+ #main.ONOSbench.handle.expect(":~")
+
+ main.step('Clearing previous DB log file')
+ print switchEventResultPath
+ fSwitchLog = open(switchEventResultPath, "w+")
+ fSwitchLog.write("")
+ fSwitchLog.close()
+
+ # -- END OF INIT SECTION --#
+
+ main.log.step("Adjusting scale")
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
+ #kill off all onos processes
+ main.log.step("Safety check, killing all ONOS processes before initiating enviornment setup")
+ for node in range(main.maxNodes):
+ main.ONOSbench.onosDie(main.ONOSIp[node])
+
+ #Uninstall everywhere
+ main.log.step( "Cleaning Enviornment..." )
+ for i in range(main.maxNodes):
+ main.log.info(" Uninstalling ONOS " + str(i) )
+ main.ONOSbench.onosUninstall( main.ONOSIp[i] )
+ main.log.info("Sleep 10 second for uninstall to settle...")
+ time.sleep(10)
+ main.ONOSbench.handle.sendline(" ")
+ main.ONOSbench.handle.expect(":~")
+
+ #construct the cell file
+ main.log.info("Creating cell file")
+ cellIp = []
+ for node in range (clusterCount):
+ cellIp.append(main.ONOSIp[node])
+
+ main.ONOSbench.createCellFile(main.ONOSbench.ip_address, cellName, MN1Ip, str(Apps), cellIp)
+
+ main.step( "Set Cell" )
+ main.ONOSbench.setCell(cellName)
+
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
+
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
+
+ main.step('Starting mininet topology ')
+ main.Mininet1.startNet()
+
+ main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
+ for node in range(clusterCount):
+ main.log.info("Starting ONOS " + str(node) + " at IP: " + main.ONOSIp[node])
+ main.ONOSbench.onosInstall( node=main.ONOSIp[node])
+
+ for i in range(50):
+ time.sleep(15)
+ print "attempt " + str(i)
+ main.ONOSbench.handle.sendline("onos $OC1 summary")
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+ if "nodes=" in main.ONOSbench.handle.before:
+ break
+
+ for node in range(clusterCount):
+ for i in range( 2 ):
+ isup = main.ONOSbench.isup( main.ONOSIp[node] )
+ if isup:
+ main.log.info("ONOS " + str(node) + " is up\n")
+ break
+ if not isup:
+ main.log.report( "ONOS " + str(node) + " didn't start!" )
+ main.log.info("Startup sequence complete")
+
+ #time.sleep(20)
+
+ main.step('Start onos cli')
+ for i in range(0,clusterCount):
+ cli1 = CLIs[i].startOnosCli(main.ONOSIp[i])
+
+ main.step( 'Configuring application parameters' )
+
+ configName = 'org.onosproject.net.topology.impl.DefaultTopologyProvider'
+ configParam = 'maxEvents 1'
+ main.ONOSbench.onosCfgSet( main.ONOSIp[0], configName, configParam )
+ configParam = 'maxBatchMs 0'
+ main.ONOSbench.onosCfgSet( main.ONOSIp[0], configName, configParam )
+ configParam = 'maxIdleMs 0'
+ main.ONOSbench.onosCfgSet( main.ONOSIp[0], configName, configParam )
+
+ def CASE2(self, main):
+ print "Cluster size: " + str(clusterCount)
+ """
+ Assign s3 to ONOSbench and measure latency
+
+ There are 4 levels of latency measurements to this test:
+ 1 ) End-to-end measurement: Complete end-to-end measurement
+ from TCP ( SYN/ACK ) handshake to Graph change
+ 2 ) OFP-to-graph measurement: 'ONOS processing' snippet of
+ measurement from OFP Vendor message to Graph change
+ 3 ) OFP-to-device measurement: 'ONOS processing without
+ graph change' snippet of measurement from OFP vendor
+ message to Device change timestamp
+ 4 ) T0-to-device measurement: Measurement that includes
+ the switch handshake to devices timestamp without
+ the graph view change. ( TCP handshake -> Device
+ change )
+ """
+ import time
+ import subprocess
+ import json
+ import requests
+ import os
+ import numpy
+
+ ONOSUser = main.params['CTRL']['user']
+ numIter = main.params['TEST']['numIter']
+ iterIgnore = int(main.params['TEST']['iterIgnore'])
+
+ deviceTimestampKey = main.params['JSON']['deviceTimestamp']
+ graphTimestampKey = main.params['JSON']['graphTimestamp']
+
+ debugMode = main.params['TEST']['debugMode']
+ onosLog = main.params['TEST']['onosLogFile']
+ resultPath = main.params['DB']['switchEventResultPath']
+ thresholdStr = main.params['TEST']['singleSwThreshold']
+ thresholdObj = thresholdStr.split(',')
+ thresholdMin = int(thresholdObj[0])
+ thresholdMax = int(thresholdObj[1])
+
+ # Look for 'role-request' messages,
+ # which replaces the 'vendor' messages previously seen
+ # on OVS 2.0.1
+ tsharkTcpString = main.params[ 'TSHARK' ][ 'tcpSynAck' ]
+ tsharkFeatureReply = main.params[ 'TSHARK' ][ 'featureReply' ]
+ tsharkRoleRequest = main.params[ 'TSHARK' ][ 'roleRequest' ]
+ tsharkOfString = main.params[ 'TSHARK' ][ 'ofpRoleReply' ]
+ tsharkFinAckSequence = main.params[ 'TSHARK' ][ 'finAckSequence' ]
+
+ tsharkOfOutput = '/tmp/tshark_of_topo.txt'
+ tsharkTcpOutput = '/tmp/tshark_tcp_topo.txt'
+ tsharkRoleOutput = '/tmp/tshark_role_request.txt'
+ tsharkFeatureOutput = '/tmp/tshark_feature_reply.txt'
+ tsharkFinAckOutput = '/tmp/tshark_fin_ack.txt'
+
+ # Switch connect measurement list
+ # TCP Syn/Ack -> Feature Reply latency collection for each node
+ tcpToFeatureLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
+ # Feature Reply -> Role Request latency collection for each node
+ featureToRoleRequestLatNodeIter = numpy.zeros((clusterCount,
+ int(numIter)))
+ # Role Request -> Role Reply latency collection for each node
+ roleRequestToRoleReplyLatNodeIter = numpy.zeros((clusterCount,
+ int(numIter)))
+ # Role Reply -> Device Update latency collection for each node
+ roleReplyToDeviceLatNodeIter = numpy.zeros((clusterCount,
+ int(numIter)))
+ # Device Update -> Graph Update latency collection for each node
+ deviceToGraphLatNodeIter = numpy.zeros((clusterCount,
+ int(numIter)))
+ endToEndLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
+
+ # Switch disconnect measurement lists
+ # Mininet Fin / Ack -> Mininet Ack
+ finAckTransactionLatNodeIter = numpy.zeros((clusterCount,
+ int(numIter)))
+ # Mininet Ack -> Device Event
+ ackToDeviceLatNodeIter = numpy.zeros((clusterCount,
+ int(numIter)))
+ # Device event -> Graph event
+ deviceToGraphDiscLatNodeIter = numpy.zeros((clusterCount,
+ int(numIter)))
+ endToEndDiscLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
+
+ assertion = main.TRUE
+ localTime = time.strftime('%x %X')
+ localTime = localTime.replace('/', '')
+ localTime = localTime.replace(' ', '_')
+ localTime = localTime.replace(':', '')
+
+ if debugMode == 'on':
+ main.ONOSbench.tsharkPcap('eth0', '/tmp/single_sw_lat_pcap_' + localTime)
+ main.log.info('Debug mode is on')
+
+ main.log.report('Latency of adding one switch to controller')
+ main.log.report('First ' + str(iterIgnore) + ' iterations ignored' + ' for jvm warmup time')
+ main.log.report('Total iterations of test: ' + str(numIter))
+
+ for i in range(0, int(numIter)):
+ main.log.info('Starting tshark capture')
+ main.ONOSbench.tsharkGrep(tsharkTcpString, tsharkTcpOutput)
+ main.ONOSbench.tsharkGrep(tsharkOfString, tsharkOfOutput)
+ main.ONOSbench.tsharkGrep(tsharkRoleRequest, tsharkRoleOutput)
+ main.ONOSbench.tsharkGrep(tsharkFeatureReply, tsharkFeatureOutput)
+
+ time.sleep(10)
+
+ main.log.info('Assigning s3 to controller')
+ main.Mininet1.assignSwController(sw='s3',
+ ip=main.ONOSIp[0])
+
+ jsonStr = []
+ for node in range (0, clusterCount):
+ metricsSwUp = CLIs[node].topologyEventsMetrics()
+ jsonStr.append(metricsSwUp)
+
+ time.sleep(10)
+
+ main.log.info('Stopping all Tshark processes')
+ main.ONOSbench.tsharkStop()
+
+ time.sleep(5)
+
+ '''
+ main.log.info('Copying over tshark files')
+ os.system('scp ' + ONOSUser + '@' + main.ONOSIp[0] +
+ ':' + tsharkTcpOutput + ' /tmp/')
+ os.system('scp ' + ONOSUser + '@' + main.ONOSIp[0] +
+ ':' + tsharkRoleOutput + ' /tmp/')
+ os.system('scp ' + ONOSUser + '@' + main.ONOSIp[0] +
+ ':' + tsharkFeatureOutput + ' /tmp/')
+ os.system('scp ' + ONOSUser + '@' +
+ main.ONOSIp[0] + ':' + tsharkOfOutput + ' /tmp/')
+ '''
+
+ # Get tcp syn / ack output
+ time.sleep(1)
+
+ tcpFile = open(tsharkTcpOutput, 'r')
+ tempText = tcpFile.readline()
+ tempText = tempText.split(' ')
+ main.log.info('Object read in from TCP capture: ' + str(tempText))
+
+ if len(tempText) > 1:
+ t0Tcp = float(tempText[1]) * 1000.0
+ else:
+ main.log.error('Tshark output file for TCP' + ' returned unexpected results')
+ t0Tcp = 0
+ assertion = main.FALSE
+ tcpFile.close()
+
+ # Get Role reply output
+ ofFile = open(tsharkOfOutput, 'r')
+ lineOfp = ''
+ while True:
+ tempText = ofFile.readline()
+ if tempText != '':
+ lineOfp = tempText
+ else:
+ break
+ obj = lineOfp.split(' ')
+ main.log.info('Object read in from OFP capture: ' +
+ str(lineOfp))
+ if len(obj) > 1:
+ t0Ofp = float(obj[1]) * 1000.0
+ else:
+ main.log.error('Tshark output file for OFP' +
+ ' returned unexpected results')
+ t0Ofp = 0
+ assertion = main.FALSE
+ ofFile.close()
+
+ # Get role request output
+ roleFile = open(tsharkRoleOutput, 'r')
+ tempText = roleFile.readline()
+ tempText = tempText.split(' ')
+ if len(tempText) > 1:
+ main.log.info('Object read in from role request capture:' +
+ str(tempText))
+ roleTimestamp = float(tempText[1]) * 1000.0
+ else:
+ main.log.error('Tshark output file for role request' +
+ ' returned unexpected results')
+ timeRoleRequest = 0
+ assertion = main.FALSE
+ roleFile.close()
+
+ # Get feature reply output
+ featureFile = open(tsharkFeatureOutput, 'r')
+ tempText = featureFile.readline()
+ tempText = tempText.split(' ')
+ if len(tempText) > 1:
+ main.log.info('Object read in from feature reply capture: '+
+ str(tempText))
+ if tempText[1] != ' ' and float(tempText[1]) > 1400000000.0:
+ temp = tempText[1]
+ elif tempText[2] != ' ' and float(tempText[2]) > 1400000000.0:
+ temp = tempText[2]
+ else:
+ temp = 0
+ featureTimestamp = float(temp) * 1000.0
+ else:
+ main.log.error('Tshark output file for feature reply' +
+ ' returned unexpected results')
+ timeFeatureReply = 0
+ assertion = main.FALSE
+ featureFile.close()
+
+ for node in range(0, clusterCount):
+ nodeNum = node+1
+ #metricsSwUp = CLIs[node].topologyEventsMetrics
+ #jsonStr = metricsSwUp()
+ jsonObj = json.loads(jsonStr[node])
+ if jsonObj:
+ graphTimestamp = jsonObj[graphTimestampKey]['value']
+ deviceTimestamp = jsonObj[deviceTimestampKey]['value']
+ else:
+ main.log.error( "Unexpected JSON object" )
+ # If we could not obtain the JSON object,
+ # set the timestamps to 0, which will be
+ # excluded from the measurement later on
+ # (realized as invalid)
+ graphTimestamp = 0
+ deviceTimestamp = 0
+
+ endToEnd = int(graphTimestamp) - int(t0Tcp)
+
+ # Below are measurement breakdowns of the end-to-end
+ # measurement.
+ tcpToFeature = int(featureTimestamp) - int(t0Tcp)
+ featureToRole = int(roleTimestamp) - int(featureTimestamp)
+ roleToOfp = float(t0Ofp) - float(roleTimestamp)
+ ofpToDevice = float(deviceTimestamp) - float(t0Ofp)
+ # Timestamps gathered from ONOS are millisecond
+ # precision. They are returned as integers, thus no
+ # need to be more precise than 'int'. However,
+ # the processing seems to be mostly under 1 ms,
+ # thus this may be a problem point to handle any
+ # submillisecond output that we are unsure of.
+ # For now, this will be treated as 0 ms if less than 1 ms
+ deviceToGraph = int(graphTimestamp) - int(deviceTimestamp)
+
+ if endToEnd >= thresholdMin and\
+ endToEnd < thresholdMax and i >= iterIgnore:
+ endToEndLatNodeIter[node][i] = endToEnd
+ main.log.info("ONOS "+str(nodeNum)+ " end-to-end: "+
+ str(endToEnd) + " ms")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+ " end-to-end "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(endToEnd))
+
+ if tcpToFeature >= thresholdMin and\
+ tcpToFeature < thresholdMax and i >= iterIgnore:
+ tcpToFeatureLatNodeIter[node][i] = tcpToFeature
+ main.log.info("ONOS "+str(nodeNum)+ " tcp-to-feature: "+
+ str(tcpToFeature) + " ms")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+ " tcp-to-feature "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(tcpToFeature))
+
+ if featureToRole >= thresholdMin and\
+ featureToRole < thresholdMax and i >= iterIgnore:
+ featureToRoleRequestLatNodeIter[node][i] = featureToRole
+ main.log.info("ONOS "+str(nodeNum)+ " feature-to-role: "+
+ str(featureToRole) + " ms")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+ " feature-to-role "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(featureToRole))
+
+ if roleToOfp >= thresholdMin and\
+ roleToOfp < thresholdMax and i >= iterIgnore:
+ roleRequestToRoleReplyLatNodeIter[node][i] = roleToOfp
+ main.log.info("ONOS "+str(nodeNum)+ " role-to-reply: "+
+ str(roleToOfp) + " ms")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+ " role-to-reply "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(roleToOfp))
+
+ if ofpToDevice >= thresholdMin and\
+ ofpToDevice < thresholdMax and i >= iterIgnore:
+ roleReplyToDeviceLatNodeIter[node][i] = ofpToDevice
+ main.log.info("ONOS "+str(nodeNum)+ " reply-to-device: "+
+ str(ofpToDevice) + " ms")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+ " reply-to-device "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(ofpToDevice))
+
+ if deviceToGraph >= thresholdMin and\
+ deviceToGraph < thresholdMax and i >= iterIgnore:
+ deviceToGraphLatNodeIter[node][i] = deviceToGraph
+ main.log.info("ONOS "+str(nodeNum)+ " device-to-graph: "+
+ str(deviceToGraph) + " ms")
+ else:
+ if deviceToGraph == 0:
+ deviceToGraphLatNodeIter[node][i] = 0
+ main.log.info("ONOS "+str(nodeNum) +
+ " device-to-graph measurement "+
+ "was set to 0 ms because of precision "+
+ "uncertainty. ")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+
+ " device-to-graph "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(deviceToGraph))
+
+ # ********************
+ time.sleep(5)
+
+ # Get device id to remove
+ deviceIdJsonStr = main.ONOS1cli.devices()
+
+ main.log.info( "Device obj obtained: " + str(deviceIdJsonStr) )
+ deviceId = json.loads(deviceIdJsonStr)
+
+ deviceList = []
+ for device in deviceId:
+ deviceList.append(device['id'])
+
+ # Measure switch down metrics
+ # TCP FIN/ACK -> TCP FIN
+ # TCP FIN -> Device Event
+ # Device Event -> Graph Event
+ # Capture switch down FIN / ACK packets
+
+ # The -A 1 grep option allows us to grab 1 extra line after the
+ # last tshark output grepped originally
+ main.ONOSbench.tsharkGrep( tsharkFinAckSequence, tsharkFinAckOutput,
+ grepOptions = '-A 1' )
+
+ time.sleep( 5 )
+
+ removeJsonList = []
+ main.step('Remove switch from controller')
+ main.Mininet1.deleteSwController('s3')
+ firstDevice = deviceList[0]
+
+ time.sleep( 5 )
+
+ # We need to get metrics before removing
+ # device from the store below.
+ for node in range(0, clusterCount):
+ metricsSwDown = CLIs[node].topologyEventsMetrics
+ jsonStr = metricsSwDown()
+ removeJsonList.append( json.loads(jsonStr) )
+
+ main.ONOSbench.tsharkStop()
+
+ main.log.info( "Removing device " +str(firstDevice)+
+ " from ONOS" )
+
+ #if deviceId:
+ main.ONOS1cli.deviceRemove(firstDevice)
+
+ #main.log.info('Copying over tshark files')
+ #os.system('scp ' + ONOSUser + '@' + main.ONOSIp[0] + ':' + tsharkFinAckOutput + ' /tmp/')
+
+ time.sleep( 10 )
+ finAckOutputList = []
+ with open(tsharkFinAckOutput, 'r') as f:
+ tempLine = f.readlines()
+ main.log.info('Object read in from FinAck capture: ' +
+ "\n".join(tempLine))
+
+ index = 1
+ for line in tempLine:
+ obj = line.split(' ')
+
+ # There are at least 3 objects in field (valid
+ # tshark output is lengthy)
+ if len(obj) > 2:
+ # If first index of object is like an epoch time
+ if obj[1] != ' ' and float(obj[1]) > 1400000000.0:
+ temp = obj[1]
+ elif obj[2] != ' 'and float(obj[2]) > 1400000000.0:
+ temp = obj[2]
+ elif obj[3] != ' 'and float(obj[3]) > 1400000000.0:
+ temp = obj[3]
+ else:
+ temp = 0
+ if index == 1:
+ tFinAck = float(temp) * 1000.0
+ elif index == 3:
+ tAck = float(temp) * 1000.0
+ else:
+ tFinAck = 0
+ tAck = 0
+ else:
+ main.log.error('Tshark output file for OFP' +
+ ' returned unexpected results')
+ tFinAck = 0
+ tAck = 0
+ assertion = main.FALSE
+
+ index += 1
+
+ # with open() as f takes care of closing file
+
+ time.sleep(5)
+
+ for node in range(0, clusterCount):
+ nodeNum = node+1
+ jsonObj = removeJsonList[node]
+ if jsonObj:
+ graphTimestamp = jsonObj[graphTimestampKey]['value']
+ deviceTimestamp = jsonObj[deviceTimestampKey]['value']
+ main.log.info("Graph timestamp: "+str(graphTimestamp))
+ main.log.info("Device timestamp: "+str(deviceTimestamp))
+ else:
+ main.log.error( "Unexpected JSON object" )
+ # If we could not obtain the JSON object,
+ # set the timestamps to 0, which will be
+ # excluded from the measurement later on
+ # (realized as invalid)
+ graphTimestamp = 0
+ deviceTimestamp = 0
+
+ finAckTransaction = float(tAck) - float(tFinAck)
+ ackToDevice = float(deviceTimestamp) - float(tAck)
+ deviceToGraph = float(graphTimestamp) - float(deviceTimestamp)
+ endToEndDisc = int(graphTimestamp) - int(tFinAck)
+
+ if endToEndDisc >= thresholdMin and\
+ endToEndDisc < thresholdMax and i >= iterIgnore:
+ endToEndDiscLatNodeIter[node][i] = endToEndDisc
+ main.log.info("ONOS "+str(nodeNum) +
+ "end-to-end disconnection: "+
+ str(endToEndDisc) + " ms" )
+ else:
+ main.log.info("ONOS " + str(nodeNum) +
+ " end-to-end disconnection "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(endToEndDisc))
+
+ if finAckTransaction >= thresholdMin and\
+ finAckTransaction < thresholdMax and i >= iterIgnore:
+ finAckTransactionLatNodeIter[node][i] = finAckTransaction
+ main.log.info("ONOS "+str(nodeNum)+
+ " fin/ack transaction: "+
+ str(finAckTransaction) + " ms")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+
+ " fin/ack transaction "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(finAckTransaction))
+
+ if ackToDevice >= thresholdMin and\
+ ackToDevice < thresholdMax and i >= iterIgnore:
+ ackToDeviceLatNodeIter[node][i] = ackToDevice
+ main.log.info("ONOS "+str(nodeNum)+
+ " ack-to-device: "+
+ str(ackToDevice) + " ms")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+
+ " ack-to-device "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(ackToDevice))
+
+ if deviceToGraph >= thresholdMin and\
+ deviceToGraph < thresholdMax and i >= iterIgnore:
+ deviceToGraphDiscLatNodeIter[node][i] = deviceToGraph
+ main.log.info("ONOS "+str(nodeNum)+
+ " device-to-graph disconnect: "+
+ str(deviceToGraph) + " ms")
+ else:
+ main.log.info("ONOS "+str(nodeNum)+
+ " device-to-graph disconnect "+
+ "measurement ignored due to excess in "+
+ "threshold or premature iteration: ")
+ main.log.info(str(deviceToGraph))
+
+ endToEndAvg = 0
+ ofpToGraphAvg = 0
+ dbCmdList = []
+ for node in range(0, clusterCount):
+ # List of latency for each node
+ endToEndList = []
+ tcpToFeatureList = []
+ featureToRoleList = []
+ roleToOfpList = []
+ ofpToDeviceList = []
+ deviceToGraphList = []
+
+ finAckTransactionList = []
+ ackToDeviceList = []
+ deviceToGraphDiscList = []
+ endToEndDiscList = []
+
+ # LatNodeIter 2d arrays contain all iteration latency
+ # for each node of the current scale cluster size
+ # Switch connection measurements
+ # Set further acceptance criteria for measurements
+ # here if you would like to filter reporting results
+ for item in endToEndLatNodeIter[node]:
+ if item > 0.0:
+ endToEndList.append(item)
+
+ for item in tcpToFeatureLatNodeIter[node]:
+ if item > 0.0:
+ tcpToFeatureList.append(item)
+
+ for item in featureToRoleRequestLatNodeIter[node]:
+ if item > 0.0:
+ featureToRoleList.append(item)
+
+ for item in roleRequestToRoleReplyLatNodeIter[node]:
+ if item > 0.0:
+ roleToOfpList.append(item)
+
+ for item in roleReplyToDeviceLatNodeIter[node]:
+ if item >= 0.0:
+ ofpToDeviceList.append(item)
+
+ for item in featureToRoleRequestLatNodeIter[node]:
+ if item > 0.0:
+ featureToRoleList.append(item)
+
+ for item in deviceToGraphLatNodeIter[node]:
+ if item >= 0.0:
+ deviceToGraphList.append(item)
+
+ # Switch disconnect measurements
+ for item in endToEndDiscLatNodeIter[node]:
+ if item > 0.0:
+ endToEndDiscList.append(item)
+
+ for item in finAckTransactionLatNodeIter[node]:
+ if item > 0.0:
+ finAckTransactionList.append(item)
+
+ for item in ackToDeviceLatNodeIter[node]:
+ if item > 0.0:
+ ackToDeviceList.append(item)
+
+ for item in deviceToGraphDiscLatNodeIter[node]:
+ if item >= 0.0:
+ deviceToGraphDiscList.append(item)
+
+ endToEndAvg = round(numpy.mean(endToEndList), 2)
+ endToEndStdDev = round(numpy.std(endToEndList), 2)
+
+ tcpToFeatureAvg = round(numpy.mean(tcpToFeatureList), 2)
+ tcpToFeatureStdDev = round(numpy.std(tcpToFeatureList), 2)
+
+ featureToRoleAvg = round(numpy.mean(featureToRoleList), 2)
+ featureToRoleStdDev = round(numpy.std(featureToRoleList), 2)
+
+ roleToOfpAvg = round(numpy.mean(roleToOfpList), 2)
+ roleToOfpStdDev = round(numpy.std(roleToOfpList), 2)
+
+ ofpToDeviceAvg = round(numpy.mean(ofpToDeviceList), 2)
+ ofpToDeviceStdDev = round(numpy.std(ofpToDeviceList), 2)
+
+ deviceToGraphAvg = round(numpy.mean(deviceToGraphList), 2)
+ deviceToGraphStdDev = round(numpy.std(deviceToGraphList), 2)
+
+ endToEndDiscAvg = round(numpy.mean(endToEndDiscList), 2)
+ endToEndDiscStdDev = round(numpy.std(endToEndDiscList), 2)
+
+ finAckAvg = round(numpy.mean(finAckTransactionList), 2)
+ finAckStdDev = round(numpy.std(finAckTransactionList), 2)
+
+ ackToDeviceAvg = round(numpy.mean(ackToDeviceList), 2)
+ ackToDeviceStdDev = round(numpy.std(ackToDeviceList), 2)
+
+ deviceToGraphDiscAvg = round(numpy.mean(deviceToGraphDiscList), 2)
+ deviceToGraphDiscStdDev = round(numpy.std(deviceToGraphDiscList), 2)
+
+ main.log.report(' - Node ' + str(node + 1) + ' Summary - ')
+ main.log.report(' - Switch Connection Statistics - ')
+
+ main.log.report(' End-to-end Avg: ' + str(endToEndAvg) +
+ ' ms' + ' End-to-end Std dev: ' +
+ str(endToEndStdDev) + ' ms')
+
+ main.log.report(' Tcp-to-feature-reply Avg: ' +
+ str(tcpToFeatureAvg) + ' ms')
+ main.log.report(' Tcp-to-feature-reply Std dev: '+
+ str(tcpToFeatureStdDev) + ' ms')
+
+ main.log.report(' Feature-reply-to-role-request Avg: ' +
+ str(featureToRoleAvg) + ' ms')
+ main.log.report(' Feature-reply-to-role-request Std Dev: ' +
+ str(featureToRoleStdDev) + ' ms')
+
+ main.log.report(' Role-request-to-role-reply Avg: ' +
+ str(roleToOfpAvg) +' ms')
+ main.log.report(' Role-request-to-role-reply Std dev: ' +
+ str(roleToOfpStdDev) + ' ms')
+
+ main.log.report(' Role-reply-to-device Avg: ' +
+ str(ofpToDeviceAvg) +' ms')
+ main.log.report(' Role-reply-to-device Std dev: ' +
+ str(ofpToDeviceStdDev) + ' ms')
+
+ main.log.report(' Device-to-graph Avg: ' +
+ str(deviceToGraphAvg) + ' ms')
+ main.log.report( 'Device-to-graph Std dev: ' +
+ str(deviceToGraphStdDev) + ' ms')
+
+ main.log.report(' - Switch Disconnection Statistics - ')
+ main.log.report(' End-to-end switch disconnect Avg: ' +
+ str(endToEndDiscAvg) + ' ms')
+ main.log.report(' End-to-end switch disconnect Std dev: ' +
+ str(endToEndDiscStdDev) + ' ms')
+ main.log.report(' Fin/Ack-to-Ack Avg: ' + str(finAckAvg) + ' ms')
+ main.log.report(' Fin/Ack-to-Ack Std dev: ' +
+ str(finAckStdDev) + ' ms')
+
+ main.log.report(' Ack-to-device Avg: ' + str(ackToDeviceAvg) +
+ ' ms')
+ main.log.report(' Ack-to-device Std dev: ' + str(ackToDeviceStdDev) +
+ ' ms')
+
+ main.log.report(' Device-to-graph (disconnect) Avg: ' +
+ str(deviceToGraphDiscAvg) + ' ms')
+ main.log.report(' Device-to-graph (disconnect) Std dev: ' +
+ str(deviceToGraphDiscStdDev) + ' ms')
+
+ # For database schema, refer to Amazon web services
+ dbCmdList.append(
+ "INSERT INTO switch_latency_details VALUES('" +
+ timeToPost + "','switch_latency_results'," +
+ jenkinsBuildNumber + ',' + str(clusterCount) + ",'baremetal" +
+ str(node + 1) + "'," +
+ str(endToEndAvg) + ',' +
+ str(tcpToFeatureAvg) + ',' +
+ str(featureToRoleAvg) + ',' +
+ str(roleToOfpAvg) + ',' +
+ str(ofpToDeviceAvg) + ',' +
+ str(deviceToGraphAvg) + ',' +
+ str(endToEndDiscAvg) + ',' +
+ str(finAckAvg) + ',' +
+ str(ackToDeviceAvg) + ',' +
+ str(deviceToGraphDiscAvg) +
+ ');')
+
+ if debugMode == 'on':
+ main.ONOSbench.cpLogsToDir('/opt/onos/log/karaf.log',
+ '/tmp/', copyFileName='sw_lat_karaf')
+ fResult = open(resultPath, 'a')
+ for line in dbCmdList:
+ if line:
+ fResult.write(line + '\n')
+ main.log.report(line)
+ fResult.close()
+
+ assertion = main.TRUE
+
+ utilities.assert_equals(expect=main.TRUE, actual=assertion,
+ onpass='Switch latency test successful',
+ onfail='Switch latency test failed')
+
+ main.Mininet1.stopNet()
diff --git a/TestON/tests/SCPFswitchLat/SCPFswitchLat.topo b/TestON/tests/SCPFswitchLat/SCPFswitchLat.topo
new file mode 100644
index 0000000..29c60e1
--- /dev/null
+++ b/TestON/tests/SCPFswitchLat/SCPFswitchLat.topo
@@ -0,0 +1,106 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ <home>~/onos</home>
+ <nodes>7</nodes>
+ </COMPONENTS>
+ </ONOSbench>
+
+ <ONOS1cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1cli>
+
+ <ONOS2cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2cli>
+
+ <ONOS3cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3cli>
+
+ <ONOS4cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>5</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4cli>
+
+ <ONOS5cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>6</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5cli>
+
+ <ONOS6cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>7</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6cli>
+
+ <ONOS7cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>8</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7cli>
+
+ <ONOS1>
+ <host>OC1</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>9</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1>
+
+ <Mininet1>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>MininetCliDriver</type>
+ <connect_order>16</connect_order>
+ <COMPONENTS>
+ <arg1> --custom ~/mininet/custom/topo-perf-1sw.py </arg1>
+ <arg2> --topo mytopo</arg2>
+ <arg3> --switch ovsk,protocols=OpenFlow13</arg3>
+ <controller> remote </controller>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+
+</TOPOLOGY>
+
diff --git a/TestON/tests/SCPFswitchLat/__init__.py b/TestON/tests/SCPFswitchLat/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFswitchLat/__init__.py