blob: 170a43b7cfd5f7afde461b2be1bf35415533468b [file] [log] [blame]
andrewonlab2a6c9342014-10-16 13:40:15 -04001#TopoPerfNext
2#
3#Topology Performance test for ONOS-next
4#
5#andrew@onlab.us
6
7import time
8import sys
9import os
10import re
11
12class TopoPerfNext:
13 def __init__(self):
14 self.default = ''
15
16 def CASE1(self, main):
17 '''
18 ONOS startup sequence
19 '''
20 cell_name = main.params['ENV']['cellName']
21
22 git_pull = main.params['GIT']['autoPull']
23 checkout_branch = main.params['GIT']['checkout']
24
25 ONOS1_ip = main.params['CTRL']['ip1']
26 MN1_ip = main.params['MN']['ip1']
27 BENCH_ip = main.params['BENCH']['ip']
28
29 main.case("Setting up test environment")
30
31 main.step("Creating cell file")
32 cell_file_result = main.ONOSbench.create_cell_file(
33 BENCH_ip, cell_name, MN1_ip, ONOS1_ip)
34
35 main.step("Applying cell file to environment")
36 cell_apply_result = main.ONOSbench.set_cell(cell_name)
37 verify_cell_result = main.ONOSbench.verify_cell()
38
39 main.step("Git checkout and pull "+checkout_branch)
40 if git_pull == 'on':
41 checkout_result = \
42 main.ONOSbench.git_checkout(checkout_branch)
43 pull_result = main.ONOSbench.git_pull()
44 else:
45 checkout_result = main.TRUE
46 pull_result = main.TRUE
47 main.log.info("Skipped git checkout and pull")
48
49 main.step("Using mvn clean & install")
50 if git_pull == 'on':
51 mvn_result = main.ONOSbench.clean_install()
52 else:
53 mvn_result = main.TRUE
54 main.log.info("Skipped mvn clean compile")
55
56 main.step("Creating ONOS package")
57 package_result = main.ONOSbench.onos_package()
58
59 main.step("Installing ONOS package")
60 install_result = main.ONOSbench.onos_install()
61
62 main.step("Starting ONOS service")
63 start_result = main.ONOSbench.onos_start(ONOS1_ip)
64
65 utilities.assert_equals(expect=main.TRUE,
66 actual= cell_file_result and cell_apply_result and\
67 verify_cell_result and checkout_result and\
68 pull_result and mvn_result and\
69 install_result and start_result,
70 onpass="Cell file created successfully",
71 onfail="Failed to create cell file")
72
73