Fix comment indentation
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 81db512..a2ac701 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -34,9 +34,9 @@
super(CLI, self).__init__()
def connect(self,**connectargs):
- '''
- Creates ssh handle for ONOS.
- '''
+ '''
+ Creates ssh handle for ONOS.
+ '''
try:
for key in connectargs:
vars(self)[key] = connectargs[key]
@@ -65,10 +65,10 @@
main.exit()
def start(self):
- '''
- Starts ONOS on remote machine.
- Returns false if any errors were encountered.
- '''
+ '''
+ Starts ONOS on remote machine.
+ Returns false if any errors were encountered.
+ '''
try:
self.handle.sendline("")
self.handle.expect("\$")
@@ -97,9 +97,9 @@
main.exit()
def start_rest(self):
- '''
- Starts the rest server on ONOS.
- '''
+ '''
+ Starts the rest server on ONOS.
+ '''
try:
response = self.execute(cmd= self.home + "/start-rest.sh start",prompt="\$",timeout=10)
if re.search("admin",response):
@@ -117,9 +117,9 @@
main.exit()
def status(self):
- '''
- Called onos.sh core status and returns TRUE/FALSE accordingly
- '''
+ '''
+ Called onos.sh core status and returns TRUE/FALSE accordingly
+ '''
try:
self.execute(cmd="\n",prompt="\$",timeout=10)
response = self.execute(cmd= self.home + "/onos.sh core status ",prompt="\d+\sinstance\sof\sonos\srunning",timeout=10)
@@ -140,13 +140,13 @@
def isup(self):
- '''
- A more complete check to see if ONOS is up and running properly.
- First, it checks if the process is up.
- Second, it reads the logs for "Exception: Connection refused"
- Third, it makes sure the logs are actually moving.
- returns TRUE/FALSE accordingly.
- '''
+ '''
+ A more complete check to see if ONOS is up and running properly.
+ First, it checks if the process is up.
+ Second, it reads the logs for "Exception: Connection refused"
+ Third, it makes sure the logs are actually moving.
+ returns TRUE/FALSE accordingly.
+ '''
try:
self.execute(cmd="\n",prompt="\$",timeout=10)
response = self.execute(cmd= self.home + "/onos.sh core status ",prompt="running",timeout=10)
@@ -186,9 +186,9 @@
def rest_status(self):
- '''
- Checks if the rest server is running.
- '''
+ '''
+ Checks if the rest server is running.
+ '''
try:
response = self.execute(cmd= self.home + "/start-rest.sh status ",prompt="running",timeout=10)
if re.search("rest\sserver\sis\srunning",response):
@@ -209,9 +209,9 @@
def stop(self):
- '''
- Runs ./onos.sh core stop to stop ONOS
- '''
+ '''
+ Runs ./onos.sh core stop to stop ONOS
+ '''
try:
self.handle.sendline("")
self.handle.expect("\$")
@@ -234,9 +234,9 @@
def rest_stop(self):
- '''
- Runs ./start-rest.sh stop to stop ONOS rest server
- '''
+ '''
+ Runs ./start-rest.sh stop to stop ONOS rest server
+ '''
try:
response = self.execute(cmd= self.home + "/start-rest.sh stop ",prompt="killing",timeout=10)
self.execute(cmd="\n",prompt="\$",timeout=10)
@@ -255,9 +255,9 @@
def disconnect(self):
- '''
- Called when Test is complete to disconnect the ONOS handle.
- '''
+ '''
+ Called when Test is complete to disconnect the ONOS handle.
+ '''
response = ''
try:
self.handle.sendline("exit")
@@ -268,9 +268,9 @@
return response
def get_version(self):
- '''
- Writes the COMMIT number to the report to be parsed by Jenkins data collecter.
- '''
+ '''
+ Writes the COMMIT number to the report to be parsed by Jenkins data collecter.
+ '''
try:
self.handle.sendline("export TERM=xterm-256color")
self.handle.expect("xterm-256color")
@@ -287,10 +287,10 @@
main.exit()
def add_flow(self, testONip, user, password, flowDef):
- '''
- Copies the flowdef file from TestStation -> ONOS machine
- Then runs ./add_flow.py to add the flows to ONOS
- '''
+ '''
+ Copies the flowdef file from TestStation -> ONOS machine
+ Then runs ./add_flow.py to add the flows to ONOS
+ '''
try:
main.log.info("Adding Flows...")
self.handle.sendline("scp %s@%s:%s /tmp/flowtmp" %(user,testONip,flowDef))
@@ -329,9 +329,9 @@
def delete_flow(self, *delParams):
- '''
- Deletes a specific flow, a range of flows, or all flows.
- '''
+ '''
+ Deletes a specific flow, a range of flows, or all flows.
+ '''
try:
if len(delParams)==1:
if str(delParams[0])=="all":
@@ -365,12 +365,12 @@
main.exit()
def check_flow(self):
- '''
- Calls the ./get_flow.py all and checks:
- - If each FlowPath has at least one FlowEntry
- - That there are no "NOT"s found
- returns TRUE/FALSE
- '''
+ '''
+ Calls the ./get_flow.py all and checks:
+ - If each FlowPath has at least one FlowEntry
+ - That there are no "NOT"s found
+ returns TRUE/FALSE
+ '''
try:
flowEntryDetect = 1
count = 0
@@ -411,33 +411,33 @@
main.exit()
def get_flow(self, *flowParams):
- '''
- Returns verbose output of ./get_flow.py
- '''
- try:
- if len(flowParams)==1:
- if str(flowParams[0])=="all":
- self.execute(cmd="\n",prompt="\$",timeout=60)
- main.log.info(self.name + ": Getting all flow data...")
- data = self.execute(cmd=self.home + "/scripts/TestON_get_flow.sh all",prompt="done",timeout=150)
- self.execute(cmd="\n",prompt="\$",timeout=60)
- return data
- else:
- main.log.info(self.name + ": Retrieving flow "+str(flowParams[0])+" data...")
- data = self.execute(cmd=self.home +"/scripts/TestON_get_flow.sh "+str(flowParams[0]),prompt="done",timeout=150)
- self.execute(cmd="\n",prompt="\$",timeout=60)
- return data
- elif len(flowParams)==5:
- main.log.info(self.name + ": Retrieving flow installer data...")
- data = self.execute(cmd=self.home + "/scripts/TestON_get_flow.sh "+str(flowParams[0])+" "+str(flowParams[1])+" "+str(flowParams[2])+" "+str(flowParams[3])+" "+str(flowParams[4]),prompt="done",timeout=150)
- self.execute(cmd="\n",prompt="\$",timeout=60)
- return data
- elif len(flowParams)==4:
- main.log.info(self.name + ": Retrieving flow endpoints...")
- data = self.execute(cmd=self.home + "/scripts/TestON_get_flow.sh "+str(flowParams[0])+" "+str(flowParams[1])+" "+str(flowParams[2])+" "+str(flowParams[3]),prompt="done",timeout=150)
- self.execute(cmd="\n",prompt="\$",timeout=60)
- return data
- except:
+ '''
+ Returns verbose output of ./get_flow.py
+ '''
+ try:
+ if len(flowParams)==1:
+ if str(flowParams[0])=="all":
+ self.execute(cmd="\n",prompt="\$",timeout=60)
+ main.log.info(self.name + ": Getting all flow data...")
+ data = self.execute(cmd=self.home + "/scripts/TestON_get_flow.sh all",prompt="done",timeout=150)
+ self.execute(cmd="\n",prompt="\$",timeout=60)
+ return data
+ else:
+ main.log.info(self.name + ": Retrieving flow "+str(flowParams[0])+" data...")
+ data = self.execute(cmd=self.home +"/scripts/TestON_get_flow.sh "+str(flowParams[0]),prompt="done",timeout=150)
+ self.execute(cmd="\n",prompt="\$",timeout=60)
+ return data
+ elif len(flowParams)==5:
+ main.log.info(self.name + ": Retrieving flow installer data...")
+ data = self.execute(cmd=self.home + "/scripts/TestON_get_flow.sh "+str(flowParams[0])+" "+str(flowParams[1])+" "+str(flowParams[2])+" "+str(flowParams[3])+" "+str(flowParams[4]),prompt="done",timeout=150)
+ self.execute(cmd="\n",prompt="\$",timeout=60)
+ return data
+ elif len(flowParams)==4:
+ main.log.info(self.name + ": Retrieving flow endpoints...")
+ data = self.execute(cmd=self.home + "/scripts/TestON_get_flow.sh "+str(flowParams[0])+" "+str(flowParams[1])+" "+str(flowParams[2])+" "+str(flowParams[3]),prompt="done",timeout=150)
+ self.execute(cmd="\n",prompt="\$",timeout=60)
+ return data
+ except:
main.log.info(self.name + ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
main.log.error( traceback.print_exc() )
main.log.info(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
@@ -451,9 +451,9 @@
# http://localhost:8080/wm/registry/switches/json"
def get_json(self, url):
- '''
- Helper functions used to parse the json output of a rest call
- '''
+ '''
+ Helper functions used to parse the json output of a rest call
+ '''
try:
try:
command = "curl -s %s" % (url)
@@ -475,9 +475,9 @@
main.exit()
def check_switch(self,RestIP,correct_nr_switch, RestPort ="8080" ):
- '''
- Used by check_status
- '''
+ '''
+ Used by check_status
+ '''
try:
buf = ""
retcode = 0
@@ -520,9 +520,9 @@
main.exit()
def check_link(self,RestIP, nr_links, RestPort = "8080"):
- '''
- Used by check_status
- '''
+ '''
+ Used by check_status
+ '''
try:
buf = ""
retcode = 0
@@ -554,10 +554,10 @@
main.exit()
def check_status_report(self, ip, numoswitch, numolink, port="8080"):
- '''
- Checks the number of swithes & links that ONOS sees against the supplied values.
- Writes to the report log.
- '''
+ '''
+ Checks the number of swithes & links that ONOS sees against the supplied values.
+ Writes to the report log.
+ '''
try:
main.log.info(self.name + ": Making some rest calls...")
switch = self.check_switch(ip, int(numoswitch), port)
@@ -578,10 +578,10 @@
main.exit()
def check_status(self, ip, numoswitch, numolink, port = "8080"):
- '''
- Checks the number of swithes & links that ONOS sees against the supplied values.
- Writes to the main log.
- '''
+ '''
+ Checks the number of swithes & links that ONOS sees against the supplied values.
+ Writes to the main log.
+ '''
try:
main.log.info(self.name + ": Making some rest calls...")
switch = self.check_switch(ip, int(numoswitch), port)
@@ -602,9 +602,9 @@
main.exit()
def drop_keyspace(self):
- '''
- Drops the ONOS keyspace
- '''
+ '''
+ Drops the ONOS keyspace
+ '''
try:
self.handle.sendline(self.home + "/scripts/drop-keyspace.sh")
self.handle.expect("keyspace")
@@ -621,10 +621,10 @@
def check_for_no_exceptions(self):
- '''
- TODO: Rewrite
- Used by CassndraCheck.py to scan ONOS logs for Exceptions
- '''
+ '''
+ TODO: Rewrite
+ Used by CassndraCheck.py to scan ONOS logs for Exceptions
+ '''
try:
self.handle.sendline("dsh 'grep Exception ~/ONOS/onos-logs/onos.*.log'")
self.handle.expect("\$ dsh")
@@ -644,10 +644,10 @@
def git_pull(self):
- '''
- Stops the ONOS, pulls the latest code, and builds with mvn.
- Assumes that "git pull" works without login
- '''
+ '''
+ Stops the ONOS, pulls the latest code, and builds with mvn.
+ Assumes that "git pull" works without login
+ '''
try:
main.log.info(self.name + ": Stopping ONOS")
self.stop()