From: Dean Marx <dmarx@iol.unh.edu>
To: patrickrobb1997@gmail.com, luca.vizzarro@arm.com,
yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com,
paul.szczepanek@arm.com
Cc: dev@dpdk.org, Dean Marx <dmarx@iol.unh.edu>
Subject: [PATCH v1 5/8] dts: move context from framework to API
Date: Thu, 23 Apr 2026 13:03:17 -0400 [thread overview]
Message-ID: <20260423170331.33193-6-dmarx@iol.unh.edu> (raw)
In-Reply-To: <20260423170331.33193-1-dmarx@iol.unh.edu>
A couple test suites import and get the run context
during execution. Move this to the API.
Signed-off-by: Dean Marx <dmarx@iol.unh.edu>
---
dts/api/artifact.py | 2 +-
dts/{framework => api}/context.py | 0
dts/api/cryptodev/__init__.py | 2 +-
dts/api/packet.py | 4 ++--
dts/api/test.py | 2 +-
dts/api/test_suite.py | 4 ++--
dts/api/testbed_model/node.py | 2 +-
dts/api/testbed_model/topology.py | 14 +++++++-------
dts/api/testpmd/__init__.py | 2 +-
dts/framework/remote_session/blocking_app.py | 2 +-
dts/framework/remote_session/dpdk.py | 2 +-
dts/framework/remote_session/dpdk_shell.py | 2 +-
dts/framework/remote_session/interactive_shell.py | 2 +-
dts/framework/test_run.py | 2 +-
dts/tests/TestSuite_cryptodev_throughput.py | 2 +-
dts/tests/TestSuite_l2fwd.py | 2 +-
16 files changed, 23 insertions(+), 23 deletions(-)
rename dts/{framework => api}/context.py (100%)
diff --git a/dts/api/artifact.py b/dts/api/artifact.py
index 02d807241f..74a8ac667f 100644
--- a/dts/api/artifact.py
+++ b/dts/api/artifact.py
@@ -86,7 +86,7 @@ def make_file_path(
path /= custom_path
else:
- from framework.context import get_ctx
+ from api.context import get_ctx
try:
ctx = get_ctx()
diff --git a/dts/framework/context.py b/dts/api/context.py
similarity index 100%
rename from dts/framework/context.py
rename to dts/api/context.py
diff --git a/dts/api/cryptodev/__init__.py b/dts/api/cryptodev/__init__.py
index c6a220dced..67dcb02130 100644
--- a/dts/api/cryptodev/__init__.py
+++ b/dts/api/cryptodev/__init__.py
@@ -23,7 +23,7 @@
VerifyResults,
)
from api.exception import RemoteCommandExecutionError, SkippedTestException
-from framework.context import get_ctx
+from api.context import get_ctx
from framework.remote_session.dpdk_shell import compute_eal_params
if TYPE_CHECKING:
diff --git a/dts/api/packet.py b/dts/api/packet.py
index 2be00ad48a..393fee542b 100644
--- a/dts/api/packet.py
+++ b/dts/api/packet.py
@@ -36,7 +36,7 @@
PerformanceTrafficStats,
)
from api.utils import get_packet_summaries
-from framework.context import get_ctx
+from api.context import get_ctx
def send_packet_and_capture(
@@ -85,7 +85,7 @@ def send_packets_and_capture(
from api.testbed_model.traffic_generator.capturing_traffic_generator import (
CapturingTrafficGenerator,
)
- from framework.context import get_ctx
+ from api.context import get_ctx
assert isinstance(
get_ctx().func_tg, CapturingTrafficGenerator
diff --git a/dts/api/test.py b/dts/api/test.py
index 9cad9a9495..a1f2326075 100644
--- a/dts/api/test.py
+++ b/dts/api/test.py
@@ -11,7 +11,7 @@
from api.artifact import Artifact
from api.exception import InternalError, SkippedTestException, TestCaseVerifyError
-from framework.context import get_ctx
+from api.context import get_ctx
from framework.logger import DTSLogger
diff --git a/dts/api/test_suite.py b/dts/api/test_suite.py
index 7feb35a9f8..0822f9bfe5 100644
--- a/dts/api/test_suite.py
+++ b/dts/api/test_suite.py
@@ -37,7 +37,7 @@
from framework.logger import DTSLogger, get_dts_logger
if TYPE_CHECKING:
- from framework.context import Context
+ from api.context import Context
class BaseConfig(FrozenModel):
@@ -91,7 +91,7 @@ def __init__(self, config: BaseConfig) -> None:
Args:
config: The test suite configuration.
"""
- from framework.context import get_ctx
+ from api.context import get_ctx
self.config = config
self._ctx = get_ctx()
diff --git a/dts/api/testbed_model/node.py b/dts/api/testbed_model/node.py
index 4f42bf6aeb..40dd7f0666 100644
--- a/dts/api/testbed_model/node.py
+++ b/dts/api/testbed_model/node.py
@@ -242,7 +242,7 @@ def get_node(node_identifier: NodeIdentifier) -> Node | None:
if node_identifier == "local":
return None
- from framework.context import get_ctx
+ from api.context import get_ctx
ctx = get_ctx()
if node_identifier == "sut":
diff --git a/dts/api/testbed_model/topology.py b/dts/api/testbed_model/topology.py
index 5b8fe03836..11593d64d5 100644
--- a/dts/api/testbed_model/topology.py
+++ b/dts/api/testbed_model/topology.py
@@ -96,7 +96,7 @@ def node_and_ports_from_id(self, node_identifier: NodeIdentifier) -> tuple[Node,
Raises:
InternalError: If the given `node_identifier` is invalid.
"""
- from framework.context import get_ctx
+ from api.context import get_ctx
ctx = get_ctx()
match node_identifier:
@@ -180,7 +180,7 @@ def instantiate_crypto_ports(self) -> None:
Raises:
InternalError: If crypto virtual functions could not be created on a port.
"""
- from framework.context import get_ctx
+ from api.context import get_ctx
ctx = get_ctx()
for port in ctx.sut_node.cryptodevs:
@@ -206,7 +206,7 @@ def instantiate_vf_ports(self) -> None:
Raises:
InternalError: If virtual function creation fails.
"""
- from framework.context import get_ctx
+ from api.context import get_ctx
ctx = get_ctx()
@@ -235,7 +235,7 @@ def instantiate_vf_ports(self) -> None:
def delete_vf_ports(self) -> None:
"""Delete virtual functions from the SUT node during test run teardown."""
- from framework.context import get_ctx
+ from api.context import get_ctx
ctx = get_ctx()
@@ -246,7 +246,7 @@ def delete_vf_ports(self) -> None:
def delete_crypto_vf_ports(self) -> None:
"""Delete crypto virtual functions from the SUT node during test run teardown."""
- from framework.context import get_ctx
+ from api.context import get_ctx
ctx = get_ctx()
@@ -259,7 +259,7 @@ def bind_cryptodevs(self, driver: DriverKind):
Args:
driver: The driver to bind the crypto functions
"""
- from framework.context import get_ctx
+ from api.context import get_ctx
self._bind_ports_to_drivers(get_ctx().sut_node, self.crypto_vf_ports, driver)
@@ -318,7 +318,7 @@ def _prepare_devbind_script(self) -> None:
Raises:
InternalError: If dpdk-devbind.py could not be found.
"""
- from framework.context import get_ctx
+ from api.context import get_ctx
local_script_path = Path("..", "usertools", "dpdk-devbind.py").resolve()
valid_script_path = local_script_path.exists()
diff --git a/dts/api/testpmd/__init__.py b/dts/api/testpmd/__init__.py
index 9498d723d5..a528663c21 100644
--- a/dts/api/testpmd/__init__.py
+++ b/dts/api/testpmd/__init__.py
@@ -55,7 +55,7 @@
TxOffloadConfiguration,
VLANOffloadFlag,
)
-from framework.context import get_ctx
+from api.context import get_ctx
from framework.params.types import TestPmdParamsDict
from framework.remote_session.dpdk_shell import DPDKShell
from framework.remote_session.interactive_shell import only_active
diff --git a/dts/framework/remote_session/blocking_app.py b/dts/framework/remote_session/blocking_app.py
index 4181c20e43..955a7ccdba 100644
--- a/dts/framework/remote_session/blocking_app.py
+++ b/dts/framework/remote_session/blocking_app.py
@@ -31,7 +31,7 @@
from typing_extensions import Self
from api.testbed_model.node import Node
-from framework.context import get_ctx
+from api.context import get_ctx
from framework.params import Params
from framework.params.eal import EalParams
from framework.remote_session.dpdk_shell import compute_eal_params
diff --git a/dts/framework/remote_session/dpdk.py b/dts/framework/remote_session/dpdk.py
index 1a4fec8ec9..68897bfefe 100644
--- a/dts/framework/remote_session/dpdk.py
+++ b/dts/framework/remote_session/dpdk.py
@@ -30,7 +30,7 @@
RemoteDPDKTarballLocation,
RemoteDPDKTreeLocation,
)
-from framework.context import get_ctx
+from api.context import get_ctx
from framework.logger import DTSLogger, get_dts_logger
from framework.params.eal import EalParams
from framework.remote_session.remote_session import CommandResult
diff --git a/dts/framework/remote_session/dpdk_shell.py b/dts/framework/remote_session/dpdk_shell.py
index ac89ec0459..947f60f75c 100644
--- a/dts/framework/remote_session/dpdk_shell.py
+++ b/dts/framework/remote_session/dpdk_shell.py
@@ -11,7 +11,7 @@
from pathlib import PurePath
from api.testbed_model.cpu import LogicalCoreList
-from framework.context import get_ctx
+from api.context import get_ctx
from framework.params.eal import EalParams
from framework.remote_session.interactive_shell import (
InteractiveShell,
diff --git a/dts/framework/remote_session/interactive_shell.py b/dts/framework/remote_session/interactive_shell.py
index 15743949e7..6aebef3f45 100644
--- a/dts/framework/remote_session/interactive_shell.py
+++ b/dts/framework/remote_session/interactive_shell.py
@@ -35,7 +35,7 @@
InteractiveSSHTimeoutError,
)
from api.testbed_model.node import Node
-from framework.context import get_ctx
+from api.context import get_ctx
from framework.logger import DTSLogger, get_dts_logger
from framework.params import Params
from framework.settings import SETTINGS
diff --git a/dts/framework/test_run.py b/dts/framework/test_run.py
index 9972d26b04..914bf9491d 100644
--- a/dts/framework/test_run.py
+++ b/dts/framework/test_run.py
@@ -117,7 +117,7 @@
from api.testbed_model.topology import PortLink, Topology
from api.testbed_model.traffic_generator import create_traffic_generator
from framework.config.test_run import TestRunConfiguration
-from framework.context import Context, init_ctx
+from api.context import Context, init_ctx
from framework.logger import DTSLogger, get_dts_logger
from framework.remote_session.dpdk import DPDKBuildEnvironment, DPDKRuntimeEnvironment
from framework.settings import SETTINGS
diff --git a/dts/tests/TestSuite_cryptodev_throughput.py b/dts/tests/TestSuite_cryptodev_throughput.py
index fb6fda3bac..67ebbc64c2 100644
--- a/dts/tests/TestSuite_cryptodev_throughput.py
+++ b/dts/tests/TestSuite_cryptodev_throughput.py
@@ -33,7 +33,7 @@
from api.test import verify
from api.test_suite import BaseConfig, TestSuite, crypto_test
from api.testbed_model.virtual_device import VirtualDevice
-from framework.context import get_ctx
+from api.context import get_ctx
config_list: list[dict[str, int | float | str]] = [
{"buff_size": 64, "Gbps": 1.00},
diff --git a/dts/tests/TestSuite_l2fwd.py b/dts/tests/TestSuite_l2fwd.py
index 0b0b7bc931..f4833340a6 100644
--- a/dts/tests/TestSuite_l2fwd.py
+++ b/dts/tests/TestSuite_l2fwd.py
@@ -23,7 +23,7 @@
from api.testpmd import TestPmd
from api.testpmd.config import EthPeer, SimpleForwardingModes
from api.utils import generate_random_packets
-from framework.context import filter_cores
+from api.context import filter_cores
@requires_nic_capability(NicCapability.PHYSICAL_FUNCTION)
--
2.52.0
next prev parent reply other threads:[~2026-04-23 17:04 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 15:53 [PATCH v1 0/4] dts: add dynamic queue configuration test suite jspewock
2024-06-25 15:53 ` [PATCH v1 1/4] dts: add send_packets to test suites and rework packet addressing jspewock
2024-06-25 15:53 ` [PATCH v1 2/4] dts: add port queue modification and forwarding stats to testpmd jspewock
2024-06-25 15:53 ` [PATCH v1 3/4] dts: add dynamic queue test suite jspewock
2024-06-25 15:53 ` [PATCH v1 4/4] dts: add dynamic queue conf to the yaml schema jspewock
2024-07-03 21:58 ` [PATCH v2 0/4] dts: add dynamic queue configuration test suite jspewock
2024-07-03 21:58 ` [PATCH v2 1/4] dts: add send_packets to test suites and rework packet addressing jspewock
2024-07-03 21:58 ` [PATCH v2 2/4] dts: add port queue modification and forwarding stats to testpmd jspewock
2024-07-03 21:58 ` [PATCH v2 3/4] dts: add dynamic queue test suite jspewock
2024-07-03 21:58 ` [PATCH v2 4/4] dts: add dynamic queue conf to the yaml schema jspewock
2024-07-24 15:07 ` [PATCH v3 0/4] dts: add dynamic queue configuration test suite jspewock
2024-07-24 15:07 ` [PATCH v3 1/4] dts: add send_packets to test suites and rework packet addressing jspewock
2024-07-26 14:37 ` Nicholas Pratte
2024-07-26 19:00 ` Nicholas Pratte
2024-07-26 19:13 ` Jeremy Spewock
2024-08-29 19:42 ` Nicholas Pratte
2024-07-24 15:07 ` [PATCH v3 2/4] dts: add port queue modification and forwarding stats to testpmd jspewock
2024-07-24 15:07 ` [PATCH v3 3/4] dts: add dynamic queue test suite jspewock
2024-07-24 15:07 ` [PATCH v3 4/4] dts: add dynamic queue conf to the yaml schema jspewock
2024-09-04 15:49 ` [PATCH v4 0/2] dts: add dynamic queue configuration test suite jspewock
2024-09-04 15:49 ` [PATCH v4 1/2] dts: add port queue modification and forwarding stats to testpmd jspewock
2024-09-04 15:49 ` [PATCH v4 2/2] dts: add dynamic queue test suite jspewock
2024-09-25 19:20 ` [PATCH v5 0/2] dts: add dynamic queue configuration " jspewock
2024-09-25 19:20 ` [PATCH v5 1/2] dts: add port queue modification and forwarding stats to testpmd jspewock
2024-09-25 19:20 ` [PATCH v5 2/2] dts: add dynamic queue test suite jspewock
2024-11-05 16:58 ` [PATCH v6 0/2] dts: add dynamic queue configuration " Dean Marx
2024-11-05 16:58 ` [PATCH v6 1/2] dts: add port queue modification and forwarding stats to testpmd Dean Marx
2024-11-18 23:25 ` Patrick Robb
2024-11-18 23:36 ` Patrick Robb
2024-11-05 16:58 ` [PATCH v6 2/2] dts: add dynamic queue test suite Dean Marx
2024-11-18 23:24 ` Patrick Robb
2024-11-18 23:24 ` Patrick Robb
2026-04-23 17:03 ` [PATCH v1 0/8] dts: move test suite imports from framework to API Dean Marx
2026-04-23 17:03 ` [PATCH v1 1/8] dts: move test suite module " Dean Marx
2026-04-23 17:03 ` [PATCH v1 2/8] dts: move testbed model " Dean Marx
2026-04-23 17:03 ` [PATCH v1 3/8] dts: move exception module " Dean Marx
2026-04-23 17:03 ` [PATCH v1 4/8] dts: move utils " Dean Marx
2026-04-23 17:03 ` Dean Marx [this message]
2026-04-23 17:03 ` [PATCH v1 6/8] dts: move params directory " Dean Marx
2026-04-23 17:03 ` [PATCH v1 7/8] dts: separate Linux session into interface and logic Dean Marx
2026-04-23 17:03 ` [PATCH v1 8/8] dts: update API rst files for doc build Dean Marx
2026-04-23 19:04 ` [PATCH v2 0/7] dts: move test suite imports from framework to API Dean Marx
2026-04-23 19:04 ` [PATCH v2 1/7] dts: move test suite module " Dean Marx
2026-04-23 19:04 ` [PATCH v2 2/7] dts: move testbed model " Dean Marx
2026-04-23 19:04 ` [PATCH v2 3/7] dts: move exception module " Dean Marx
2026-04-23 19:04 ` [PATCH v2 4/7] dts: move utils " Dean Marx
2026-04-23 19:04 ` [PATCH v2 5/7] dts: move context " Dean Marx
2026-04-23 19:04 ` [PATCH v2 6/7] dts: move params directory " Dean Marx
2026-04-23 19:04 ` [PATCH v2 7/7] dts: separate Linux session into interface and logic Dean Marx
2026-04-24 17:01 ` [PATCH v3 0/7] dts: move test suite imports from framework to API Dean Marx
2026-04-24 17:01 ` [PATCH v3 1/7] dts: move exception module " Dean Marx
2026-04-24 17:01 ` [PATCH v3 2/7] dts: move utils " Dean Marx
2026-04-24 17:01 ` [PATCH v3 3/7] dts: move context " Dean Marx
2026-04-24 17:01 ` [PATCH v3 4/7] dts: move testbed model " Dean Marx
2026-04-24 17:01 ` [PATCH v3 5/7] dts: move test suite module " Dean Marx
2026-04-24 17:01 ` [PATCH v3 6/7] dts: move params directory " Dean Marx
2026-04-24 17:01 ` [PATCH v3 7/7] dts: separate Linux session into interface and logic Dean Marx
2026-04-28 18:08 ` [PATCH v4 0/7] dts: move test suite imports from framework to API Dean Marx
2026-04-28 18:08 ` [PATCH v4 1/7] dts: move exception module " Dean Marx
2026-04-28 18:08 ` [PATCH v4 2/7] dts: move utils " Dean Marx
2026-04-28 18:08 ` [PATCH v4 3/7] dts: move context " Dean Marx
2026-04-28 18:08 ` [PATCH v4 4/7] dts: move testbed model " Dean Marx
2026-04-28 18:08 ` [PATCH v4 5/7] dts: move test suite module " Dean Marx
2026-04-28 18:08 ` [PATCH v4 6/7] dts: move params directory " Dean Marx
2026-04-28 18:08 ` [PATCH v4 7/7] dts: separate Linux session into interface and logic Dean Marx
2026-04-30 21:09 ` [PATCH v4 0/7] dts: move test suite imports from framework to API Dean Marx
2026-04-30 21:09 ` [PATCH v4 1/7] dts: move exception module " Dean Marx
2026-04-30 21:09 ` [PATCH v4 2/7] dts: move utils " Dean Marx
2026-04-30 21:09 ` [PATCH v4 3/7] dts: move context " Dean Marx
2026-04-30 21:09 ` [PATCH v4 4/7] dts: move testbed model " Dean Marx
2026-04-30 21:09 ` [PATCH v4 5/7] dts: move test suite module " Dean Marx
2026-04-30 21:09 ` [PATCH v4 6/7] dts: move params directory " Dean Marx
2026-04-30 21:09 ` [PATCH v4 7/7] dts: separate Linux session into interface and logic Dean Marx
2026-04-30 22:06 ` [PATCH v4 0/7] dts: move test suite imports from framework to API Dean Marx
2026-04-30 22:06 ` [PATCH v4 1/7] dts: move exception module " Dean Marx
2026-04-30 22:06 ` [PATCH v4 2/7] dts: move utils " Dean Marx
2026-04-30 22:06 ` [PATCH v4 3/7] dts: move context " Dean Marx
2026-04-30 22:06 ` [PATCH v4 4/7] dts: move testbed model " Dean Marx
2026-04-30 22:06 ` [PATCH v4 5/7] dts: move test suite module " Dean Marx
2026-04-30 22:06 ` [PATCH v4 6/7] dts: move params directory " Dean Marx
2026-04-30 22:06 ` [PATCH v4 7/7] dts: separate Linux session into interface and logic Dean Marx
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=20260423170331.33193-6-dmarx@iol.unh.edu \
--to=dmarx@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=dev@dpdk.org \
--cc=luca.vizzarro@arm.com \
--cc=patrickrobb1997@gmail.com \
--cc=paul.szczepanek@arm.com \
--cc=yoan.picchi@foss.arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox