automatic DPDK test reports
 help / color / mirror / Atom feed
* |WARNING| pw140765-140766 [RFC PATCH v1 1/2] dts: Add interactive shell for managing Scapy
       [not found] <20240605175227.7003-2-jspewock@iol.unh.edu>
@ 2024-06-05 17:26 ` qemudev
  2024-06-05 17:54 ` |SUCCESS| pw140765 " checkpatch
  1 sibling, 0 replies; 2+ messages in thread
From: qemudev @ 2024-06-05 17:26 UTC (permalink / raw)
  To: test-report; +Cc: jspewock, zhoumin

Test-Label: loongarch-compilation
Test-Status: WARNING
http://dpdk.org/patch/140765

_apply patch failure_

Submitter: Jeremy Spewock <jspewock@iol.unh.edu>
Date: Wed,  5 Jun 2024 13:52:26 -0400
DPDK git baseline: Repo:dpdk
  Branch: main
  CommitID: 76cef1af8bdaeaf67a5c4ca5df3f221df994dc46

Apply patch set 140765-140766 failed:

Checking patch dts/framework/testbed_model/traffic_generator/scapy.py...
error: while searching for:
    _get_default_capture_name,
)

"""
========= BEGIN RPC FUNCTIONS =========

All of the functions in this section are intended to be exported to a python
shell which runs a scapy RPC server. These functions are made available via that
RPC server to the packet generator. To add a new function to the RPC server,
first write the function in this section. Then, if you need any imports, make sure to
add them to SCAPY_RPC_SERVER_IMPORTS as well. After that, add the function to the list
in EXPORTED_FUNCTIONS. Note that kwargs (keyword arguments) do not work via xmlrpc,
so you may need to construct wrapper functions around many scapy types.
"""

"""
Add the line needed to import something in a normal python environment
as an entry to this array. It will be imported before any functions are
sent to the server.
"""
SCAPY_RPC_SERVER_IMPORTS = [
    "from scapy.all import *",
    "import xmlrpc",
    "import sys",
    "from xmlrpc.server import SimpleXMLRPCServer",
    "import marshal",
    "import pickle",
    "import types",
    "import time",
]


def scapy_send_packets_and_capture(
    xmlrpc_packets: list[xmlrpc.client.Binary],
    send_iface: str,
    recv_iface: str,
    duration: float,
    sniff_filter: str,
) -> list[bytes]:
    """The RPC function to send and capture packets.

    This function is meant to be executed on the remote TG node via the server proxy.

    Args:
        xmlrpc_packets: The packets to send. These need to be converted to
            :class:`~xmlrpc.client.Binary` objects before sending to the remote server.
        send_iface: The logical name of the egress interface.
        recv_iface: The logical name of the ingress interface.
        duration: Capture for this amount of time, in seconds.

    Returns:
        A list of bytes. Each item in the list represents one packet, which needs
        to be converted back upon transfer from the remote node.
    """
    scapy_packets = [scapy.all.Packet(packet.data) for packet in xmlrpc_packets]
    sniffer = scapy.all.AsyncSniffer(
        iface=recv_iface,
        store=True,
        started_callback=lambda *args: scapy.all.sendp(scapy_packets, iface=send_iface),
        filter=sniff_filter,
    )
    sniffer.start()
    time.sleep(duration)
    return [scapy_packet.build() for scapy_packet in sniffer.stop(join=True)]


def scapy_send_packets(xmlrpc_packets: list[xmlrpc.client.Binary], send_iface: str) -> None:
    """The RPC function to send packets.

    This function is meant to be executed on the remote TG node via the server proxy.
    It only sends `xmlrpc_packets`, without capturing them.

    Args:
        xmlrpc_packets: The packets to send. These need to be converted to
            :class:`~xmlrpc.client.Binary` objects before sending to the remote server.
        send_iface: The logical name of the egress interface.
    """
    scapy_packets = [scapy.all.Packet(packet.data) for packet in xmlrpc_packets]
    scapy.all.sendp(scapy_packets, iface=send_iface, realtime=True, verbose=True)


"""
Functions to be exposed by the scapy RPC server.
"""
RPC_FUNCTIONS = [
    scapy_send_packets,
    scapy_send_packets_and_capture,
]

"""
========= END RPC FUNCTIONS =========
"""


class QuittableXMLRPCServer(SimpleXMLRPCServer):
    r"""Basic XML-RPC server.

    The server may be augmented by functions serializable by the :mod:`marshal` module.

    Example:
        ::

            def hello_world():
                # to be sent to the XML-RPC server
                print("Hello World!")

            # start the XML-RPC server on the remote node
            # the example assumes you're already connect to a tg_node
            # this is done by starting a Python shell on the remote node
            from framework.remote_session import PythonShell
            session = tg_node.create_interactive_shell(PythonShell, timeout=5, privileged=True)

            # then importing the modules needed to run the server
            # and the modules for any functions later added to the server
            session.send_command("import xmlrpc"
error: patch failed: dts/framework/testbed_model/traffic_generator/scapy.py:36
error: dts/framework/testbed_model/traffic_generator/scapy.py: patch does not apply


^ permalink raw reply	[flat|nested] 2+ messages in thread

* |SUCCESS| pw140765 [RFC PATCH v1 1/2] dts: Add interactive shell for managing Scapy
       [not found] <20240605175227.7003-2-jspewock@iol.unh.edu>
  2024-06-05 17:26 ` |WARNING| pw140765-140766 [RFC PATCH v1 1/2] dts: Add interactive shell for managing Scapy qemudev
@ 2024-06-05 17:54 ` checkpatch
  1 sibling, 0 replies; 2+ messages in thread
From: checkpatch @ 2024-06-05 17:54 UTC (permalink / raw)
  To: test-report

Test-Label: checkpatch
Test-Status: SUCCESS
http://dpdk.org/patch/140765

_coding style OK_



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-05 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240605175227.7003-2-jspewock@iol.unh.edu>
2024-06-05 17:26 ` |WARNING| pw140765-140766 [RFC PATCH v1 1/2] dts: Add interactive shell for managing Scapy qemudev
2024-06-05 17:54 ` |SUCCESS| pw140765 " checkpatch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).