Commit Graph
7 Commits
Author SHA1 Message Date
Khem Raj d896a97b88 python3-scapy: keep UTscapy failure diagnostics in the ptest output
UTscapy writes its detailed report, including the traceback of every
failing test, to a file under ${PTEST_PATH}. Under testimage that path
only exists inside the ephemeral image, which is discarded as soon as the
run finishes, so a failure left nothing behind but a bare

    FAIL: 000.01s Emulate interact()

line and diagnosing it required rebuilding the image by hand.

Pass -F so the report expands only the failed tests, and cat it to stdout
when there is one, where ptest-runner records it. A clean run is
unaffected.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-08-19 16:57:43 -07:00
Khem Raj c78566f4b0 python3-scapy: fix UnboundLocalError in interact()
The "Emulate interact()" UTScapy regression test failed:

    IPython requested but not found !
    Using the default Python shell: History is disabled.
    Traceback (most recent call last):
      File "/usr/lib/python3.14/site-packages/scapy/main.py", line 857, in interact
        banner += "\n"
    UnboundLocalError: cannot access local variable banner where it is
    not associated with a value

scapy.main.interact() only binds "banner" in the branches handling the
ipython, ptipython, ptpython and bpython shells. The test asks for
ipython, which is not in the image, so scapy falls back to the plain
Python shell and leaves "banner" unbound while still running the
unconditional "banner += \n" for the caller-supplied mybanner.

The test is correct and the bug is in scapy, which still has it in
master, so carry a patch initializing banner from banner_text before the
shell-specific chain.

meta-networking-image-ptest-python3-scapy now reports PASSED=319
FAILED=0, up from PASSED=318 FAILED=1.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2026-08-19 16:57:43 -07:00
Khem Raj 951255b0da python3-scapy: upgrade 2.6.1 -> 2.7.0
Bump to the v2.7.0 tag. Rebase the ptest ICMPv6 skip patch: upstream
added a "needs_root" tag to the "Sending and receiving an
ICMPv6EchoRequest" test's tag line in test/regression.uts, so the
"skipped_ptest" tag now needs to be appended after "needs_root"
rather than replacing the whole line. With this rebase both hunks
apply with offset only (no fuzz).

Build-verified: python3-scapy builds and packages (including
-ptest) successfully.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-08-14 09:06:32 -07:00
Khem Raj 3e44699820 python-scapy: Ignore failing ptests
These tests fail in OE qemu environment and is sensitive to ISP provider

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-11-20 00:34:05 -08:00
Gyorgy Sarvari 237efae216 python3-scapy: fix ptests
1. Install missing test files
2. Enable network access by setting a nameserver in resolv.conf
   because some tests require this
3. One test tries to ping Google through IPv6 - this test requires
   ipv6 DISTRO_FEATURE. In case ipv6 is not enabled, skip this test
   from the run-ptest script.

NB: the last mentioned test to work  also requires IPv6 support from
your ISP. My ISP is IPv4-only, and I couldn't try it out. The above
comes from my reading of the testcode.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-10-28 23:31:28 -07:00
Petr Gotthard 4370e3d3fb python3-scapy: upgrade 2.4.5 -> 2.5.0
Changelog:
https://github.com/secdev/scapy/releases/tag/v2.5.0

Also, in this version the UTscapy wrapper gets no longer installed
into /usr/bin, so for ptest we need to install it.

Signed-off-by: Petr Gotthard <petr.gotthard@advantech.cz>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-02-24 09:49:07 -08:00
Armin Kuster 0073e325da python3-scapy: move from meta-security
This tracks the official scapy project.
includes ptest

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
2021-05-31 07:38:06 -07:00