added onos start function
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 8e62200..914ce45 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -379,6 +379,8 @@
'''
Calls 'onos-verify-cell' to check for cell installation
'''
+ #TODO: Add meaningful expect value
+
try:
#Clean handle by sending empty and expecting $
self.handle.sendline("")
@@ -409,3 +411,46 @@
main.cleanup()
main.exit()
+ def onos_start(self, node_ip):
+ '''
+ Calls onos command: 'onos-service [<node-ip>] start'
+ '''
+
+ try:
+ self.handle.sendline("")
+ self.handle.expect("\$")
+ self.handle.sendline("onos-service "+str(node_ip)+
+ " start")
+ i = self.handle.expect([
+ "Job\sis\salready\srunning",
+ "start/running",
+ "Unknown\sinstance",
+ pexpect.TIMEOUT],timeout=60)
+
+ if i == 0:
+ main.log.info("Service is already running")
+ return main.TRUE
+ elif i == 1:
+ main.log.info("ONOS service started")
+ return main.TRUE
+ else:
+ main.log.error("ONOS service failed to start")
+ main.cleanup()
+ main.exit()
+
+ except pexpect.EOF:
+ main.log.error(self.name + ": EOF exception found")
+ main.log.error(self.name + ": " + self.handle.before)
+ main.cleanup()
+ main.exit()
+ except:
+ main.log.info(self.name+" ::::::")
+ main.log.error( traceback.print_exc())
+ main.log.info(self.name+" ::::::")
+ main.cleanup()
+ main.exit()
+
+
+
+
+
diff --git a/TestON/tests/ONOSNextTest/ONOSNextTest.py b/TestON/tests/ONOSNextTest/ONOSNextTest.py
index 08b224b..9e790a5 100755
--- a/TestON/tests/ONOSNextTest/ONOSNextTest.py
+++ b/TestON/tests/ONOSNextTest/ONOSNextTest.py
@@ -24,14 +24,26 @@
cell_name = main.params['ENV']['cellName']
ONOS1_ip = main.params['CTRL']['ip1']
-
+
+ main.case("Setting up test environment")
+
+ main.step("Using mvn clean & compile")
install_result = main.ONOSbench.clean_install()
+
+ main.step("Creating ONOS package")
package_result = main.ONOSbench.onos_package()
+
+ main.step("Applying cell variable to environment")
cell_result = main.ONOSbench.set_cell(cell_name)
verify_result = main.ONOSbench.verify_cell()
+
+ main.step("Starting ONOS service")
+ start_result = main.ONOSbench.onos_start(ONOS1_ip)
+
+
case1_result = (install_result and package_result and\
- cell_result and verify_result)
+ cell_result and verify_result and start_result)
utilities.assert_equals(expect=main.TRUE, actual=case1_result,
onpass="Test startup successful",
onfail="Test startup NOT successful")
diff --git a/TestON/tests/ONOSNextTest/ONOSNextTest.topo b/TestON/tests/ONOSNextTest/ONOSNextTest.topo
index 5cb178f..a5c6237 100755
--- a/TestON/tests/ONOSNextTest/ONOSNextTest.topo
+++ b/TestON/tests/ONOSNextTest/ONOSNextTest.topo
@@ -2,7 +2,7 @@
<COMPONENT>
<ONOSbench>
- <host>10.128.30.10</host>
+ <host>10.128.20.10</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosDriver</type>
@@ -11,7 +11,7 @@
</ONOSbench>
<ONOS1>
- <host>10.128.30.11</host>
+ <host>10.128.20.11</host>
<user>sdn</user>
<password>sdn</password>
<type>OnosDriver</type>
@@ -20,7 +20,7 @@
</ONOS1>
<Mininet1>
- <host>10.128.11.11</host>
+ <host>10.128.10.90</host>
<user>admin</user>
<password>onos_test</password>
<type>MininetCliDriver</type>