From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4998A454B0 for ; Fri, 21 Jun 2024 01:15:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 458CB40265; Fri, 21 Jun 2024 01:15:39 +0200 (CEST) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mails.dpdk.org (Postfix) with ESMTP id A03D14025E for ; Fri, 21 Jun 2024 01:15:09 +0200 (CEST) Received: from loongson.cn (unknown [192.168.100.1]) by gateway (Coremail) with SMTP id _____8CxL_D4t3RmYawIAA--.35145S3; Fri, 21 Jun 2024 07:15:06 +0800 (CST) Received: from localhost.localdomain (unknown [192.168.100.1]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cxbcf3t3RmHcgqAA--.37860S3; Fri, 21 Jun 2024 07:15:03 +0800 (CST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.15.2) with ESMTPS id 45KMkSmQ323262 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 06:46:28 +0800 Received: (from root@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id 45KMkRgX323261; Fri, 21 Jun 2024 06:46:27 +0800 Date: Fri, 21 Jun 2024 06:46:27 +0800 From: qemudev@loongson.cn Message-Id: <202406202246.45KMkRgX323261@localhost.localdomain> Content-Type: text/plain; charset="utf-8" Subject: |WARNING| pw141462 [PATCH v1 1/1] dts: Remove XML-RPC server for Scapy TG and instead use PythonShell In-Reply-To: <20240620231158.12008-3-jspewock@iol.unh.edu> References: <20240620231158.12008-3-jspewock@iol.unh.edu> To: test-report@dpdk.org Cc: jspewock@iol.unh.edu, zhoumin@loongson.cn X-CM-TRANSID: AQAAf8Cxbcf3t3RmHcgqAA--.37860S3 Authentication-Results: localhost.localdomain; spf=neutral smtp.mail=q emudev@loongson.cn; X-CM-SenderInfo: pthp3vthy6z05rqj20fqof0/1tbiAQAOD2ZzixQIpAAJsv X-Coremail-Antispam: 1Uk129KBj93XoWxGr1DXry7Cw4rGw47XF43Arc_yoWrtFWrp3 WrK39YkayDJ34UJws5Xa48X3WIvan8JFWUta4kXa4293Z8ur9a9r1Ikws8GFWUCr18ua4I va1Dtryjkan8ZFXCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUyKb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lw4CEc2x0rVAKj4xxMxAIw28IcxkI7VAKI4 8JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xv wVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUXVWUAwCIc40Y0x0EwIxGrwCI42IY6xIIjx v20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20E Y4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267 AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxU7na9DUUUU X-BeenThere: test-report@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: automatic DPDK test reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: test-report-bounces@dpdk.org Test-Label: loongarch-compilation Test-Status: WARNING http://dpdk.org/patch/141462 _apply patch failure_ Submitter: Jeremy Spewock Date: Thu, 20 Jun 2024 19:11:59 -0400 DPDK git baseline: Repo:dpdk Branch: main CommitID: 4a44d97f0a52a76258c6a6cb6a713f4380a8ab1f Apply patch set 141462 failed: 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 `_. 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/utils.py...