Roni Riska | 364295f | 2019-09-30 09:39:12 +0300 | [diff] [blame] | 1 | #!/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 Riska | 6ffba08 | 2019-11-27 10:59:54 +0200 | [diff] [blame] | 18 | # This source code is part of the near-RT RIC (RAN Intelligent Controller) |
| 19 | # platform project (RICP). |
| 20 | # |
| 21 | |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 22 | # Install RMR from deb packages at packagecloud.io |
Mohamed Abukar | 33423f9 | 2020-12-09 14:16:55 +0200 | [diff] [blame] | 23 | rmr=rmr_4.4.6_amd64.deb |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 24 | wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmr/download.deb |
| 25 | sudo dpkg -i $rmr |
| 26 | rm $rmr |
Mohamed Abukar | 33423f9 | 2020-12-09 14:16:55 +0200 | [diff] [blame] | 27 | rmrdev=rmr-dev_4.4.6_amd64.deb |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 28 | wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmrdev/download.deb |
| 29 | sudo dpkg -i $rmrdev |
| 30 | rm $rmrdev |
Roni Riska | 364295f | 2019-09-30 09:39:12 +0300 | [diff] [blame] | 31 | |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 32 | # Required to find nng and rmr libs |
| 33 | export LD_LIBRARY_PATH=/usr/local/lib |
| 34 | |
| 35 | # Go install, build, etc |
Roni Riska | 364295f | 2019-09-30 09:39:12 +0300 | [diff] [blame] | 36 | export GOPATH=$HOME/go |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 37 | export PATH=$GOPATH/bin:$PATH |
| 38 | |
| 39 | # xApp-framework stuff |
| 40 | export CFG_FILE=$PWD/config/config-file-ut.json |
| 41 | export RMR_SEED_RT=$PWD/config/uta_rtg.rt |
| 42 | |
| 43 | GO111MODULE=on GO_ENABLED=0 GOOS=linux |
Roni Riska | 364295f | 2019-09-30 09:39:12 +0300 | [diff] [blame] | 44 | |
| 45 | # Run vesmgr UT |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 46 | GO111MODULE=on go test -v -p 1 -cover -coverprofile=coverage.out ./... |
Roni Riska | 364295f | 2019-09-30 09:39:12 +0300 | [diff] [blame] | 47 | |
| 48 | # setup version tag |
| 49 | if [ -f container-tag.yaml ] |
| 50 | then |
| 51 | tag=$(grep "tag:" container-tag.yaml | awk '{print $2}') |
| 52 | else |
| 53 | tag="-" |
| 54 | fi |
| 55 | |
| 56 | hash=$(git rev-parse --short HEAD || true) |
| 57 | |
Mohamed Abukar | 2bfaef0 | 2020-12-03 18:20:05 +0200 | [diff] [blame] | 58 | # Install vespamgr |
| 59 | go install -ldflags "-X main.Version=$tag -X main.Hash=$hash" -v $PWD/cmd/vespamgr |