blob: 01474eea4991480f45b8b6ec37eb9364263ad74c [file] [log] [blame]
garciadeblas17edada2016-09-07 15:36:25 +02001#!/bin/bash
garciadeblasf937a8b2016-07-21 14:53:32 +02002#
garciadeblasee04b452016-09-19 18:07:40 +02003# Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
4#
garciadeblasf937a8b2016-07-21 14:53:32 +02005# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
garciadeblasee04b452016-09-19 18:07:40 +020017# Authors:
18# - Gerardo Garcia - gerardo.garciadeblas@telefonica.com
garciadeblasf937a8b2016-07-21 14:53:32 +020019#
20
21HERE=$(realpath $(dirname $0))
22OSM_JENKINS=$(dirname $HERE)
23. $OSM_JENKINS/common/all_funcs
24
25# SET YOU MDG repository name here
26export OSM_MDG=RO
27OSM_load_config
garciadeblasb9aec3e2017-01-20 14:28:17 +010028
29NOTEST=""
garciadeblasbb3e62c2017-01-21 18:08:26 +010030if [ "$1" = "--notest" ]; then
garciadeblasb9aec3e2017-01-20 14:28:17 +010031 shift
32 NOTEST="y"
33fi
34
Jeremy Mordkoff35d6f242016-10-06 16:17:05 -070035OSM_git_checkout "$@"
garciadeblasf937a8b2016-07-21 14:53:32 +020036
garciadeblasb9aec3e2017-01-20 14:28:17 +010037INFO "installing RO packages and dependencies from current repo (--noclone)"
38./scripts/install-openmano.sh --noclone --force -q
39RC=$?
40
41if [ -n "$NOTEST" ]; then
42 INFO "done, RC=$RC"
43 exit $RC
44fi
garciadeblasf937a8b2016-07-21 14:53:32 +020045
garciadeblasf937a8b2016-07-21 14:53:32 +020046INFO "starting build"
47
garciadeblasee04b452016-09-19 18:07:40 +020048INFO " cleaning .pyc"
garciadeblas3c158592016-09-20 17:11:49 +020049rm -f *.pyc
garciadeblas2e9b8142016-12-23 13:37:05 +010050
garciadeblasee04b452016-09-19 18:07:40 +020051INFO " compiling *.py"
garciadeblas2e9b8142016-12-23 13:37:05 +010052TEMPFILE="$(mktemp -q -p . "openmanolinker.XXXXXX.py")"
53trap 'rm -f "$TEMPFILE"' EXIT
54for i in `ls vimconn_*.py |sed "s/\.py//"`; do echo "import $i" >> $TEMPFILE; done
55
56python $TEMPFILE &&
tierno0c71f002017-04-05 21:16:10 +020057python -m py_compile *.py # &&
garciadeblas2e9b8142016-12-23 13:37:05 +010058
tierno0c71f002017-04-05 21:16:10 +020059#INFO " basic_test" &&
60#./test/basictest.sh --force --insert-bashrc --install-openvim --init-openvim #&& #uncomment to add new tests
garciadeblas2e9b8142016-12-23 13:37:05 +010061# OTHER TESTS HERE
tiernoa9c9efe2016-09-23 12:27:04 +020062
garciadeblasa8cbb912016-08-31 14:47:41 +020063RC=$?
garciadeblasf937a8b2016-07-21 14:53:32 +020064INFO "done, RC=$RC"
65exit $RC
66
67