From patchwork Fri May 31 21:45:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1942324 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VrcCC6Drbz20Pr for ; Sat, 1 Jun 2024 07:46:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 69F4E41880; Fri, 31 May 2024 21:46:45 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 200wGyzax6RQ; Fri, 31 May 2024 21:46:43 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org A3FE84012F Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id A3FE84012F; Fri, 31 May 2024 21:46:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 86298C0072; Fri, 31 May 2024 21:46:43 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 778F0C0037 for ; Fri, 31 May 2024 21:46:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5355782D57 for ; Fri, 31 May 2024 21:46:42 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IKkUQMPWN_jJ for ; Fri, 31 May 2024 21:46:41 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=217.70.183.195; helo=relay3-d.mail.gandi.net; envelope-from=i.maximets@ovn.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 6A2C784587 Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=ovn.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 6A2C784587 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6A2C784587 for ; Fri, 31 May 2024 21:46:40 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id AE8F660005; Fri, 31 May 2024 21:46:37 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Fri, 31 May 2024 23:45:09 +0200 Message-ID: <20240531214635.2084937-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 X-GND-Sasl: i.maximets@ovn.org Cc: Ilya Maximets Subject: [ovs-dev] [PATCH 0/3] tests: Use compose-packet for sendpkt calls. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" sendpkt.py is used in system tests to send raw packets to interfaces. It is fed with plain hex bytes that are hard to read and understand. This patch set teaches sendpkt to accept hex strings in slightly different formats and teaches compose-packet command to generate NSH headers. With that most of the sendpkt.py calls updated to consume packets generated from OpenFlow descriptions instead of plain coding the bytes and checking code updated to compare results against these composed packets. Suggestion is to get these changes to all supported branches and start writing new tests in the same way. This patch set does add some new functionality, but it is test-only, so should be OK to backport. There are still a few plain hex calls to sendpkt.py. One is a intentionally malformed geneve packet that we can't generate (at least not fully), the others are IGMP packets that OVS doesn't fully parse and doesn't have a way to represent fully in OpenFlow. Next step might be to replace some of the packet-out calls as well. Ilya Maximets (3): tests: sendpkt: Allow different input formats. tests: Convert ND, MPLS and CT sendpkt tests to compose-packet. nsh: Add support to compose-packet and use it in system tests. lib/flow.c | 18 ++ tests/sendpkt.py | 26 +-- tests/system-traffic.at | 412 ++++++++++++++++++++++++++-------------- 3 files changed, 291 insertions(+), 165 deletions(-)