diff options
author | 2018-10-09 14:59:08 +0530 | |
---|---|---|
committer | 2018-10-09 19:21:12 +0530 | |
commit | dd82eab81846cbccaa1ab84c5a9919dc0b41f9c9 (patch) | |
tree | 9faf3b5ef55c58541b6cb6d50e3639b69c06af60 /scripts/csit/template.sh | |
parent | 31ea86798426cf236d70c9de1944c723a6cb1d95 (diff) |
Feat: Migration of CSIT scripts to DMM repo
Change-Id: I4b38cbc9c1d801e3c91ff3d4dd8fed7e747db46e
Signed-off-by: sharath <sharathkumarboyanapally@gmail.com>
Diffstat (limited to 'scripts/csit/template.sh')
-rw-r--r-- | scripts/csit/template.sh | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/scripts/csit/template.sh b/scripts/csit/template.sh new file mode 100644 index 0000000..106167c --- /dev/null +++ b/scripts/csit/template.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +set -x +################################################# +# Store arguments values +# verify, log, cleanup actions gets first two arguments + +action=$1 #action: [setup, run, verify, cleanup] +node=$2 #node: [0 - dut1 node, 1 - dut2 node] +ifname=$3 #dut1 interface name when node is 0 /dut2 interface name when node is 1 +dut1_if_ip=$4 #dut1 interface ip +dut2_if_ip=$5 #dut2 interface ip + +################################################# +# Get path details + +RUN_DIR=`dirname $(readlink -f $0)` +CSIT_SCRIPT_DIR=$RUN_DIR/.. +ROOTDIR=$CSIT_SCRIPT_DIR/../../../ +APP_DIR=${ROOTDIR}/dmm/config/app_test +LIB_PATH=${ROOTDIR}/dmm/release/lib64 +DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts + +################################################# +# Setup preparation + +if [ "x$action" == "xsetup" ]; then + #Handle setup preparation here + echo "performing setup" +fi + +################################################# +# Execution + +if [ "x$action" == "xrun" ]; then + # Call your executables here to run the test case + if [ "x$node" == "x0" ]; then + #call server executable + echo "server execution " + elif [ "x$node" == "x1" ]; then + #call client executable + echo "client execution" + fi +fi + +################################################# +# Verification + +if [ "x$action" == "xverify" ]; then + if [ "x$node" == "x1" ]; then + #Handle client verification + if [ $? == 0 ]; then + echo "DMM_CSIT_TEST_PASSED" #must echo this + else + echo "DMM_CSIT_TEST_FAILED" + fi + elif [ "x$node" == "x0" ]; then + #Handle server verification + if [ $? == 0 ]; then + echo "DMM_CSIT_TEST_PASSED" #must echo this + else + echo "DMM_CSIT_TEST_FAILED" + fi + fi +fi + +################################################# +# Print Log + +if [ "x$action" == "xlog" ]; then + #Handle print log + echo "DMM logs" +fi + +################################################# +# Cleanup + +if [ "x$action" == "xcleanup" ]; then + #Handle cleanup + echo "performing cleanup" +fi + +exit 0
\ No newline at end of file |