andrewonlab | 4a5c447 | 2014-10-09 12:11:41 -0400 | [diff] [blame] | 1 | |
| 2 | #Testing the basic functionality of ONOS Next |
| 3 | #For sanity and driver functionality excercises only. |
| 4 | |
andrewonlab | 7735d85 | 2014-10-09 13:02:47 -0400 | [diff] [blame] | 5 | import time |
| 6 | import sys |
| 7 | import os |
| 8 | |
andrewonlab | 4a5c447 | 2014-10-09 12:11:41 -0400 | [diff] [blame] | 9 | class 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 | ''' |
andrewonlab | 7735d85 | 2014-10-09 13:02:47 -0400 | [diff] [blame] | 24 | |
andrewonlab | 084307e | 2014-10-09 14:06:09 -0400 | [diff] [blame] | 25 | cell_name = main.params['ENV']['cellName'] |
| 26 | ONOS1_ip = main.params['CTRL']['ip1'] |
Jon Hall | ea7818b | 2014-10-09 14:30:59 -0400 | [diff] [blame] | 27 | |
andrewonlab | 8d0d7d7 | 2014-10-09 16:33:15 -0400 | [diff] [blame] | 28 | main.case("Setting up test environment") |
| 29 | |
| 30 | main.step("Using mvn clean & compile") |
Jon Hall | 7993bfc | 2014-10-09 16:30:14 -0400 | [diff] [blame] | 31 | clean_install_result = main.ONOSbench.clean_install() |
andrewonlab | 8d0d7d7 | 2014-10-09 16:33:15 -0400 | [diff] [blame] | 32 | |
| 33 | main.step("Creating ONOS package") |
andrewonlab | 7735d85 | 2014-10-09 13:02:47 -0400 | [diff] [blame] | 34 | package_result = main.ONOSbench.onos_package() |
andrewonlab | 8d0d7d7 | 2014-10-09 16:33:15 -0400 | [diff] [blame] | 35 | |
| 36 | main.step("Applying cell variable to environment") |
andrewonlab | 084307e | 2014-10-09 14:06:09 -0400 | [diff] [blame] | 37 | cell_result = main.ONOSbench.set_cell(cell_name) |
andrewonlab | c03bf6c | 2014-10-09 14:56:18 -0400 | [diff] [blame] | 38 | verify_result = main.ONOSbench.verify_cell() |
andrewonlab | 2fe32ad | 2014-10-09 16:36:40 -0400 | [diff] [blame^] | 39 | |
| 40 | main.step("Installing ONOS package") |
Jon Hall | 7993bfc | 2014-10-09 16:30:14 -0400 | [diff] [blame] | 41 | onos_install_result = main.ONOSbench.onos_install() |
| 42 | onos1_isup = main.ONOSbench.isup() |
andrewonlab | 8d0d7d7 | 2014-10-09 16:33:15 -0400 | [diff] [blame] | 43 | |
| 44 | main.step("Starting ONOS service") |
| 45 | start_result = main.ONOSbench.onos_start(ONOS1_ip) |
| 46 | |
Jon Hall | 7993bfc | 2014-10-09 16:30:14 -0400 | [diff] [blame] | 47 | case1_result = (clean_install_result and package_result and\ |
| 48 | cell_result and verify_result and onos_install_result\ |
andrewonlab | 2fe32ad | 2014-10-09 16:36:40 -0400 | [diff] [blame^] | 49 | and onos1_isup and start_result) |
andrewonlab | 0748d2a | 2014-10-09 13:24:17 -0400 | [diff] [blame] | 50 | utilities.assert_equals(expect=main.TRUE, actual=case1_result, |
| 51 | onpass="Test startup successful", |
| 52 | onfail="Test startup NOT successful") |
andrewonlab | 4a5c447 | 2014-10-09 12:11:41 -0400 | [diff] [blame] | 53 | |
| 54 | |