diff options
author | yalei wang <wylandrea@gmail.com> | 2018-11-21 03:11:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2018-11-21 03:11:22 +0000 |
commit | 95be8358d7426b815fbd1224fe71b4486a56aaac (patch) | |
tree | db79ead6fbb91770f45dfb998b7dc3df726c5100 /scripts/csit/run/run_dmm_udp_filetrans.sh | |
parent | 3359217b31c63d8d93c7ab33c9a7964179a78d07 (diff) | |
parent | d4b0a17bcd1be6478523ccc0ff25c057ff40f511 (diff) |
Merge "Test:Test cases for file transfer and fork for both kernel and lwip_stacks."
Diffstat (limited to 'scripts/csit/run/run_dmm_udp_filetrans.sh')
-rwxr-xr-x | scripts/csit/run/run_dmm_udp_filetrans.sh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/scripts/csit/run/run_dmm_udp_filetrans.sh b/scripts/csit/run/run_dmm_udp_filetrans.sh new file mode 100755 index 0000000..b8838bb --- /dev/null +++ b/scripts/csit/run/run_dmm_udp_filetrans.sh @@ -0,0 +1,68 @@ +#!/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 +LOG_PATH=/var/log + +source $DMM_SCRIPT_DIR/csit/common.sh +################################################# +# Setup preparation + +if [ "x$action" == "xsetup" ]; then + setup_preparation vc_serv_file +fi + +################################################# +# Execution + +if [ "x$action" == "xrun" ]; then + execution "cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_serv_file udp ${dut1_if_ip} 1235 file.txt 256" \ + "cp -f $DMM_SCRIPT_DIR/csit/file.txt . ;sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_cli_file udp ${dut1_if_ip} 1235 ${dut2_if_ip} file.txt receive_file.txt 256" +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 + print_log vc_serv_file vc_cli_file +fi + +################################################# +# Cleanup + +if [ "x$action" == "xcleanup" ]; then + cleanup vc_serv_file vc_cli_file +fi + +exit 0
\ No newline at end of file |