5 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
6 ROOTDIR=/tmp/DMM-testing
8 APP_DIR=${ROOTDIR}/dmm/release/bin/
9 LIB_PATH=${APP_DIR}/../lib64
13 #proc_name => 0 = server, 1= client
15 # Try to kill the vs_epoll
19 if [ $? -eq "0" ]; then
23 for attempt in {1..5}; do
24 echo "Checking if vs_epoll is still alive, attempt nr ${attempt}"
26 if [ $? -eq "1" ]; then
27 echo "vs_epoll is dead"
31 echo "vs_epoll is still alive, waiting 1 second"
34 if [ "$success" = false ]; then
35 echo "The command sudo pkill vs_epoll failed"
36 sudo pkill -9 vs_epoll
41 echo "vs_epoll is not running"
53 cp -r ${LIB_PATH}/libnStackAPI.so .
54 cp -r ../configure/* .
57 if [ "$OS_ID" == "ubuntu" ]; then
58 ifaddress1=$(ifconfig eth1 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')
60 ifaddress2=$(ifconfig eth2 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')
62 elif [ "$OS_ID" == "centos" ]; then
63 ifaddress1=$(ifconfig enp0s8 | grep 'inet' | cut -d: -f2 | awk '{print $2}')
65 ifaddress2=$(ifconfig enp0s9 | grep 'inet' | cut -d: -f2 | awk '{print $2}')
70 "default_stack_name": "kernel",
73 "stack_name": "kernel",
74 "function_name": "kernel_stack_register",
84 }' | tee module_config.json
89 "subnet": "'$ifaddress1'/24",
90 "type": "nstack-kernel",
93 "subnet": "'$ifaddress2'/24",
94 "type": "nstack-kernel",
100 "type": "nstack-kernel",
104 "type": "nstack-kernel",
107 }' | tee rd_config.json
111 #only for kernal stack
112 if [ ${proc_name} -eq 0 ]; then
113 sudo LD_PRELOAD=${LIB_PATH}/libnStackAPI.so ./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
115 sudo LD_PRELOAD=${LIB_PATH}/libnStackAPI.so ./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
120 ps -elf | grep vs_epoll