summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest')
-rw-r--r--meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest12
1 files changed, 5 insertions, 7 deletions
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest b/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest
index 01c9c7b447..a40b6c4228 100644
--- a/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest
+++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest
@@ -30,13 +30,11 @@ else
30fi 30fi
31 31
32#read -p "Please input the network interface you use to test(such as eth0, em1 etc):" ETH_TEST 32#read -p "Please input the network interface you use to test(such as eth0, em1 etc):" ETH_TEST
33echo "Please input the network interface you use to test(such as eth0, em1 etc):" 33ETH_TEST=`ip route get 8.8.8.8 | awk -- '{print $5}'`
34read ETH_TEST > /dev/null
35
36if [ x"$ETH_TEST" = x ]; then 34if [ x"$ETH_TEST" = x ]; then
37 exit_cus "The network interface cannot be null" 1 35 exit_cus "The network interface cannot be null" 1
38fi 36fi
39ifconfig | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1 37ip a | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1
40 38
41# check openl2tp related kernel config 39# check openl2tp related kernel config
42zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1 40zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1
@@ -63,8 +61,7 @@ if [ x"$ETH_TEST" = x ]; then
63fi 61fi
64 62
65sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl 63sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl
66test_ip="`ifconfig $ETH_TEST | grep 'inet ' | sed 's/^.*inet addr://g' | \ 64test_ip="`ip addr show $ETH_TEST | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d '/' -f1`"
67 sed 's/ *Mask.*$//g'|sed 's/ *Bcast.*$//g'`"
68sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test 65sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test
69 66
70# load module l2tp_ppp 67# load module l2tp_ppp
@@ -73,7 +70,7 @@ lsmod | grep l2tp_ppp > /dev/null || exit_cus "FAIL: Load module l2tp_ppp" 2
73 70
74# start openl2tpd 71# start openl2tpd
75ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null 72ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null
76ppp_path=`rpm -ql openl2tp | grep ppp_null.so` 73ppp_path=`find / -name ppp_null.so`
77echo "test it here" 74echo "test it here"
78/usr/sbin/openl2tpd -d all -D -f -p ${ppp_path} & > /dev/null 75/usr/sbin/openl2tpd -d all -D -f -p ${ppp_path} & > /dev/null
79 76
@@ -95,3 +92,4 @@ else
95fi 92fi
96 93
97restore_file 94restore_file
95ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null