summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-devtools
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-devtools')
-rw-r--r--meta-networking/recipes-devtools/python/python3-scapy/run-ptest7
-rw-r--r--meta-networking/recipes-devtools/python/python3-scapy_2.4.5.bb13
2 files changed, 20 insertions, 0 deletions
diff --git a/meta-networking/recipes-devtools/python/python3-scapy/run-ptest b/meta-networking/recipes-devtools/python/python3-scapy/run-ptest
index 797d8ecf78..847b69af94 100644
--- a/meta-networking/recipes-devtools/python/python3-scapy/run-ptest
+++ b/meta-networking/recipes-devtools/python/python3-scapy/run-ptest
@@ -1,4 +1,11 @@
1#!/bin/sh 1#!/bin/sh
2
3if ! nslookup example.com; then
4 mv /etc/resolv.conf /etc/resolv.conf.bak
5 echo "nameserver 8.8.8.8" > /etc/resolv.conf
6 trap "mv /etc/resolv.conf.bak /etc/resolv.conf" INT EXIT
7fi
8
2UTscapy3 -t regression.uts -f text -l -C \ 9UTscapy3 -t regression.uts -f text -l -C \
3 -o @PTEST_PATH@/scapy_ptest_$(date +%Y%m%d-%H%M%S).log \ 10 -o @PTEST_PATH@/scapy_ptest_$(date +%Y%m%d-%H%M%S).log \
4 2>&1 | sed -e 's/^passed None/PASS:/' -e 's/^failed None/FAIL:/' 11 2>&1 | sed -e 's/^passed None/PASS:/' -e 's/^failed None/FAIL:/'
diff --git a/meta-networking/recipes-devtools/python/python3-scapy_2.4.5.bb b/meta-networking/recipes-devtools/python/python3-scapy_2.4.5.bb
index 0f66dfd784..83f6a6026a 100644
--- a/meta-networking/recipes-devtools/python/python3-scapy_2.4.5.bb
+++ b/meta-networking/recipes-devtools/python/python3-scapy_2.4.5.bb
@@ -34,8 +34,21 @@ do_install:append() {
34do_install_ptest() { 34do_install_ptest() {
35 install -m 0644 ${S}/test/regression.uts ${D}${PTEST_PATH} 35 install -m 0644 ${S}/test/regression.uts ${D}${PTEST_PATH}
36 sed -i 's,@PTEST_PATH@,${PTEST_PATH},' ${D}${PTEST_PATH}/run-ptest 36 sed -i 's,@PTEST_PATH@,${PTEST_PATH},' ${D}${PTEST_PATH}/run-ptest
37 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
38 install -m 0644 ${S}/test/pcaps/macos.pcapng.gz ${D}${PYTHON_SITEPACKAGES_DIR}/test/pcaps/
39
40 # note1: if ipv6 isn't enabled, skip the related test (add '-K ipv6' argument)
41 # note2: to make this test work, your ISP also must support ipv6 - the test is trying
42 # to ping google.com through ipv6.
43 if [ "${@oe.utils.all_distro_features(d, 'ipv6', 'true', 'false')}" = "false" ]; then
44 sed -i 's/UTscapy3/UTscapy3 -K ipv6/g' ${D}${PTEST_PATH}/run-ptest
45 fi
37} 46}
38 47
39RDEPENDS:${PN} = "tcpdump ${PYTHON_PN}-compression ${PYTHON_PN}-cryptography ${PYTHON_PN}-netclient \ 48RDEPENDS:${PN} = "tcpdump ${PYTHON_PN}-compression ${PYTHON_PN}-cryptography ${PYTHON_PN}-netclient \
40 ${PYTHON_PN}-netserver ${PYTHON_PN}-pydoc ${PYTHON_PN}-pkgutil ${PYTHON_PN}-shell \ 49 ${PYTHON_PN}-netserver ${PYTHON_PN}-pydoc ${PYTHON_PN}-pkgutil ${PYTHON_PN}-shell \
41 ${PYTHON_PN}-threading ${PYTHON_PN}-numbers" 50 ${PYTHON_PN}-threading ${PYTHON_PN}-numbers"
51
52RDEPENDS:${PN}-ptest += "tshark"
53
54FILES:${PN}-ptest += "${PYTHON_SITEPACKAGES_DIR}/test/pcaps"