Added ONOS stop function
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 93e1895..bb111b5 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -491,6 +491,44 @@
main.cleanup()
main.exit()
+ def onos_stop(self, node_ip):
+ '''
+ Calls onos command: 'onos-service [<node-ip>] stop'
+ '''
+ try:
+ self.handle.sendline("")
+ self.handle.expect("\$")
+ self.handle.sendline("onos-service "+str(node_ip)+
+ " stop")
+ i = self.handle.expect([
+ "stop/waiting",
+ "Unknown\sinstance",
+ pexpect.TIMEOUT],timeout=60)
+
+ if i == 0:
+ main.log.info("ONOS service stopped")
+ return main.TRUE
+ elif i == 1:
+ main.log.info("Unknown ONOS instance specified: "+
+ str(node_ip))
+ return main.FALSE
+ else:
+ main.log.error("ONOS service failed to stop")
+ return main.FALSE
+
+ 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()
+
+
def isup(self, node = ""):
'''
Run's onos-wait-for-start which only returns once ONOS is at run level 100(ready for use)
diff --git a/TestON/tests/ONOSNextTest/ONOSNextTest.params b/TestON/tests/ONOSNextTest/ONOSNextTest.params
index e97448d..2b3dd0c 100755
--- a/TestON/tests/ONOSNextTest/ONOSNextTest.params
+++ b/TestON/tests/ONOSNextTest/ONOSNextTest.params
@@ -1,6 +1,6 @@
<PARAMS>
- <testcases>1</testcases>
+ <testcases>1,2</testcases>
#Environment variables
<ENV>
diff --git a/TestON/tests/ONOSNextTest/ONOSNextTest.py b/TestON/tests/ONOSNextTest/ONOSNextTest.py
index a49a73d..c27653c 100755
--- a/TestON/tests/ONOSNextTest/ONOSNextTest.py
+++ b/TestON/tests/ONOSNextTest/ONOSNextTest.py
@@ -27,9 +27,10 @@
main.case("Setting up test environment")
- main.step("Using mvn clean & compile")
- clean_install_result = main.ONOSbench.clean_install()
-
+ main.step("Using mvn clean & install")
+ #clean_install_result = main.ONOSbench.clean_install()
+ clean_install_result = main.TRUE
+
main.step("Creating ONOS package")
package_result = main.ONOSbench.onos_package()
@@ -45,10 +46,29 @@
start_result = main.ONOSbench.onos_start(ONOS1_ip)
case1_result = (clean_install_result and package_result and\
- cell_result and verify_result and onos_install_result\
- and onos1_isup and start_result)
+ cell_result and verify_result and onos_install_result and\
+ onos1_isup and start_result)
utilities.assert_equals(expect=main.TRUE, actual=case1_result,
onpass="Test startup successful",
onfail="Test startup NOT successful")
+ def CASE2(self, main):
+ '''
+ Cleanup sequence:
+ onos-service <node_ip> stop
+ onos-uninstall
+
+ TODO: Define rest of cleanup
+
+ '''
+
+ ONOS1_ip = main.params['CTRL']['ip1']
+
+ main.case("Cleaning up test environment")
+
+ main.step("Stopping ONOS service")
+ stop_result = main.ONOSbench.onos_stop(ONOS1_ip)
+
+ main.step("Uninstalling ONOS service")
+