X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=ci%2Fenvs%2Futils.sh;h=c2c0f85a6cc28cbd8c96910c48b1c893ae493d1b;hb=c3893858bf09f4cca8850fb9b0f59f1a050f6b38;hp=5db55bef83bfdbcd3d7565ef8ec712ba1773977a;hpb=2c8605dc1647ee6a7b7a76c952d2adc6f68be989;p=kvmfornfv.git diff --git a/ci/envs/utils.sh b/ci/envs/utils.sh index 5db55bef8..c2c0f85a6 100755 --- a/ci/envs/utils.sh +++ b/ci/envs/utils.sh @@ -16,7 +16,7 @@ function getKernelVersion { echo ${RPMVERSION} } -#Get the IP address from pod.yaml file (example ip : 10.2.117.23) +#Get the IP address from pod.yaml file (example ip : 10.10.100.22) function getHostIP { host_dir="/root/workspace/scripts/" container_dir="/opt/scripts/" @@ -27,3 +27,28 @@ function getHostIP { fi echo $HOST_IP } +#Get the Qemu version from RPM generated(example:qemu-2.6.0-1.x86_64.rpm) +function getQemuVersion { + rpm_dir="/root/workspace/rpm/" + if [ -d "$WORKSPACE" ];then + cd $WORKSPACE/build_output 2>/dev/null; qemuRPM=`ls qemu-[[:digit:]]* 2>/dev/null` + RPMVERSION=`echo ${qemuRPM}|awk -F '-' '{print $2}' | awk -F '-' '{print $NF}'` + elif [ -d "$rpm_dir" ];then + cd $rpm_dir 2>/dev/null; qemuRPM=`ls qemu-[[:digit:]]* 2>/dev/null` + RPMVERSION=`echo ${qemuRPM}|awk -F '-' '{print $2}' | awk -F '-' '{print $NF}'` + fi + echo ${RPMVERSION} +} +#Check RPM names to continue the execution of testcases +function checkRPMNames { + rpm_dir="/root/workspace/rpm" + if [ -d "$WORKSPACE" ];then + cd $WORKSPACE/build_output 2>/dev/null;RPMCOUNT=`ls kvmfornfv-* 2>/dev/null | wc -l` + if [ $RPMCOUNT -ne 0 ];then + echo "Testcases are not executed for apex_build" + exit 0 + else + echo "Continue test execution" + fi + fi +}