From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com,
paul.szczepanek@arm.com, Luca.Vizzarro@arm.com,
alex.chapman@arm.com, probb@iol.unh.edu, jspewock@iol.unh.edu,
npratte@iol.unh.edu, dmarx@iol.unh.edu
Cc: dev@dpdk.org, "Tomáš Ďurovec" <tomas.durovec@pantheon.tech>
Subject: [RFC PATCH v1 03/12] dts: fix remote session transferring files
Date: Fri, 6 Sep 2024 15:26:47 +0200 [thread overview]
Message-ID: <20240906132656.21729-4-juraj.linkes@pantheon.tech> (raw)
In-Reply-To: <20240906132656.21729-1-juraj.linkes@pantheon.tech>
From: Tomáš Ďurovec <tomas.durovec@pantheon.tech>
Fix parameters layout between source and destination
according to docs.
Signed-off-by: Tomáš Ďurovec <tomas.durovec@pantheon.tech>
---
dts/framework/remote_session/remote_session.py | 14 ++++++++------
dts/framework/remote_session/ssh_session.py | 8 ++++----
dts/framework/testbed_model/os_session.py | 18 ++++++++++--------
dts/framework/testbed_model/posix_session.py | 8 ++++----
4 files changed, 26 insertions(+), 22 deletions(-)
diff --git a/dts/framework/remote_session/remote_session.py b/dts/framework/remote_session/remote_session.py
index 8c580b070f..6ca8593c90 100644
--- a/dts/framework/remote_session/remote_session.py
+++ b/dts/framework/remote_session/remote_session.py
@@ -199,32 +199,34 @@ def is_alive(self) -> bool:
def copy_from(
self,
source_file: str | PurePath,
- destination_file: str | PurePath,
+ destination_dir: str | PurePath,
) -> None:
"""Copy a file from the remote Node to the local filesystem.
Copy `source_file` from the remote Node associated with this remote session
- to `destination_file` on the local filesystem.
+ to `destination_dir` on the local filesystem.
Args:
source_file: The file on the remote Node.
- destination_file: A file or directory path on the local filesystem.
+ destination_dir: A dir path on the local filesystem, where the `source_file`
+ will be saved.
"""
@abstractmethod
def copy_to(
self,
source_file: str | PurePath,
- destination_file: str | PurePath,
+ destination_dir: str | PurePath,
) -> None:
"""Copy a file from local filesystem to the remote Node.
- Copy `source_file` from local filesystem to `destination_file` on the remote Node
+ Copy `source_file` from local filesystem to `destination_dir` on the remote Node
associated with this remote session.
Args:
source_file: The file on the local filesystem.
- destination_file: A file or directory path on the remote Node.
+ destination_dir: A dir path on the remote Node, where the `source_file`
+ will be saved.
"""
@abstractmethod
diff --git a/dts/framework/remote_session/ssh_session.py b/dts/framework/remote_session/ssh_session.py
index 66f8176833..a756bfecef 100644
--- a/dts/framework/remote_session/ssh_session.py
+++ b/dts/framework/remote_session/ssh_session.py
@@ -106,18 +106,18 @@ def is_alive(self) -> bool:
def copy_from(
self,
source_file: str | PurePath,
- destination_file: str | PurePath,
+ destination_dir: str | PurePath,
) -> None:
"""Overrides :meth:`~.remote_session.RemoteSession.copy_from`."""
- self.session.get(str(destination_file), str(source_file))
+ self.session.get(str(source_file), str(destination_dir))
def copy_to(
self,
source_file: str | PurePath,
- destination_file: str | PurePath,
+ destination_dir: str | PurePath,
) -> None:
"""Overrides :meth:`~.remote_session.RemoteSession.copy_to`."""
- self.session.put(str(source_file), str(destination_file))
+ self.session.put(str(source_file), str(destination_dir))
def close(self) -> None:
"""Overrides :meth:`~.remote_session.RemoteSession.close`."""
diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py
index 79f56b289b..8928a47d6f 100644
--- a/dts/framework/testbed_model/os_session.py
+++ b/dts/framework/testbed_model/os_session.py
@@ -181,32 +181,34 @@ def join_remote_path(self, *args: str | PurePath) -> PurePath:
def copy_from(
self,
source_file: str | PurePath,
- destination_file: str | PurePath,
+ destination_dir: str | PurePath,
) -> None:
"""Copy a file from the remote node to the local filesystem.
Copy `source_file` from the remote node associated with this remote
- session to `destination_file` on the local filesystem.
+ session to `destination_dir` on the local filesystem.
Args:
- source_file: the file on the remote node.
- destination_file: a file or directory path on the local filesystem.
+ source_file: The file on the remote node.
+ destination_dir: A dir path on the local filesystem, where the `source_file`
+ will be saved.
"""
@abstractmethod
def copy_to(
self,
source_file: str | PurePath,
- destination_file: str | PurePath,
+ destination_dir: str | PurePath,
) -> None:
"""Copy a file from local filesystem to the remote node.
- Copy `source_file` from local filesystem to `destination_file`
+ Copy `source_file` from local filesystem to `destination_dir`
on the remote node associated with this remote session.
Args:
- source_file: the file on the local filesystem.
- destination_file: a file or directory path on the remote node.
+ source_file: The file on the local filesystem.
+ destination_dir: A dir path on the remote Node, where the `source_file`
+ will be saved.
"""
@abstractmethod
diff --git a/dts/framework/testbed_model/posix_session.py b/dts/framework/testbed_model/posix_session.py
index d279bb8b53..7f0b1f2036 100644
--- a/dts/framework/testbed_model/posix_session.py
+++ b/dts/framework/testbed_model/posix_session.py
@@ -88,18 +88,18 @@ def join_remote_path(self, *args: str | PurePath) -> PurePosixPath:
def copy_from(
self,
source_file: str | PurePath,
- destination_file: str | PurePath,
+ destination_dir: str | PurePath,
) -> None:
"""Overrides :meth:`~.os_session.OSSession.copy_from`."""
- self.remote_session.copy_from(source_file, destination_file)
+ self.remote_session.copy_from(source_file, destination_dir)
def copy_to(
self,
source_file: str | PurePath,
- destination_file: str | PurePath,
+ destination_dir: str | PurePath,
) -> None:
"""Overrides :meth:`~.os_session.OSSession.copy_to`."""
- self.remote_session.copy_to(source_file, destination_file)
+ self.remote_session.copy_to(source_file, destination_dir)
def remove_remote_dir(
self,
--
2.43.0
next prev parent reply other threads:[~2024-09-06 13:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 13:26 [RFC PATCH v1 00/12] DTS external DPDK build and stats Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 01/12] dts: rename build target to DPDK build Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 02/12] dts: one dpdk build per test run Juraj Linkeš
2024-09-06 13:26 ` Juraj Linkeš [this message]
2024-09-06 13:26 ` [RFC PATCH v1 04/12] dts: improve path handling for local and remote paths Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 05/12] dts: add the ability to copy directories via remote Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 06/12] dts: add ability to prevent overwriting files/dirs Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 07/12] dts: update argument option for prevent overwriting Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 08/12] dts: add support for externally compiled DPDK Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 09/12] doc: update argument options for external DPDK build Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 10/12] dts: remove git ref option Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 11/12] doc: remove git-ref argument Juraj Linkeš
2024-09-06 13:26 ` [RFC PATCH v1 12/12] dts: improve statistics Juraj Linkeš
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=20240906132656.21729-4-juraj.linkes@pantheon.tech \
--to=juraj.linkes@pantheon.tech \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=Luca.Vizzarro@arm.com \
--cc=alex.chapman@arm.com \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--cc=jspewock@iol.unh.edu \
--cc=npratte@iol.unh.edu \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
--cc=thomas@monjalon.net \
--cc=tomas.durovec@pantheon.tech \
/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;
as well as URLs for NNTP newsgroup(s).