@@ -1,4 +1,11 @@
#!/bin/sh
+
+if ! nslookup example.com; then
+ mv /etc/resolv.conf /etc/resolv.conf.bak
+ echo "nameserver 8.8.8.8" > /etc/resolv.conf
+ trap "mv /etc/resolv.conf.bak /etc/resolv.conf" INT EXIT
+fi
+
UTscapy3 -t regression.uts -f text -l -C \
-o @PTEST_PATH@/scapy_ptest_$(date +%Y%m%d-%H%M%S).log \
2>&1 | sed -e 's/^passed None/PASS:/' -e 's/^failed None/FAIL:/'
@@ -34,8 +34,21 @@ do_install:append() {
do_install_ptest() {
install -m 0644 ${S}/test/regression.uts ${D}${PTEST_PATH}
sed -i 's,@PTEST_PATH@,${PTEST_PATH},' ${D}${PTEST_PATH}/run-ptest
+ install -D -m 0644 ${S}/test/pcaps/bad_rsn_parsing_overrides_ssid.pcap ${D}${PYTHON_SITEPACKAGES_DIR}/test/pcaps/bad_rsn_parsing_overrides_ssid.pcap
+ install -m 0644 ${S}/test/pcaps/macos.pcapng.gz ${D}${PYTHON_SITEPACKAGES_DIR}/test/pcaps/
+
+ # note1: if ipv6 isn't enabled, skip the related test (add '-K ipv6' argument)
+ # note2: to make this test work, your ISP also must support ipv6 - the test is trying
+ # to ping google.com through ipv6.
+ if [ "${@oe.utils.all_distro_features(d, 'ipv6', 'true', 'false')}" = "false" ]; then
+ sed -i 's/UTscapy3/UTscapy3 -K ipv6/g' ${D}${PTEST_PATH}/run-ptest
+ fi
}
RDEPENDS:${PN} = "tcpdump ${PYTHON_PN}-compression ${PYTHON_PN}-cryptography ${PYTHON_PN}-netclient \
${PYTHON_PN}-netserver ${PYTHON_PN}-pydoc ${PYTHON_PN}-pkgutil ${PYTHON_PN}-shell \
${PYTHON_PN}-threading ${PYTHON_PN}-numbers"
+
+RDEPENDS:${PN}-ptest += "tshark"
+
+FILES:${PN}-ptest += "${PYTHON_SITEPACKAGES_DIR}/test/pcaps"
1. Enable network access during tests by setting a nameserver 2. Add missing tshark dependency 3. Install missing test files Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> --- .../recipes-devtools/python/python3-scapy/run-ptest | 7 +++++++ .../recipes-devtools/python/python3-scapy_2.4.5.bb | 13 +++++++++++++ 2 files changed, 20 insertions(+)