Change functions to match new ONOS scripts
diff --git a/TestON/drivers/common/cli/ramcloudclidriver.py b/TestON/drivers/common/cli/ramcloudclidriver.py
index 2ac7835..e7960d8 100644
--- a/TestON/drivers/common/cli/ramcloudclidriver.py
+++ b/TestON/drivers/common/cli/ramcloudclidriver.py
@@ -63,8 +63,8 @@
if self.handle :
return main.TRUE
else :
- main.log.error("Connection failed to the host "+self.user_name+"@"+self.ip_address)
- main.log.error("Failed to connect to the Onos system")
+ main.log.error(self.name+": Connection failed to the host "+self.user_name+"@"+self.ip_address)
+ main.log.error(self.name+": Failed to connect to the Onos system")
return main.FALSE
@@ -72,7 +72,7 @@
'''
This Function will start RamCloud Servers
'''
- main.log.info( "Starting RAMCloud Server" )
+ main.log.info(self.name+": Starting RAMCloud Server" )
self.handle.sendline("")
self.handle.expect("\$")
self.handle.sendline(self.home + "/onos.sh rc-server start")
@@ -101,19 +101,20 @@
'''
This Function will start RamCloud
'''
- main.log.info( "Starting RAMCloud Coordinator" )
+ main.log.info(self.name+": Starting RAMCloud Coordinator" )
self.handle.sendline("")
self.handle.expect("\$")
self.handle.sendline(self.home + "/onos.sh rc-coord start")
self.handle.expect("onos.sh rc-coord start")
self.handle.expect("\$")
response = self.handle.before + self.handle.after
- time.sleep(5)
- if re.search("Starting\sRAMCloud\scoordinator\s(.*)", response):
- main.log.info("RAMCloud Coordinator Started ")
+ if re.search("Starting\sRAMCloud\scoordinator\s", response):
+ if re.search("Killed\sexisting\sprocess", response):
+ main.log.warn(self.name+": Process was already running, killing existing process")
+ main.log.info(self.name+": RAMCloud Coordinator Started ")
return main.TRUE
else:
- main.log.error("Failed to start RAMCloud Coordinator"+ response)
+ main.log.error(self.name+": Failed to start RAMCloud Coordinator"+ response)
return main.FALSE
def status_serv(self):
@@ -129,30 +130,33 @@
return response
if re.search("0\sRAMCloud\sserver\srunning(.*)") :
- main.log.info("RAMCloud not running")
+ main.log.info(self.name+": RAMCloud not running")
return main.TRUE
elif re.search("1\sRAMCloud\sserver\srunning(.*)"):
- main.log.warn("RAMCloud Running")
+ main.log.warn(self.name+": RAMCloud Running")
return main.TRUE
+ else:
+ main.log.info( self.name+": WARNING: status recieved unknown response")
+ return main.FALSE
def status_coor(self):
'''
This Function will return the Status of the RAMCloud
'''
- time.sleep(5)
self.execute(cmd="\n",prompt="\$",timeout=10)
- response = self.execute(cmd=self.home + "/onos.sh rc-coord status ",prompt="\d+\sramcloud\scoordinator\sis\srunning(.*)",timeout=10)
-
-
+ response = self.execute(cmd=self.home + "/onos.sh rc-coord status ",prompt="\d+\sRAMCloud\scoordinator\srunning",timeout=10)
self.execute(cmd="\n",prompt="\$",timeout=10)
- return response
+ #return response
- if re.search("0\sRAMCloud\scoordinator\sis\srunning(.*)") :
- main.log.info("RAMCloud Coordinator not running")
+ if re.search("0\sRAMCloud\scoordinator\srunning", response) :
+ main.log.warn(self.name+": RAMCloud Coordinator not running")
return main.TRUE
- elif re.search("1\sRAMCloud\scoordinator\sis\srunning(.*)"):
- main.log.warn("RAMCloud Coordinator Running")
+ elif re.search("1\sRAMCloud\scoordinator\srunning", response):
+ main.log.info(self.name+": RAMCloud Coordinator Running")
return main.TRUE
+ else:
+ main.log.warn( self.name+": coordinator status recieved unknown response")
+ return main.FALSE
def stop_serv(self):
'''
@@ -166,7 +170,7 @@
main.log.info("RAMCloud Server Stopped")
return main.TRUE
else:
- main.log.warn("RAMCloud is not Running")
+ main.log.warn(self.name+": RAMCloud is not Running")
return main.FALSE
@@ -176,13 +180,13 @@
'''
self.execute(cmd="\n",prompt="\$",timeout=10)
time.sleep(5)
- response = self.execute(cmd=self.home + "/onos.sh rc-coord stop ",prompt="Killed\sexisting\sprocess(.*)",timeout=10)
+ response = self.execute(cmd=self.home + "/onos.sh rc-coord stop ",prompt="Killed\sexisting\sprocess",timeout=10)
self.execute(cmd="\n",prompt="\$",timeout=10)
- if re.search("Killed\sexisting\sprocess(.*)",response):
- main.log.info("RAMCloud Coordinator Stopped")
+ if re.search("Killed\sexisting\sprocess",response):
+ main.log.info(self.name+": RAMCloud Coordinator Stopped")
return main.TRUE
else:
- main.log.warn("RAMCloud is not Running")
+ main.log.warn(self.name+": RAMCloud was not Running")
def disconnect(self):
'''
@@ -193,7 +197,6 @@
self.handle.sendline("exit")
self.handle.expect("closed")
else :
- main.log.error("Connection failed to the host")
+ main.log.error("Connection failed to the host when trying to disconnect from RAMCloud component")
response = main.FALSE
return response
-