blob: a9c03d59bf168278729c021332965b4610601545 [file] [log] [blame]
Roni Riska364295f2019-09-30 09:39:12 +03001#!/bin/bash
2#
3# Copyright (c) 2019 AT&T Intellectual Property.
4# Copyright (c) 2018-2019 Nokia.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
Roni Riska6ffba082019-11-27 10:59:54 +020018# This source code is part of the near-RT RIC (RAN Intelligent Controller)
19# platform project (RICP).
20#
21
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020022# Install RMR from deb packages at packagecloud.io
Mohamed Abukar33423f92020-12-09 14:16:55 +020023rmr=rmr_4.4.6_amd64.deb
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020024wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmr/download.deb
25sudo dpkg -i $rmr
26rm $rmr
Mohamed Abukar33423f92020-12-09 14:16:55 +020027rmrdev=rmr-dev_4.4.6_amd64.deb
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020028wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmrdev/download.deb
29sudo dpkg -i $rmrdev
30rm $rmrdev
Roni Riska364295f2019-09-30 09:39:12 +030031
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020032# Required to find nng and rmr libs
33export LD_LIBRARY_PATH=/usr/local/lib
34
35# Go install, build, etc
Roni Riska364295f2019-09-30 09:39:12 +030036export GOPATH=$HOME/go
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020037export PATH=$GOPATH/bin:$PATH
38
39# xApp-framework stuff
40export CFG_FILE=$PWD/config/config-file-ut.json
41export RMR_SEED_RT=$PWD/config/uta_rtg.rt
42
43GO111MODULE=on GO_ENABLED=0 GOOS=linux
Roni Riska364295f2019-09-30 09:39:12 +030044
45# Run vesmgr UT
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020046GO111MODULE=on go test -v -p 1 -cover -coverprofile=coverage.out ./...
Roni Riska364295f2019-09-30 09:39:12 +030047
48# setup version tag
49if [ -f container-tag.yaml ]
50then
51 tag=$(grep "tag:" container-tag.yaml | awk '{print $2}')
52else
53 tag="-"
54fi
55
56hash=$(git rev-parse --short HEAD || true)
57
Mohamed Abukar2bfaef02020-12-03 18:20:05 +020058# Install vespamgr
59go install -ldflags "-X main.Version=$tag -X main.Hash=$hash" -v $PWD/cmd/vespamgr