blob: fcc0bdd7e10eb5c49f8cab6272a3059501b1a5ab [file] [log] [blame]
andrewonlab4a5c4472014-10-09 12:11:41 -04001
2#Testing the basic functionality of ONOS Next
3#For sanity and driver functionality excercises only.
4
andrewonlab7735d852014-10-09 13:02:47 -04005import time
6import sys
7import os
8
andrewonlab4a5c4472014-10-09 12:11:41 -04009class ONOSNextTest:
10 def __init__(self):
11 self.default = ''
12
13 def CASE1(self, main):
14 '''
15 Startup sequence:
16 git pull
17 mvn clean install
18 onos-package
19 cell <name>
20 onos-verify-cell
21 onos-install -f
22 onos-wait-for-start
23 '''
andrewonlab7735d852014-10-09 13:02:47 -040024
andrewonlab084307e2014-10-09 14:06:09 -040025 cell_name = main.params['ENV']['cellName']
26 ONOS1_ip = main.params['CTRL']['ip1']
Jon Hallea7818b2014-10-09 14:30:59 -040027
andrewonlab8d0d7d72014-10-09 16:33:15 -040028 main.case("Setting up test environment")
29
andrewonlab2b30bd32014-10-09 16:48:55 -040030 main.step("Using mvn clean & install")
31 #clean_install_result = main.ONOSbench.clean_install()
32 clean_install_result = main.TRUE
33
andrewonlab8d0d7d72014-10-09 16:33:15 -040034 main.step("Creating ONOS package")
andrewonlab7735d852014-10-09 13:02:47 -040035 package_result = main.ONOSbench.onos_package()
andrewonlab8d0d7d72014-10-09 16:33:15 -040036
37 main.step("Applying cell variable to environment")
andrewonlab084307e2014-10-09 14:06:09 -040038 cell_result = main.ONOSbench.set_cell(cell_name)
andrewonlabc03bf6c2014-10-09 14:56:18 -040039 verify_result = main.ONOSbench.verify_cell()
andrewonlab2fe32ad2014-10-09 16:36:40 -040040
41 main.step("Installing ONOS package")
Jon Hall7993bfc2014-10-09 16:30:14 -040042 onos_install_result = main.ONOSbench.onos_install()
43 onos1_isup = main.ONOSbench.isup()
andrewonlab8d0d7d72014-10-09 16:33:15 -040044
45 main.step("Starting ONOS service")
46 start_result = main.ONOSbench.onos_start(ONOS1_ip)
47
Jon Hall7993bfc2014-10-09 16:30:14 -040048 case1_result = (clean_install_result and package_result and\
andrewonlab2b30bd32014-10-09 16:48:55 -040049 cell_result and verify_result and onos_install_result and\
50 onos1_isup and start_result)
andrewonlab0748d2a2014-10-09 13:24:17 -040051 utilities.assert_equals(expect=main.TRUE, actual=case1_result,
52 onpass="Test startup successful",
53 onfail="Test startup NOT successful")
andrewonlab4a5c4472014-10-09 12:11:41 -040054
andrewonlab2b30bd32014-10-09 16:48:55 -040055 def CASE2(self, main):
56 '''
57 Cleanup sequence:
58 onos-service <node_ip> stop
59 onos-uninstall
60
61 TODO: Define rest of cleanup
62
63 '''
64
65 ONOS1_ip = main.params['CTRL']['ip1']
66
67 main.case("Cleaning up test environment")
68
andrewonlab057c06a2014-10-09 17:19:21 -040069 main.step("Testing ONOS kill function")
70 kill_result = main.ONOSbench.onos_kill(ONOS1_ip)
71
andrewonlab2b30bd32014-10-09 16:48:55 -040072 main.step("Stopping ONOS service")
73 stop_result = main.ONOSbench.onos_stop(ONOS1_ip)
74
75 main.step("Uninstalling ONOS service")
andrewonlab057c06a2014-10-09 17:19:21 -040076 uninstall_result = main.ONOSbench.onos_uninstall()
andrewonlab4a5c4472014-10-09 12:11:41 -040077