diff options
Diffstat (limited to 'tests/dmm/dmm_scripts/run_dmm.sh')
-rwxr-xr-x | tests/dmm/dmm_scripts/run_dmm.sh | 136 |
1 files changed, 25 insertions, 111 deletions
diff --git a/tests/dmm/dmm_scripts/run_dmm.sh b/tests/dmm/dmm_scripts/run_dmm.sh index 456be1fa25..fd61fe842a 100755 --- a/tests/dmm/dmm_scripts/run_dmm.sh +++ b/tests/dmm/dmm_scripts/run_dmm.sh @@ -2,121 +2,35 @@ set -x -OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') -ROOTDIR=/tmp/DMM-testing -PWDDIR=$(pwd) -APP_DIR=${ROOTDIR}/dmm/release/bin/ -LIB_PATH=${APP_DIR}/../lib64 -dut1_ip=$1 -dut2_ip=$2 -proc_name=$3 -#proc_name => 0 = server, 1= client - -# Try to kill the vs_epoll -sudo killall vs_epoll - -sudo pgrep vs_epoll -if [ $? -eq "0" ]; then - success=false - sudo pkill vs_epoll - echo "RC = $?" - for attempt in {1..5}; do - echo "Checking if vs_epoll is still alive, attempt nr ${attempt}" - sudo pgrep vs_epoll - if [ $? -eq "1" ]; then - echo "vs_epoll is dead" - success=true - break - fi - echo "vs_epoll is still alive, waiting 1 second" - sleep 1 - done - if [ "$success" = false ]; then - echo "The command sudo pkill vs_epoll failed" - sudo pkill -9 vs_epoll - echo "RC = $?" - exit 1 - fi -else - echo "vs_epoll is not running" -fi - -sleep 2 - -cat /proc/meminfo - -cd ${LIB_PATH} -chmod 777 * -ls -l - -cd ${APP_DIR} -cp -r ${LIB_PATH}/* . -cp -r ../configure/* . -chmod 777 * - -if [ "$OS_ID" == "ubuntu" ]; then - ifaddress1=$(ifconfig eth1 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}') - echo $ifaddress1 - ifaddress2=$(ifconfig eth2 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}') - echo $ifaddress2 -elif [ "$OS_ID" == "centos" ]; then - ifaddress1=$(ifconfig enp0s8 | grep 'inet' | cut -d: -f2 | awk '{print $2}') - echo $ifaddress1 - ifaddress2=$(ifconfig enp0s9 | grep 'inet' | cut -d: -f2 | awk '{print $2}') - echo $ifaddress2 -fi - -echo '{ - "default_stack_name": "kernel", - "module_list": [ - { - "stack_name": "kernel", - "function_name": "kernel_stack_register", - "libname": "./", - "loadtype": "static", - "deploytype": "1", - "maxfd": "1024", - "minfd": "0", - "priorty": "1", - "stackid": "0", - }, - ] -}' | tee module_config.json - -echo '{ - "ip_route": [ - { - "subnet": "'$ifaddress1'/24", - "type": "nstack-kernel", - }, - { - "subnet": "'$ifaddress2'/24", - "type": "nstack-kernel", - }, - ], - "prot_route": [ - { - "proto_type": "1", - "type": "nstack-kernel", - }, - { - "proto_type": "2", - "type": "nstack-kernel", - } - ], -}' | tee rd_config.json +CUR_DIR=`dirname $(readlink -f $0)` +ROOTDIR=$CUR_DIR/../../../ +APP_DIR=${ROOTDIR}/dmm/config/app_test +LIB_PATH=${ROOTDIR}/dmm/release/lib64 +DMM_SCRIPT_DIR=$ROOTDIR/dmm/scripts +#proc_name => 0 = server, 1= client +proc_name=$1 +ifname=$2 +dut1_if_ip=$3 +dut2_if_ip=$4 + +ip addr +lspci -nn +lsmod | grep uio +bash kill_given_proc.sh vs_epoll + +cp -f $DMM_SCRIPT_DIR/prep_app_test.sh $DMM_SCRIPT_DIR/prep_app_test_csit.sh +sed -i 's!.*check_hugepage.sh!#skip hugepage check!1' $DMM_SCRIPT_DIR/prep_app_test_csit.sh +sed -i 's!enp0s8!'$ifname'!1' $DMM_SCRIPT_DIR/prep_app_test_csit.sh +bash -x $DMM_SCRIPT_DIR/prep_app_test_csit.sh + +cd $APP_DIR ls -l - #only for kernal stack if [ ${proc_name} -eq 0 ]; then -sudo LD_LIBRARY_PATH=${LIB_PATH} ./vs_epoll -p 20000 -d ${dut2_ip} -a 10000 -s ${dut1_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1 +sudo LD_LIBRARY_PATH=${LIB_PATH} ./vs_epoll -p 20000 -d ${dut2_if_ip} -a 10000 -s ${dut1_if_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1 else -sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_common -p 20000 -d ${dut1_ip} -a 10000 -s ${dut2_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1 +sudo LD_LIBRARY_PATH=${LIB_PATH} ./vc_common -p 20000 -d ${dut1_if_ip} -a 10000 -s ${dut2_if_ip} -l 200 -t 50000 -i 0 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1 fi -cd ${PWDDIR} - -ps -elf | grep vs_epoll - -sleep 10 +exit 0
\ No newline at end of file |