summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-networking/conf/include/ptest-packagelists-meta-networking.inc2
-rw-r--r--meta-networking/recipes-devtools/python/python3-scapy/run-ptest7
-rw-r--r--meta-networking/recipes-devtools/python/python3-scapy_2.6.0.bb12
3 files changed, 20 insertions, 1 deletions
diff --git a/meta-networking/conf/include/ptest-packagelists-meta-networking.inc b/meta-networking/conf/include/ptest-packagelists-meta-networking.inc
index 408b559da2..838aee94d3 100644
--- a/meta-networking/conf/include/ptest-packagelists-meta-networking.inc
+++ b/meta-networking/conf/include/ptest-packagelists-meta-networking.inc
@@ -20,6 +20,7 @@ PTESTS_FAST_META_NETWORKING = "\
20 mbedtls \ 20 mbedtls \
21 openhpi \ 21 openhpi \
22 openl2tp \ 22 openl2tp \
23 python3-scapy \
23 squid \ 24 squid \
24 tcpdump \ 25 tcpdump \
25 wolfssl \ 26 wolfssl \
@@ -41,7 +42,6 @@ PTESTS_SLOW_META_NETWORKING = "\
41 42
42PTESTS_PROBLEMS_META_NETWORKING = "\ 43PTESTS_PROBLEMS_META_NETWORKING = "\
43 nftables \ 44 nftables \
44 python3-scapy \
45" 45"
46PTESTS_PROBLEMS_META_NETWORKING:append:libc-musl = "\ 46PTESTS_PROBLEMS_META_NETWORKING:append:libc-musl = "\
47 libtalloc \ 47 libtalloc \
diff --git a/meta-networking/recipes-devtools/python/python3-scapy/run-ptest b/meta-networking/recipes-devtools/python/python3-scapy/run-ptest
index 417e21053c..5c166b7ba0 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
2python3 UTscapy.py -t regression.uts -f text -l -C \ 9python3 UTscapy.py -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.6.0.bb b/meta-networking/recipes-devtools/python/python3-scapy_2.6.0.bb
index fdef5473ef..2086b018d6 100644
--- a/meta-networking/recipes-devtools/python/python3-scapy_2.6.0.bb
+++ b/meta-networking/recipes-devtools/python/python3-scapy_2.6.0.bb
@@ -30,9 +30,19 @@ do_install:append() {
30} 30}
31 31
32do_install_ptest() { 32do_install_ptest() {
33 install -d ${D}${libdir}/test/pcaps
33 install -m 0644 ${S}/scapy/tools/UTscapy.py ${D}${PTEST_PATH} 34 install -m 0644 ${S}/scapy/tools/UTscapy.py ${D}${PTEST_PATH}
34 install -m 0644 ${S}/test/regression.uts ${D}${PTEST_PATH} 35 install -m 0644 ${S}/test/regression.uts ${D}${PTEST_PATH}
36 install -m 0644 ${S}/test/pcaps/bad_rsn_parsing_overrides_ssid.pcap ${D}${libdir}/test/pcaps/
37 install -m 0644 ${S}/test/pcaps/macos.pcapng.gz ${D}${libdir}/test/pcaps/
35 sed -i 's,@PTEST_PATH@,${PTEST_PATH},' ${D}${PTEST_PATH}/run-ptest 38 sed -i 's,@PTEST_PATH@,${PTEST_PATH},' ${D}${PTEST_PATH}/run-ptest
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/UTscapy.py/UTscapy.py -K ipv6/g' ${D}${PTEST_PATH}/run-ptest
45 fi
36} 46}
37 47
38RDEPENDS:${PN} = "tcpdump python3-compression python3-cryptography python3-netclient \ 48RDEPENDS:${PN} = "tcpdump python3-compression python3-cryptography python3-netclient \
@@ -41,3 +51,5 @@ RDEPENDS:${PN} = "tcpdump python3-compression python3-cryptography python3-netcl
41 python3-difflib" 51 python3-difflib"
42RDEPENDS:${PN}-ptest += "python3-json python3-mock python3-multiprocessing \ 52RDEPENDS:${PN}-ptest += "python3-json python3-mock python3-multiprocessing \
43 iproute2 tshark" 53 iproute2 tshark"
54
55FILES:${PN}-ptest += "${libdir}/test/"