diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-03-28 22:19:47 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-03-28 22:22:24 -0700 |
commit | 6ca6265f7ea821cda292ef89ac77ba98bdf20cd2 (patch) | |
tree | deefafa354fd924da0d7ca2ee9d384f2dcefc0bb /meta-networking | |
parent | 816fafc0b88c9e7ee9e71eca6dae370cf393dd65 (diff) | |
download | meta-openembedded-6ca6265f7ea821cda292ef89ac77ba98bdf20cd2.tar.gz |
openl2tp: Replace ifconfig with ip command in ptest run script
ifconfig may not exist on all systems since its deprecated, fixes
ptests
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r-- | meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest b/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest index b8fb08b758..a40b6c4228 100644 --- a/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest | |||
@@ -34,7 +34,7 @@ ETH_TEST=`ip route get 8.8.8.8 | awk -- '{print $5}'` | |||
34 | if [ x"$ETH_TEST" = x ]; then | 34 | if [ x"$ETH_TEST" = x ]; then |
35 | exit_cus "The network interface cannot be null" 1 | 35 | exit_cus "The network interface cannot be null" 1 |
36 | fi | 36 | fi |
37 | ifconfig | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1 | 37 | ip a | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1 |
38 | 38 | ||
39 | # check openl2tp related kernel config | 39 | # check openl2tp related kernel config |
40 | zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1 | 40 | zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1 |
@@ -61,8 +61,7 @@ if [ x"$ETH_TEST" = x ]; then | |||
61 | fi | 61 | fi |
62 | 62 | ||
63 | sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl | 63 | sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl |
64 | test_ip="`ifconfig $ETH_TEST | grep 'inet ' | sed 's/^.*inet addr://g' | \ | 64 | test_ip="`ip addr show $ETH_TEST | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d '/' -f1`" |
65 | sed 's/ *Mask.*$//g'|sed 's/ *Bcast.*$//g'`" | ||
66 | sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test | 65 | sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test |
67 | 66 | ||
68 | # load module l2tp_ppp | 67 | # load module l2tp_ppp |