From: qemudev@loongson.cn
To: test-report@dpdk.org
Cc: jspewock@iol.unh.edu, zhoumin@loongson.cn
Subject: |WARNING| pw141747 [PATCH v2 1/1] dts: Remove XML-RPC server for Scapy TG and instead use PythonShell
Date: Wed, 26 Jun 2024 04:52:49 +0800 [thread overview]
Message-ID: <202406252052.45PKqnEK2979542@localhost.localdomain> (raw)
In-Reply-To: <20240625211114.886-2-jspewock@iol.unh.edu>
Test-Label: loongarch-compilation
Test-Status: WARNING
http://dpdk.org/patch/141747
_apply patch failure_
Submitter: Jeremy Spewock <jspewock@iol.unh.edu>
Date: Tue, 25 Jun 2024 17:11:14 -0400
DPDK git baseline: Repo:dpdk
Branch: main
CommitID: 9ab7baa5c14b1ba928c09bda4734827d6d367d6b
Apply patch set 141747 failed:
Checking patch dts/framework/remote_session/interactive_shell.py...
Hunk #1 succeeded at 25 (offset -4 lines).
error: while searching for:
start_on_init: bool = True,
app_params: Params = Params(),
name: str | None = None,
) -> None:
"""Create an SSH channel during initialization.
Args:
node: The node on which to run start the interactive shell.
privileged: Enables the shell to run as superuser.
error: patch failed: dts/framework/remote_session/interactive_shell.py:74
error: dts/framework/remote_session/interactive_shell.py: patch does not apply
Checking patch dts/framework/testbed_model/traffic_generator/__init__.py...
Checking patch dts/framework/testbed_model/traffic_generator/scapy.py...
error: while searching for:
A traffic generator used for functional testing, implemented with
`the Scapy library <https://scapy.readthedocs.io/en/latest/>`_.
The traffic generator uses an XML-RPC server to run Scapy on the remote TG node.
The traffic generator uses the :mod:`xmlrpc.server` module to run an XML-RPC server
in an interactive remote Python SSH session. The communication with the server is facilitated
with a local server proxy from the :mod:`xmlrpc.client` module.
"""
import inspect
import marshal
import time
import types
import xmlrpc.client
from xmlrpc.server import SimpleXMLRPCServer
import scapy.all # type: ignore[import-untyped]
from scapy.layers.l2 import Ether # type: ignore[import-untyped]
from scapy.packet import Packet # type: ignore[import-untyped]
from framework.config import OS, ScapyTrafficGeneratorConfig
from framework.remote_session.python_shell import PythonShell
from framework.settings import SETTINGS
from framework.testbed_model.node import Node
from framework.testbed_model.port import Port
from .capturing_traffic_generator import (
CapturingTrafficGenerator,
PacketFilteringConfig,
_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
error: patch failed: dts/framework/testbed_model/traffic_generator/scapy.py:6
error: dts/framework/testbed_model/traffic_generator/scapy.py: patch does not apply
Checking patch dts/framework/testbed_model/traffic_generator/traffic_generator.py...
Checking patch dts/framework/utils.py...
next parent reply other threads:[~2024-06-25 21:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240625211114.886-2-jspewock@iol.unh.edu>
2024-06-25 20:52 ` qemudev [this message]
2024-06-25 21:12 ` |SUCCESS| " checkpatch
2024-06-25 21:53 ` |WARNING| pw141747 [PATCH] [v2, " dpdklab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202406252052.45PKqnEK2979542@localhost.localdomain \
--to=qemudev@loongson.cn \
--cc=jspewock@iol.unh.edu \
--cc=test-report@dpdk.org \
--cc=zhoumin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).