diff options
author | charan makkina <charan795m@gmail.com> | 2018-10-15 18:55:36 +0530 |
---|---|---|
committer | charan makkina <charan795m@gmail.com> | 2018-11-20 16:56:51 +0530 |
commit | d4b0a17bcd1be6478523ccc0ff25c057ff40f511 (patch) | |
tree | e34f78b88047025d2c86d5bdd015efb8faecfe3f /scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh | |
parent | af0587ee6e44e9057ff6047a00fcd9015df1f5a1 (diff) |
Test:Test cases for file transfer and fork for both kernel and lwip_stacks.
Change-Id: I04744d4d12e403f9df9f522953b8f7b8b30246d8
Signed-off-by: charan makkina <charan795m@gmail.com>
Diffstat (limited to 'scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh')
-rwxr-xr-x | scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh b/scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh new file mode 100755 index 0000000..5713d50 --- /dev/null +++ b/scripts/csit/run/run_dmm_tcp_filetrans_with_lwip.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +set -x + +################################################# +# Store arguments values +# verify, log, cleanup actions gets first two arguments[action, node] + +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/stacks/lwip_stack/app_test/ +LIB_PATH=${APP_DIR}/../release/lib64/ +VAG_DIR=${ROOTDIR}/dmm/stacks/lwip_stack/vagrant +LOG_PATH=/var/log/nStack +DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts + +source $DMM_SCRIPT_DIR/csit/common.sh +################################################# +# Setup preparation + +if [ "x$action" == "xsetup" ]; then + setup_preparation_lwip vc_serv_file +fi + +################################################# +# Execution + +if [ "x$action" == "xrun" ]; then + execution "sudo cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_serv_file tcp ${dut1_if_ip} 1234" \ + "sudo cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_cli_file tcp ${dut1_if_ip} 1234 file.txt ${dut2_if_ip}" +fi + +################################################# + +# Verification + +if [ "x$action" == "xverify" ]; then + if [ "x$node" == "x0" ]; then + verification "diff $APP_DIR/file.txt $APP_DIR/receive_file.txt >/dev/null" + elif [ "x$node" == "x1" ]; then + verification + fi +fi + +################################################# +# Print Log + +if [ "x$action" == "xlog" ]; then + cat $LOG_PATH/running.log +fi + +################################################# +# Cleanup + +if [ "x$action" == "xcleanup" ]; then + cleanup_lwip vc_serv_file +fi + +exit 0 |