summaryrefslogtreecommitdiffstats
path: root/ci/envs/utils.sh
diff options
context:
space:
mode:
authorkalyanreddy <reddyx.gundarapu@intel.com>2016-09-07 19:14:05 +0530
committerkalyanreddy <reddyx.gundarapu@intel.com>2016-09-08 15:21:26 +0530
commit3dbc3510f0107b73c1d3943937218d2dcf5353b3 (patch)
tree7fb35a34410f713e300943fd4ebe95b2868237a9 /ci/envs/utils.sh
parent0ed5bc19d7d51b7bf1a689bab1f356b1a2d7f6bd (diff)
This patch contains the scripts to remove hardcoded kernel version,
host ip and cleaning of the host machine after execution of cyclictest. Change-Id: I92aaed5229fc3c572e74dcce03b2c984ae1bb111 Co-Authored-By: Shravani <shravani.p@tcs.com> Signed-off-by: Gundarapu Kalyan Reddy <reddyx.gundarapu@intel.com>
Diffstat (limited to 'ci/envs/utils.sh')
-rwxr-xr-xci/envs/utils.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/ci/envs/utils.sh b/ci/envs/utils.sh
new file mode 100755
index 000000000..f582b5aac
--- /dev/null
+++ b/ci/envs/utils.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+###############################################################################
+# This script is to fetch kernel version and host ip at run time.
+###############################################################################
+
+#To get the Kernel version from RPM generated(example:kernel-4.4.6_rt14_1607061504nfv-3.x86_64.rpm)
+function getKernelVersion {
+ rpm_dir="/root/workspace/rpm/"
+ if [ -d "$WORKSPACE" ];then
+ cd $WORKSPACE/build_output 2>/dev/null; kernelRPM=`ls kernel-[[:digit:]]* 2>/dev/null`
+ RPMVERSION=`echo ${kernelRPM}|awk -F '_' '{print $1}' | awk -F '-' '{print $NF}'`
+ elif [ -d "$rpm_dir" ];then
+ cd $rpm_dir 2>/dev/null; kernelRPM=`ls kernel-[[:digit:]]* 2>/dev/null`
+ RPMVERSION=`echo ${kernelRPM}|awk -F '_' '{print $1}' | awk -F '-' '{print $NF}'`
+ fi
+ echo ${RPMVERSION}
+}
+
+#Get the IP address from pod.yaml file (example ip : 10.2.117.23)
+function getHostIP {
+ HOST_IP=`grep 'ip' $WORKSPACE/tests/pod.yaml | awk -F ': ' '{print $NF}' | tail -1`
+ echo $HOST_IP
+}