Fix regular expression in connect to look for the $ character instead of the end of line anchor
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 87df2fe..66c6733 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -122,7 +122,18 @@
main.log.info(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
main.cleanup()
main.exit()
-
+
+ def start_all(self):
+ '''
+ starts ZK, RC, and ONOS
+ '''
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh start")
+ self.handle.expect("./onos.sh start")
+ self.handle.expect(["\$",pexpect.TIMEOUT])
+
+
+
def start_rest(self):
'''
Starts the rest server on ONOS.
@@ -196,23 +207,25 @@
self.execute(cmd="\n",prompt="\$",timeout=10)
tail2 = self.execute(cmd="tail " + self.home + "/onos-logs/onos.*.log",prompt="\$",timeout=10)
pattern = '(.*)1 instance(.*)'
+ patternUp = 'Sending LLDP out'
pattern2 = '(.*)Exception: Connection refused(.*)'
# if utilities.assert_matches(expect=pattern,actual=response,onpass="ONOS process is running...",onfail="ONOS process not running..."):
if re.search(pattern, response):
- main.log.info(self.name + ": ONOS process is running...")
- if tail1 == tail2:
- main.log.error(self.name + ": ONOS is frozen...")#logs aren't moving
- return main.FALSE
- elif re.search( pattern2,tail1 ):
- main.log.info(self.name + ": Connection Refused found in onos log")
- return main.FALSE
- elif re.search( pattern2,tail2 ):
- main.log.info(self.name + ": Connection Refused found in onos log")
- return main.FALSE
- else:
- main.log.info(self.name + ": Onos log is moving! It's looking good!")
- return main.TRUE
+ if re.search(patternUp,tail2):
+ main.log.info(self.name + ": ONOS process is running...")
+ if tail1 == tail2:
+ main.log.error(self.name + ": ONOS is frozen...")#logs aren't moving
+ return main.FALSE
+ elif re.search( pattern2,tail1 ):
+ main.log.info(self.name + ": Connection Refused found in onos log")
+ return main.FALSE
+ elif re.search( pattern2,tail2 ):
+ main.log.info(self.name + ": Connection Refused found in onos log")
+ return main.FALSE
+ else:
+ main.log.info(self.name + ": Onos log is moving! It's looking good!")
+ return main.TRUE
else:
main.log.error(self.name + ": ONOS process not running...")
return main.FALSE
@@ -805,8 +818,8 @@
'''
try:
- main.log.info(self.name + ": Stopping ONOS")
- self.stop()
+ # main.log.info(self.name + ": Stopping ONOS")
+ #self.stop()
self.handle.sendline("cd " + self.home)
self.handle.expect("ONOS\$")
if comp1=="":