From patchwork Fri Sep 6 17:37:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 143761 X-Patchwork-Delegate: juraj.linkes@pantheon.tech Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B9D245920; Fri, 6 Sep 2024 19:37:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74D7342FB5; Fri, 6 Sep 2024 19:37:40 +0200 (CEST) Received: from mail-pj1-f98.google.com (mail-pj1-f98.google.com [209.85.216.98]) by mails.dpdk.org (Postfix) with ESMTP id CA72F400D5 for ; Fri, 6 Sep 2024 19:37:39 +0200 (CEST) Received: by mail-pj1-f98.google.com with SMTP id 98e67ed59e1d1-2d8b679d7f2so1767959a91.1 for ; Fri, 06 Sep 2024 10:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1725644259; x=1726249059; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D2NjKYBceMLaomq7KDsmUyotzPrjeYuBUKcBwsBNR0s=; b=TcDBxaeYvZuz5mC/gc7O5y2qhc9bvSYq68rnf+/nd55nZk8MkSpLZmNNagCLirNbs/ q/Ljd8ytXKevABonufrfEv11gsXsBDL8G4SbETqzO71tFRbXJ5y1gFcTI1XN7OR9CzFd j1B5LE8D/27kU6u49+tF9olkZcpXbkUHEWd+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725644259; x=1726249059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D2NjKYBceMLaomq7KDsmUyotzPrjeYuBUKcBwsBNR0s=; b=Y/6b1WhPsaBzaYDpxHjTzBdfL+0kVx6NH6ifbpUMhjbJ7pmmLxCQ9M7WLL7c9ZndzI TjccWHGeeRIPoMiZNYmB9P5mBao+AZhJh2ylGzSha0vpVGITjcKCbp9SwstrWyG+KfY2 Ifzn8FKj6VMaVIbio1sM3dErZJruBAB8/sspyhRX6HbDzL+gvdYJ22sh9OR10mS9npfv /S+w/JxcOHyI9WEuOtuXhpjn9V2TRyf0yVcNvQX7zTt0pHWSmTWKVlx6z4w66F+hJVrV ALnyNFplcDPwy67K1pzmKCBq/3NAlJPc39U3n8E/UNasF2+4Aoz/7XBTwP6Mg4ySPI8t DDfg== X-Gm-Message-State: AOJu0Yxpi/mJrgA3GdMTJDdqKrprTMJTggwT9aBb1jYhnFcUq0PmeIN4 yFkaDXIdRGz9AcInnhSsCzkix6sZxWAhA22THEgGo6NXJYF2sUHuD4eFWbcKgFkevNgElyREaR5 IDQ/5NrH2AtxoYwoipAwce5Pz8Zb/HysEosZbgpDU+sJ1mKwu X-Google-Smtp-Source: AGHT+IG9OeanBSCCAo6igVy17qg0iabAk01zJJc5oWCMLR8n7wn7/EiSj9TCIV3O6ZdM7ctoPVynYw2HE0/Y X-Received: by 2002:a17:90a:f301:b0:2cf:fe5d:ea12 with SMTP id 98e67ed59e1d1-2dad505649emr4345613a91.24.1725644258887; Fri, 06 Sep 2024 10:37:38 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-2dadc03d89csm102354a91.11.2024.09.06.10.37.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2024 10:37:38 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 6F1786050A6D; Fri, 6 Sep 2024 13:37:37 -0400 (EDT) From: jspewock@iol.unh.edu To: npratte@iol.unh.edu, thomas@monjalon.net, alex.chapman@arm.com, probb@iol.unh.edu, wathsala.vithanage@arm.com, Luca.Vizzarro@arm.com, Honnappa.Nagarahalli@arm.com, yoan.picchi@foss.arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 1/3] dts: allow specifying ingress port in send_packets Date: Fri, 6 Sep 2024 13:37:07 -0400 Message-ID: <20240906173709.17487-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240906173709.17487-1-jspewock@iol.unh.edu> References: <20240906173709.17487-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock In order to use VFs in the framework, methods for sending packets had to be modified so that they support choosing which ports to use when sending and receiving. This patch creates the same support for the send_packets method so that it can be used with VFs. Signed-off-by: Jeremy Spewock --- dts/framework/test_suite.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index b17f0c04b2..6490500610 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -221,13 +221,18 @@ def send_packet_and_capture( def send_packets( self, packets: list[Packet], + sut_ingress: Port | None = None, ) -> None: """Send packets using the traffic generator and do not capture received traffic. Args: packets: Packets to send. + sut_ingress: Optional port to use as the SUT ingress port. Defaults to + `self._sut_port_ingress`. """ - packets = self._adjust_addresses(packets) + if sut_ingress is None: + sut_ingress = self._sut_port_ingress + packets = self._adjust_addresses(packets, sut_ingress, self._sut_port_egress) self.tg_node.send_packets(packets, self._tg_port_egress) def get_expected_packet( From patchwork Fri Sep 6 17:37:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 143762 X-Patchwork-Delegate: juraj.linkes@pantheon.tech Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A987645920; Fri, 6 Sep 2024 19:37:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F07042FD9; Fri, 6 Sep 2024 19:37:42 +0200 (CEST) Received: from mail-pl1-f228.google.com (mail-pl1-f228.google.com [209.85.214.228]) by mails.dpdk.org (Postfix) with ESMTP id 8EDB642FD1 for ; Fri, 6 Sep 2024 19:37:41 +0200 (CEST) Received: by mail-pl1-f228.google.com with SMTP id d9443c01a7336-2068acc8b98so21686515ad.3 for ; Fri, 06 Sep 2024 10:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1725644260; x=1726249060; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sU2t3JJqc53mLZ1dPqVxaDxukj9ROPqr89ssCppK60s=; b=Nr+HHNmASAVH7z9xaQCg4Vf9RkzZenUxcpQkzc8fCTb04T5p0eKfBgaYtsXfA7pPoG MiJNtrO8WHjIu+cK6x2wiORplQT+0GtqUnBxLtl2j3a4VGfVsapJcy6eOYjiu8Ep7GKM M7s9gxxlUX11LebE7Sft0yB9hqCp2TUBJuCOA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725644260; x=1726249060; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sU2t3JJqc53mLZ1dPqVxaDxukj9ROPqr89ssCppK60s=; b=o28yQU2pP+fzE30Vw80+cGFGXfKQL9GGK0CP7sNX1SQSXluISuZMVM7LieyRuf74oi axivMUkjdVcp8dZY7Gx05tv/yS6I2TsSwlky6+qExPY9ZepJy0O77T3cjmQ5IwxNZdLX lcqlhMMZ6kfHdcWOOOL4N1yjR+QCFRKVFE6CnDqDzaL+pPtwxUZCSWC6hANqrzd+f3iZ phDALZXRsmTk/mZ37iOJQ9JfJIw5xDtGSeSlIeQ04S0u1JkyjA7iaxlC4HSPCCb/Ev6x 227DQ+aqCNAd40jYTyaL/BCTUc3Sql0GlasHhU9DP+ZkZED0p2bFMr9cw1fPhC8LBuP0 R5qQ== X-Gm-Message-State: AOJu0YzIe/qenmnWck8RdIf+F9fCwEYr2t5bNrlGsZ0RZB0a/vErE4yg LIIW4wKBELlZtzFizy8uxR2hTYzkua+m+5uGypqC3SlwJcO6CLJ5cBtg69Io2E7DVwvLHxzN+u2 70M2jsi1FSlvQiIGCOvYVX8lUgon6uEuM X-Google-Smtp-Source: AGHT+IFLiiHMS89uMMUl76QeSFyccNMpz7b+YDnxLQQTNLBrjJRzAN9jiL2mLSGfVbLfTuLTQo+K29crKluS X-Received: by 2002:a17:902:f54e:b0:206:c776:4f01 with SMTP id d9443c01a7336-206c776537emr73176785ad.42.1725644260596; Fri, 06 Sep 2024 10:37:40 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id d9443c01a7336-206ae8d1247sm2997425ad.50.2024.09.06.10.37.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2024 10:37:40 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 119816050A73; Fri, 6 Sep 2024 13:37:39 -0400 (EDT) From: jspewock@iol.unh.edu To: npratte@iol.unh.edu, thomas@monjalon.net, alex.chapman@arm.com, probb@iol.unh.edu, wathsala.vithanage@arm.com, Luca.Vizzarro@arm.com, Honnappa.Nagarahalli@arm.com, yoan.picchi@foss.arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 2/3] dts: parameterize ports used in pf_smoke suite Date: Fri, 6 Sep 2024 13:37:08 -0400 Message-ID: <20240906173709.17487-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240906173709.17487-1-jspewock@iol.unh.edu> References: <20240906173709.17487-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Currently the pf_smoke testing suite only uses the default ports for sending and receiving packets. When looking at that suite in isolation, this is fine since its primary goal is to test the physical functions in the test run (which the defaults should represent). However, since this suite represents the same coverage that should be tested on VFs, it makes sense to parameterize the ports that are in use in the suite so that the same test cases can be used for testing VFs. Signed-off-by: Jeremy Spewock --- dts/tests/TestSuite_pf_smoke_tests.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/dts/tests/TestSuite_pf_smoke_tests.py b/dts/tests/TestSuite_pf_smoke_tests.py index 287132e9dd..984a193e8b 100644 --- a/dts/tests/TestSuite_pf_smoke_tests.py +++ b/dts/tests/TestSuite_pf_smoke_tests.py @@ -18,6 +18,7 @@ from framework.params.testpmd import SimpleForwardingModes from framework.remote_session.testpmd_shell import TestPmdShell from framework.test_suite import TestSuite +from framework.testbed_model.port import Port class TestPfSmokeTests(TestSuite): @@ -35,6 +36,8 @@ class TestPfSmokeTests(TestSuite): is_blocking: ClassVar[bool] = True jumbo_frame_len: ClassVar[int] = 9000 num_queues: int = 4 + sut_egress_port: Port | None = None + sut_ingress_port: Port | None = None def set_up_suite(self) -> None: """Increase the MTU of the traffic generator to support jumboframes.""" @@ -48,12 +51,17 @@ def test_jumbo_frame_support(self) -> None: max_pkt_len=self.jumbo_frame_len, mbuf_size=[self.jumbo_frame_len + 128], forward_mode=SimpleForwardingModes.mac, + ports=[self.sut_egress_port, self.sut_ingress_port] + if self.sut_egress_port is not None and self.sut_ingress_port is not None + else None, ) as testpmd: testpmd.start() # Take 26 bytes off the MTU size to account for Ethernet headers payload_len = self.jumbo_frame_len - 26 packet = Ether() / Raw("X" * payload_len) - recv = self.send_packet_and_capture(packet) + recv = self.send_packet_and_capture( + packet, sut_ingress=self.sut_ingress_port, sut_egress=self.sut_egress_port + ) self.verify( any(hasattr(p, "load") and "X" * 20 in str(p.load) for p in recv), f"Jumboframe was not received even when MTU was set to {self.jumbo_frame_len}.", @@ -73,6 +81,9 @@ def test_rss_functionality(self) -> None: forward_mode=SimpleForwardingModes.rxonly, rx_queues=self.num_queues, tx_queues=self.num_queues, + ports=[self.sut_egress_port, self.sut_ingress_port] + if self.sut_egress_port is not None and self.sut_ingress_port is not None + else None, ) as testpmd: testpmd.set_verbose(1) src_max = "00:00:00:00:00:01" @@ -80,7 +91,7 @@ def test_rss_functionality(self) -> None: Ether(src=src_max) / IP(dst=f"192.168.0.{i+1}") for i in range(self.num_queues * 4) ] testpmd.start() - self.send_packets(send_pkts) + self.send_packets(send_pkts, sut_ingress=self.sut_ingress_port) verbose_stats = TestPmdShell.extract_verbose_output(testpmd.stop()) # Filter down the packets to only the ones with the correct source MAC verbose_stats = list(filter(lambda x: x.src_mac == src_max, verbose_stats)) @@ -105,7 +116,12 @@ def test_rss_functionality(self) -> None: def test_runtime_modify_num_queues(self) -> None: """Ensure that the number of queues on a port can be changed at runtime.""" with TestPmdShell( - self.sut_node, rx_queues=self.num_queues, tx_queues=self.num_queues + self.sut_node, + rx_queues=self.num_queues, + tx_queues=self.num_queues, + ports=[self.sut_egress_port, self.sut_ingress_port] + if self.sut_egress_port is not None and self.sut_ingress_port is not None + else None, ) as testpmd: try: testpmd.set_num_queues_all(2, True, verify=True) From patchwork Fri Sep 6 17:37:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 143763 X-Patchwork-Delegate: juraj.linkes@pantheon.tech Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D804845920; Fri, 6 Sep 2024 19:37:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE13842FE7; Fri, 6 Sep 2024 19:37:44 +0200 (CEST) Received: from mail-io1-f100.google.com (mail-io1-f100.google.com [209.85.166.100]) by mails.dpdk.org (Postfix) with ESMTP id 64DC0400D5 for ; Fri, 6 Sep 2024 19:37:43 +0200 (CEST) Received: by mail-io1-f100.google.com with SMTP id ca18e2360f4ac-82a2a035b59so113898839f.0 for ; Fri, 06 Sep 2024 10:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1725644263; x=1726249063; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TP0pzFr5Kn4ney9WJlMdcdSW8qL3WBfKX+UMZji0wA4=; b=eWeLHVvTihYsbSkDPJ/UhrVw4/DHZ3BCoHCxC23unCtcS3qFgh7re82PmaY90/3Gmv zNYwa0LNtSQ56DlOYvp8EtuDh9te/i3Fpty54jZHDp5RB8TF4qlJfmT0r3435u9YmcUc 2mwmUKPfaIBoU07wIGl8kwu0EfJljb/qOkPmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725644263; x=1726249063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TP0pzFr5Kn4ney9WJlMdcdSW8qL3WBfKX+UMZji0wA4=; b=LLYxKOXM9v3kbzQoOlBkYK/tr8nI3G+L+6+dwDJqWRSTUQLC88M7txFJfdMFLPP+N+ 3Bd61021LbPezwm7ZsQNbErJoJMn1527pDKGVbGsJRTwpizEsVlUasnndhj3jPurc+xh HHYHsfomKZOYdXBC/hp1Mx0szkGkFYpjl8VTsxYkjqjlqvKqLYHsp33qqClakVKnicsB IA83IL5EGeu6iH7xiyGIgqFsVbUDFN5QxSqOj1j52eAa3o/efoXPYSeDEFArn2e5LA9J MXwhP61tGbctSUG5RxXb8PUK2V/1tkwbQ7jHOJx4qMB55jj2HyJMq/59uWuComb5ZNYX LoIQ== X-Gm-Message-State: AOJu0YwwPCAu+kYzz5cOE3cbwdZGm2IT0ZPFLqoygO6lUCr/d5mRkSPh w/9N5b97gZ88hC53UpLvRcs14TPwPyN/OzIGGAiqkSnd307Lm75Vq3DFjQ2VxJQ2PRlhfDfkW+w NkWEGlBk/xKdb3FM4S36S5CB0ceeIMOfWzbXKhKqTkHgoCl6b X-Google-Smtp-Source: AGHT+IH+j5dA4KXuy3HrTjPdYr03TgZWn93+Fx/GyJkvIsPeNdxhFtz2B5IbPuPogygz9ENH8LepW6gxyvBr X-Received: by 2002:a05:6e02:1e06:b0:39f:6180:afca with SMTP id e9e14a558f8ab-3a056879d4amr3811125ab.13.1725644262676; Fri, 06 Sep 2024 10:37:42 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id e9e14a558f8ab-39f5f2a6a36sm4029475ab.8.2024.09.06.10.37.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2024 10:37:42 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id A923D6050A6D; Fri, 6 Sep 2024 13:37:41 -0400 (EDT) From: jspewock@iol.unh.edu To: npratte@iol.unh.edu, thomas@monjalon.net, alex.chapman@arm.com, probb@iol.unh.edu, wathsala.vithanage@arm.com, Luca.Vizzarro@arm.com, Honnappa.Nagarahalli@arm.com, yoan.picchi@foss.arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 3/3] dts: add vf_smoke tests suite Date: Fri, 6 Sep 2024 13:37:09 -0400 Message-ID: <20240906173709.17487-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240906173709.17487-1-jspewock@iol.unh.edu> References: <20240906173709.17487-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock VFs should be tested against the same criteria as PFs, therefore the smoke testing suite for VFs inherits the same test cases and testing coverage from the PF smoke testing suite. The primary difference between the two suites is that VF smoke initially creates virtual functions to use for testing, and then tears them down at the end of testing and resets the state of the PFs. Signed-off-by: Jeremy Spewock --- dts/framework/config/conf_yaml_schema.json | 3 ++- dts/tests/TestSuite_vf_smoke_tests.py | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 dts/tests/TestSuite_vf_smoke_tests.py diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json index 910134f9e4..1a9d497fbf 100644 --- a/dts/framework/config/conf_yaml_schema.json +++ b/dts/framework/config/conf_yaml_schema.json @@ -188,7 +188,8 @@ "hello_world", "os_udp", "pmd_buffer_scatter", - "pf_smoke_tests" + "pf_smoke_tests", + "vf_smoke_tests" ] }, "test_target": { diff --git a/dts/tests/TestSuite_vf_smoke_tests.py b/dts/tests/TestSuite_vf_smoke_tests.py new file mode 100644 index 0000000000..f9b6098111 --- /dev/null +++ b/dts/tests/TestSuite_vf_smoke_tests.py @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2024 University of New Hampshire +"""Virtual Function (VF) smoke testing suite. + +The same common DPDK functionality that is tested on physical functions (PFs) in +:class:`.TestSuite_pf_smoke_tests.TestPfSmokeTests` should be tested on VFs. Therefore, this test +suite inherits its test cases from the PF smoke testing suite. The primary difference in this +testing suite is that it creates virtual functions prior to running its test cases and then removes +them and resets the state of the PFs after it is finished. +""" +from .TestSuite_pf_smoke_tests import TestPfSmokeTests # type: ignore[import-untyped] + + +class TestVfSmokeTests(TestPfSmokeTests): + """VF smoke testing suite.""" + + def set_up_suite(self) -> None: + """Extends :meth:`TestPfSmokeTests.set_up_suite` with methods to create Rx/Tx VFs.""" + super().set_up_suite() + self.sut_egress_port = self.sut_node.create_virtual_functions(1, self._sut_port_egress)[0] + self.sut_ingress_port = self.sut_node.create_virtual_functions(1, self._sut_port_ingress)[0] + + def tear_down_suite(self) -> None: + """Extends :meth:`TestPfSmokeTests.tear_down_suite` with VF cleanup and PF rebinding.""" + super().tear_down_suite() + self.sut_node.remove_virtual_functions(self._sut_port_egress) + self.sut_node.remove_virtual_functions(self._sut_port_ingress) + self.sut_node.bind_all_ports_to_driver()