X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Funit_test.sh;h=350e58a23d504e1cffd2d12885756879551001ce;hb=4a4be152a02505f732a92caa2a5592f2ec70b9ae;hp=e9af17c62e3392bf40a801e91d4be67660903801;hpb=c0421fee45d07243f1cc3b2250bd66600f15aac7;p=o-du%2Fl2.git diff --git a/test/unit_test.sh b/test/unit_test.sh index e9af17c62..350e58a23 100644 --- a/test/unit_test.sh +++ b/test/unit_test.sh @@ -1 +1,24 @@ -sudo apt install -y libsctp-dev;cd odu;make clean_odu MACHINE=BIT64 MODE=TDD;make odu MACHINE=BIT64 MODE=TDD COVERAGE=1 +#!/bin/bash + +set -euxo pipefail + +echo "---> unit_test.sh" + +echo "Present working directory: "; pwd + +# Platform-specific install methods +if (grep Ubuntu /etc/os-release > /dev/null 2>&1); then + echo "Installing libsctp-dev dependency for Ubuntu" + sudo apt-get update + sudo apt-get install -y libsctp-dev +elif (grep RedHat /etc/os-release > /dev/null 2>&1) || \ + (grep CentOS /etc/os-release > /dev/null 2>&1); then + echo "Installing lksctp-tools-devel dependency for CentOS/RedHat" + sudo yum install -y lksctp-tools-devel +else + echo "Unmatched OS/Distribution" + echo "Missing sctp library not installed" +fi + +echo "Running job" +cd odu;make clean_odu MACHINE=BIT64 MODE=TDD;make odu MACHINE=BIT64 MODE=TDD COVERAGE=1