openl2tp: Fix ptests
PATCH 1/3 openl2tp: Fix ptests
From: Khem Raj <[email protected]>
- Detect active network interface to use, instead of asking user, this needs to run in automation
- Find the location of ppp_null.so with find instead of rpm, rpm is a distro choice it can be assumed to be always there.
- Add missing runtime deps for ptests
- Kill openl2tpd started by run-ptest script before exiting, otherwise ptest runner hangs forever.
Signed-off-by Khem Raj <[email protected]>
(cherry picked from commit d30427f475f273ab8c5dd83b2c076bb4fc8a9a82)
Signed-off-by Gyorgy Sarvari <[email protected]>
--- .../recipes-protocols/openl2tp/openl2tp/run-ptest | 7 +++---- meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb | 1 + 2 files changed, 4 insertions(+), 4 deletions(-)
meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest +3 -4
@@ -30,9 +30,7 @@ else fi #read -p "Please input the network interface you use to test(such as eth0, em1 etc):" ETH_TEST -echo "Please input the network interface you use to test(such as eth0, em1 etc):" -read ETH_TEST > /dev/null - +ETH_TEST=`ip route get 8.8.8.8 | awk -- '{print $5}'` if [ x"$ETH_TEST" = x ]; then exit_cus "The network interface cannot be null" 1 fi
@@ -73,7 +71,7 @@ lsmod | grep l2tp_ppp > /dev/null || exit_cus "FAIL: Load module l2tp_ppp" 2 # start openl2tpd ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null -ppp_path=`rpm -ql openl2tp | grep ppp_null.so` +ppp_path=`find / -name ppp_null.so` echo "test it here" /usr/sbin/openl2tpd -d all -D -f -p ${ppp_path} & > /dev/null
@@ -95,3 +93,4 @@ else fi restore_file +ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null
meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb +1 -0
@@ -92,3 +92,4 @@ do_install_ptest () { } RDEPENDS:${PN} = "ppp ppp-l2tp bash" +RDEPENDS:${PN}-ptest += "rpcbind kernel-module-l2tp-ppp procps-ps tcl"
PATCH 2/3 net-snmp: fix ptests
Add missing dependencies.
Signed-off-by Gyorgy Sarvari <[email protected]>
--- .../recipes-protocols/net-snmp/net-snmp_5.9.3.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.3.bb +5 -1
@@ -269,8 +269,12 @@ RDEPENDS:${PN}-libs += "libpci \ ${PN}-lib-helpers \ ${PN}-lib-mibs \ " -RDEPENDS:${PN}-ptest += "perl \ +RDEPENDS:${PN}-ptest += "${PN}-server-snmpd \ + ${PN}-server-snmptrapd \ + net-tools \ + perl \ perl-module-test \ + perl-module-socket \ perl-module-file-basename \ perl-module-getopt-long \ perl-module-file-temp \
PATCH 3/3 sshfs-fuse: fix ptests
In reply to Gyorgy SarvariDisable host key checking during tests, so the test can be executed without human intervention. Also add missing dependency.
Signed-off-by Gyorgy Sarvari <[email protected]>
--- .../recipes-filesystems/sshfs-fuse/sshfs-fuse/run-ptest | 9 +++++++++ .../recipes-filesystems/sshfs-fuse/sshfs-fuse_3.7.3.bb | 2 ++ 2 files changed, 11 insertions(+)
meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse/run-ptest +9 -0
@@ -1,3 +1,12 @@ #!/bin/sh +trap "[ -d ~/.ssh.bak ] && rm -rf ~/.ssh && mv ~/.ssh.bak ~/.ssh || rm -rf ~/.ssh" INT EXIT +if [ -d ~/.ssh ]; then + mv ~/.ssh ~/ssh.bak +fi + +mkdir ~/.ssh +echo "Host localhost" >> ~/.ssh/config +echo " StrictHostKeyChecking no" >> ~/.ssh/config + pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta-filesystems/recipes-filesystems/sshfs-fuse/sshfs-fuse_3.7.3.bb +2 -0
@@ -19,9 +19,11 @@ SRC_URI += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ bash \ + fuse \ " do_install_ptest() { install -d ${D}${PTEST_PATH}/test cp -rf ${S}/test/* ${D}${PTEST_PATH}/test/ + ln -sf ${bindir}/sshfs ${D}${PTEST_PATH}/sshfs }