All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Bailey <abailey@iol.unh.edu>
To: dev@dpdk.org, luca.vizzarro@arm.com, patrickrobb1997@gmail.com
Cc: knimoji@iol.unh.edu, lylavoie@iol.unh.edu, dladd@iol.unh.edu,
	Andrew Bailey <abailey@iol.unh.edu>,
	Dean Marx <dmarx@iol.unh.edu>
Subject: [PATCH v6 4/8] dts: separate Linux session into interface and logic
Date: Wed,  2 Sep 2026 14:13:28 -0400	[thread overview]
Message-ID: <20260902181333.461556-5-abailey@iol.unh.edu> (raw)
In-Reply-To: <20260902181333.461556-1-abailey@iol.unh.edu>

Separate Linux session into an interface for the API,
and a logical module in the framework.

Signed-off-by: Andrew Bailey <abailey@iol.unh.edu>
Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
 dts/api/testbed_model/linux_session.py       | 42 ++++++++++++++++++++
 dts/framework/testbed_model/linux_session.py |  3 +-
 dts/tests/TestSuite_smoke_tests.py           |  2 +-
 dts/tests/TestSuite_virtio_forward.py        |  3 +-
 4 files changed, 47 insertions(+), 3 deletions(-)
 create mode 100644 dts/api/testbed_model/linux_session.py

diff --git a/dts/api/testbed_model/linux_session.py b/dts/api/testbed_model/linux_session.py
new file mode 100644
index 0000000000..1b9f6d8339
--- /dev/null
+++ b/dts/api/testbed_model/linux_session.py
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2026 University of New Hampshire
+
+"""Linux OS translator.
+
+Translate OS-unaware calls into Linux calls/utilities. Most of Linux distributions are mostly
+compliant with POSIX standards, so this module only implements the parts that aren't.
+This intermediate module implements the common parts of mostly POSIX compliant distributions.
+"""
+
+from abc import ABC, abstractmethod
+from pathlib import PurePath
+
+
+class LinuxSession(ABC):
+    """The implementation of non-Posix compliant parts of Linux."""
+
+    @abstractmethod
+    def set_interface_link_up(self, name: str) -> None:
+        """Set the link status of an interface to up.
+
+        Args:
+            name: the name of the interface
+        """
+
+    @abstractmethod
+    def delete_interface(self, name: str) -> None:
+        """Delete a virtual interface.
+
+        Args:
+            name: the name of the interface to delete.
+        """
+
+    @property
+    @abstractmethod
+    def devbind_script_path(self) -> PurePath:
+        """The path to the dpdk-devbind.py script on the node."""
+
+    @devbind_script_path.setter
+    @abstractmethod
+    def devbind_script_path(self, value: PurePath) -> None:
+        """The path to the dpdk-devbind.py script on the node."""
diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py
index 26c53f069c..13dce6455d 100644
--- a/dts/framework/testbed_model/linux_session.py
+++ b/dts/framework/testbed_model/linux_session.py
@@ -23,6 +23,7 @@
     InternalError,
     RemoteCommandExecutionError,
 )
+from api.testbed_model.linux_session import LinuxSession as LinuxSessionBase
 from api.utils import expand_range
 from framework.testbed_model.port import PortInfo
 
@@ -79,7 +80,7 @@ class LshwOutput(TypedDict):
     configuration: LshwConfigurationOutput
 
 
-class LinuxSession(PosixSession):
+class LinuxSession(PosixSession, LinuxSessionBase):
     """The implementation of non-Posix compliant parts of Linux."""
 
     @staticmethod
diff --git a/dts/tests/TestSuite_smoke_tests.py b/dts/tests/TestSuite_smoke_tests.py
index fce83604a6..656e2e4bb7 100644
--- a/dts/tests/TestSuite_smoke_tests.py
+++ b/dts/tests/TestSuite_smoke_tests.py
@@ -19,12 +19,12 @@
     requires_link_topology,
 )
 from api.test import verify
+from api.testbed_model.linux_session import LinuxSession
 from api.testpmd import TestPmd
 from api.utils import REGEX_FOR_PCI_ADDRESS
 from framework.config.node import PortConfig
 from framework.settings import SETTINGS
 from framework.test_suite import TestSuite, func_test
-from framework.testbed_model.linux_session import LinuxSession
 
 
 @requires_link_topology(LinkTopology.NO_LINK)
diff --git a/dts/tests/TestSuite_virtio_forward.py b/dts/tests/TestSuite_virtio_forward.py
index 6efaa4e156..6c4d7532c7 100644
--- a/dts/tests/TestSuite_virtio_forward.py
+++ b/dts/tests/TestSuite_virtio_forward.py
@@ -12,11 +12,11 @@
 from api.capabilities import LinkTopology
 from api.packet import send_packets_and_capture
 from api.test import log, verify
+from api.testbed_model.linux_session import LinuxSession
 from api.testpmd import TestPmd
 from api.testpmd.config import PortTopology, SimpleForwardingModes
 from framework.test_suite import TestSuite, func_test
 from framework.testbed_model.capability import requires
-from framework.testbed_model.linux_session import LinuxSession
 from framework.testbed_model.virtual_device import VirtualDevice
 
 
@@ -152,6 +152,7 @@ def pvp_loop(self) -> None:
         """
         self.sut_node = self._ctx.sut_node
         if not isinstance(self.sut_node.main_session, LinuxSession):
+            print(f"\n\nSESSION: {self.sut_node.main_session}")
             verify(False, "Must be running on a Linux environment.")
         # delete tap0 interface if it exists
         self.sut_node.main_session.delete_interface(name="tap0")
-- 
2.55.0


  parent reply	other threads:[~2026-09-02 18:14 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 13:53 [PATCH v5 0/7] dts: remove imports from framework in test suites Andrew Bailey
2026-08-06 13:53 ` [PATCH v5 1/7] dts: move exception module from framework to API Andrew Bailey
2026-08-06 13:53 ` [PATCH v5 2/7] dts: move utils " Andrew Bailey
2026-08-06 13:53 ` [PATCH v5 3/7] dts: move context " Andrew Bailey
2026-08-06 13:53 ` [PATCH v5 4/7] dts: move testbed model " Andrew Bailey
2026-08-06 13:53 ` [PATCH v5 5/7] dts: move test suite module " Andrew Bailey
2026-08-06 13:53 ` [PATCH v5 6/7] dts: move params directory " Andrew Bailey
2026-08-06 13:53 ` [PATCH v5 7/7] dts: separate Linux session into interface and logic Andrew Bailey
2026-08-06 17:16 ` [PATCH v6 0/7] dts: remove imports from framework in test suites Andrew Bailey
2026-08-06 17:16   ` [PATCH v6 1/7] doc: improve 26.07 release notes Andrew Bailey
2026-08-06 17:19     ` Andrew Bailey
2026-08-06 17:16   ` [PATCH v6 2/7] version: 26.07.0 Andrew Bailey
2026-08-06 17:19     ` Andrew Bailey
2026-08-06 17:16   ` [PATCH v6 3/7] version: 26.11.0-rc0 Andrew Bailey
2026-08-06 17:20     ` Andrew Bailey
2026-08-06 17:16   ` [PATCH v6 4/7] ethdev: remove flow metadata symbol aliases Andrew Bailey
2026-08-06 17:20     ` Andrew Bailey
2026-08-06 17:16   ` [PATCH v6 5/7] net/mlx5: remove versioned symbols aliases Andrew Bailey
2026-08-06 17:20     ` Andrew Bailey
2026-08-06 17:16   ` [PATCH v6 6/7] dmadev: fix incomplete configuration validation Andrew Bailey
2026-08-06 17:21     ` Andrew Bailey
2026-08-06 17:16   ` [PATCH v6 7/7] lib: remove ICMP and IPv6 deprecated functions and macros Andrew Bailey
2026-08-06 17:21     ` Andrew Bailey
2026-08-06 17:50 ` [PATCH v6 0/7] dts: remove imports from framework in test suites Andrew Bailey
2026-08-06 17:50   ` [PATCH v6 1/7] dts: move exception module from framework to API Andrew Bailey
2026-08-06 17:50   ` [PATCH v6 2/7] dts: move utils " Andrew Bailey
2026-08-06 17:50   ` [PATCH v6 3/7] dts: move context " Andrew Bailey
2026-08-06 17:50   ` [PATCH v6 4/7] dts: move testbed model " Andrew Bailey
2026-08-06 17:50   ` [PATCH v6 5/7] dts: move test suite module " Andrew Bailey
2026-08-06 17:50   ` [PATCH v6 6/7] dts: move params directory " Andrew Bailey
2026-08-06 17:50   ` [PATCH v6 7/7] dts: separate Linux session into interface and logic Andrew Bailey
2026-08-07 16:16 ` [PATCH v7 0/7] dts: remove imports from framework in test suites Andrew Bailey
2026-08-07 16:16   ` [PATCH v7 1/7] dts: move exception module from framework to API Andrew Bailey
2026-08-20 13:48     ` Luca Vizzarro
2026-08-07 16:16   ` [PATCH v7 2/7] dts: move utils " Andrew Bailey
2026-08-20 13:50     ` Luca Vizzarro
2026-08-07 16:16   ` [PATCH v7 3/7] dts: move context " Andrew Bailey
2026-08-20 13:51     ` Luca Vizzarro
2026-08-07 16:16   ` [PATCH v7 4/7] dts: move testbed model " Andrew Bailey
2026-08-20 13:53     ` Luca Vizzarro
2026-08-07 16:16   ` [PATCH v7 5/7] dts: move test suite module " Andrew Bailey
2026-08-20 13:55     ` Luca Vizzarro
2026-08-07 16:16   ` [PATCH v7 6/7] dts: move params directory " Andrew Bailey
2026-08-20 13:56     ` Luca Vizzarro
2026-08-07 16:16   ` [PATCH v7 7/7] dts: separate Linux session into interface and logic Andrew Bailey
2026-08-20 14:03     ` Luca Vizzarro
2026-08-20 14:04   ` [PATCH v7 0/7] dts: remove imports from framework in test suites Luca Vizzarro
2026-09-02 18:13 ` [PATCH v6 0/8] " Andrew Bailey
2026-09-02 18:13   ` [PATCH v6 1/8] dts: move exception module from framework to API Andrew Bailey
2026-09-02 18:13   ` [PATCH v6 2/8] dts: move utils " Andrew Bailey
2026-09-02 18:13   ` [PATCH v6 3/8] dts: move context " Andrew Bailey
2026-09-02 18:13   ` Andrew Bailey [this message]
2026-09-02 18:13   ` [PATCH v6 5/8] dts: port base traffic generators " Andrew Bailey
2026-09-02 18:13   ` [PATCH v6 6/8] dts: move testbed model from framework " Andrew Bailey
2026-09-02 18:13   ` [PATCH v6 7/8] dts: move test suite module " Andrew Bailey
2026-09-02 18:13   ` [PATCH v6 8/8] dts: move params directory " Andrew Bailey

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=20260902181333.461556-5-abailey@iol.unh.edu \
    --to=abailey@iol.unh.edu \
    --cc=dev@dpdk.org \
    --cc=dladd@iol.unh.edu \
    --cc=dmarx@iol.unh.edu \
    --cc=knimoji@iol.unh.edu \
    --cc=luca.vizzarro@arm.com \
    --cc=lylavoie@iol.unh.edu \
    --cc=patrickrobb1997@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.