Fix bug with onos.sh usage. CD to folder then call from there
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 3dff2e2..eef7a0b 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -75,7 +75,8 @@
try:
self.handle.sendline("")
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
- self.handle.sendline(self.home + "/onos.sh core start")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh core start")
i=self.handle.expect(["STARTED","FAILED",pexpect.EOF,pexpect.TIMEOUT])
response = self.handle.before + str(self.handle.after)
if i==0:
@@ -127,7 +128,8 @@
Starts the rest server on ONOS.
'''
try:
- response = self.execute(cmd= self.home + "/start-rest.sh start",prompt="\$",timeout=10)
+ self.handle.sendline("cd "+self.home)
+ response = self.execute(cmd= "./start-rest.sh start",prompt="\$",timeout=10)
if re.search("admin",response):
main.log.info(self.name + ": Rest Server Started Successfully")
time.sleep(5)
@@ -153,7 +155,8 @@
'''
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)
+ self.handle.sendline("cd "+self.home)
+ response = self.execute(cmd="./onos.sh core status ",prompt="\d+\sinstance\sof\sonos\srunning",timeout=10)
self.execute(cmd="\n",prompt="\$",timeout=10)
if re.search("1\sinstance\sof\sonos\srunning",response):
return main.TRUE
@@ -185,7 +188,8 @@
'''
try:
self.execute(cmd="\n",prompt="\$",timeout=10)
- response = self.execute(cmd= self.home + "/onos.sh core status ",prompt="running",timeout=10)
+ self.handle.sendline("cd "+self.home)
+ response = self.execute(cmd= "./onos.sh core status ",prompt="running",timeout=10)
self.execute(cmd="\n",prompt="\$",timeout=10)
tail1 = self.execute(cmd="tail " + self.home + "/onos-logs/onos.*.log",prompt="\$",timeout=10)
time.sleep(30)
@@ -261,7 +265,8 @@
try:
self.handle.sendline("")
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
- self.handle.sendline(self.home + "/onos.sh core stop")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh core stop")
i=self.handle.expect(["Stop",pexpect.EOF,pexpect.TIMEOUT])
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT], 60)
result = self.handle.before
@@ -377,7 +382,7 @@
main.cleanup()
main.exit()
- def add_flow(self, testONip, user, password, flowDef):
+ def add_flow(self, testONip, user = "admin", password = "", flowDef = "/flowdef.txt"):
'''
Copies the flowdef file from TestStation -> ONOS machine
Then runs ./add_flow.py to add the flows to ONOS
diff --git a/TestON/drivers/common/cli/ramcloudclidriver.py b/TestON/drivers/common/cli/ramcloudclidriver.py
index a96b8d5..6f13cb5 100644
--- a/TestON/drivers/common/cli/ramcloudclidriver.py
+++ b/TestON/drivers/common/cli/ramcloudclidriver.py
@@ -75,7 +75,8 @@
main.log.info(self.name+": Starting RAMCloud Server" )
self.handle.sendline("")
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
- self.handle.sendline(self.home + "/onos.sh rc-server start")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh rc-server start")
self.handle.expect(["onos.sh rc-server start",pexpect.EOF,pexpect.TIMEOUT])
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
response = self.handle.before + self.handle.after
@@ -104,7 +105,8 @@
main.log.info(self.name+": Starting RAMCloud Coordinator" )
self.handle.sendline("")
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
- self.handle.sendline(self.home + "/onos.sh rc-coord start")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh rc-coord start")
self.handle.expect(["onos.sh rc-coord start",pexpect.EOF,pexpect.TIMEOUT])
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
response = self.handle.before + self.handle.after
@@ -124,7 +126,8 @@
main.log.info(self.name + ": Getting RC-Server Status")
self.handle.sendline("")
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
- self.handle.sendline(self.home + "/onos.sh rc-server status")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh rc-server status")
self.handle.expect(["onos.sh rc-server status",pexpect.EOF,pexpect.TIMEOUT])
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
response = self.handle.before + self.handle.after
@@ -146,7 +149,8 @@
main.log.info(self.name + ": Getting RC-Coord Status")
self.handle.sendline("")
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
- self.handle.sendline(self.home + "/onos.sh rc-coord status")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh rc-coord status")
i=self.handle.expect(["onos.sh rc-coord status",pexpect.EOF,pexpect.TIMEOUT])
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
response = self.handle.before + self.handle.after
@@ -169,7 +173,8 @@
main.log.info(self.name + ": Stopping RC-Server")
self.handle.sendline("")
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
- self.handle.sendline(self.home + "/onos.sh rc-server stop")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh rc-server stop")
self.handle.expect(["onos.sh rc-server stop",pexpect.EOF,pexpect.TIMEOUT])
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
response = self.handle.before + self.handle.after
@@ -188,7 +193,8 @@
main.log.info(self.name + ": Stopping RC-Coord")
self.handle.sendline("")
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
- self.handle.sendline(self.home + "/onos.sh rc-coord stop")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline( "./onos.sh rc-coord stop")
self.handle.expect(["onos.sh rc-coord stop",pexpect.EOF,pexpect.TIMEOUT])
self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
response = self.handle.before + self.handle.after
diff --git a/TestON/drivers/common/cli/zookeeperclidriver.py b/TestON/drivers/common/cli/zookeeperclidriver.py
index b7fe4ba..752df44 100644
--- a/TestON/drivers/common/cli/zookeeperclidriver.py
+++ b/TestON/drivers/common/cli/zookeeperclidriver.py
@@ -49,7 +49,8 @@
self.port = None
for key in connectargs:
vars(self)[key] = connectargs[key]
- self.home = "~/zookeeper-3.4.5"
+ self.home = "~/ONOS"
+ #self.home = "~/zookeeper-3.4.5"
for key in self.options:
if key == "home":
self.home = self.options['home']
@@ -74,8 +75,9 @@
main.log.info(self.name + ": Starting Zookeeper" )
self.handle.sendline("")
self.handle.expect("\$")
- self.handle.sendline(self.home + "/bin/zkServer.sh start")
- self.handle.expect("zkServer.sh start")
+ self.handle.sendline("cd "+self.home)
+ self.handle.sendline("./onos.sh zk start")
+ self.handle.expect("zk start")
self.handle.expect("\$")
response = self.handle.before + self.handle.after
if re.search("STARTED", response):
@@ -94,7 +96,8 @@
'''
time.sleep(5)
self.execute(cmd="\n",prompt="\$",timeout=10)
- response = self.execute(cmd=self.home + "/bin/zkServer.sh status ",prompt="JMX",timeout=10)
+ self.handle.sendline("cd "+self.home)
+ response = self.execute(cmd="./onos.sh zk status ",prompt="JMX",timeout=10)
self.execute(cmd="\n",prompt="\$",timeout=10)
return response
@@ -105,9 +108,9 @@
'''
self.execute(cmd="\n",prompt="\$",timeout=10)
time.sleep(5)
- response = self.execute(cmd=self.home + "/bin/zkServer.sh stop ",prompt="STOPPED",timeout=10)
- self.execute(cmd="\n",prompt="\$",timeout=10)
- if re.search("STOPPED",response):
+ self.handle.sendline("cd "+self.home)
+ response = self.execute(cmd="./onos.sh zk stop ",prompt="$",timeout=10)
+ if re.search("stopping",response):
main.log.info(self.name + ": Zookeeper Stopped")
return main.TRUE
else: