blob: a9becf94de85208fe63e138fd0b93cb4bbc08223 [file] [log] [blame]
kavitha Alagesan373e0552016-11-22 05:22:05 +05301"""
2 This wrapper function is use for starting up onos instance
3"""
kavitha Alagesan373e0552016-11-22 05:22:05 +05304import time
5import os
6import json
7
Jon Hall602d0a72017-05-24 16:06:53 -07008
kavitha Alagesan373e0552016-11-22 05:22:05 +05309def onosBuild( main, gitBranch ):
10 """
11 This includes pulling ONOS and building it using maven install
12 """
kavitha Alagesan373e0552016-11-22 05:22:05 +053013 buildResult = main.FALSE
14
15 # Git checkout a branch of ONOS
16 checkOutResult = main.ONOSbench.gitCheckout( gitBranch )
17 # Does the git pull on the branch that was checked out
18 if not checkOutResult:
19 main.log.warn( "Failed to checked out " + gitBranch +
Jon Hall602d0a72017-05-24 16:06:53 -070020 " branch" )
kavitha Alagesan373e0552016-11-22 05:22:05 +053021 else:
22 main.log.info( "Successfully checked out " + gitBranch +
Jon Hall602d0a72017-05-24 16:06:53 -070023 " branch" )
kavitha Alagesan373e0552016-11-22 05:22:05 +053024 gitPullResult = main.ONOSbench.gitPull()
25 if gitPullResult == main.ERROR:
26 main.log.error( "Error pulling git branch" )
27 else:
28 main.log.info( "Successfully pulled " + gitBranch + " branch" )
29
Devin Lim8d7c7782017-06-07 16:21:20 -070030 # buck build
31 buildResult = main.ONOSbench.buckBuild()
kavitha Alagesan373e0552016-11-22 05:22:05 +053032
33 return buildResult