From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F5D84557F; Fri, 6 Sep 2024 15:27:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64F2942F59; Fri, 6 Sep 2024 15:27:05 +0200 (CEST) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mails.dpdk.org (Postfix) with ESMTP id 2AF4742EFF for ; Fri, 6 Sep 2024 15:27:03 +0200 (CEST) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a7a843bef98so247758166b.2 for ; Fri, 06 Sep 2024 06:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1725629223; x=1726234023; 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=ikkKuC2x40e+WhJ7Q/c2WtI7bWB2oBOllYLIHvbCTC4=; b=MgD5opuPzaAf2HestqxnTlckYS6hf61YfH6nN2rpPK1Jl3lr7LwHXCwYC8wFrQkEZy Pa0JN2m9+JAxNDandU1VU7GdZFJSogTgWR01NFbE4nS/rOK8SGBuiM2+4nHQH8UlufgH V7U8lkBgYR+XGj/DM5tJWZN8q83+0QNAO3kSdCGme0iGAix34BUNyQBsRIFxuGVbyZu+ PZFS7sMzgRCMW5PSN8HaDnJdWc70gcdQBvIxLgG7LqAKL4o9coZIKEU7Wed0Ewl/7BUn 6CHxRte03kEZ4BA4L06VItxQu+MZOJxklymmWWBhNGD8tdr5LaT0LDlx5LOg7EzODqPX 46MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725629223; x=1726234023; 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=ikkKuC2x40e+WhJ7Q/c2WtI7bWB2oBOllYLIHvbCTC4=; b=IS4JQ1vXi77oNeUJNqMC7Cy4NHU8Uffo0XX0ELXtAVNqqrRKNZt/A5dUYnnUDQDBDV FzwwHZ4QfnuMepNOt4gVK7UeFCfNwjiceKgGlhCVgn6LRfRwprjGa49ltcIIDO9hPWP6 o9j0bZ44nW2z8CRzlqkz0RJZ98tan+uXCGBUoPitn1eySAtTNjYKK93LLiP8uGpZdVP6 bxvKJblUA74Xcx37ODaUSYanSqIlLjfsofLemfgyBT8YdBh1vfIp8n0T653690XPJeHw Bx+8KcvCYlxJWjxTvx7JQ95FOLh0IodyHVu3yb2B8XUA9y5kzN98d/nnQ0SupeBR8sWE fIpA== X-Gm-Message-State: AOJu0YyEtOLMH9L+xhRPswpS8m+h6lg/MAqeNlMw7FWuVLRXjRRmSDYy wsE42kse/Q5GfIV8F7xxVoYdUA46wZ2hwqQ2WL4Gwvcknj7K0+COFdBGl6+z3IU= X-Google-Smtp-Source: AGHT+IEhdLgEC5SZiPXkamN3Y/vff9KUgNHnw9U/NYyeslWLNvjCgFbKepgjsRRvTT4ZJe87AheEYA== X-Received: by 2002:a17:907:705:b0:a89:ffd0:352f with SMTP id a640c23a62f3a-a8a8884997dmr207849266b.48.1725629222623; Fri, 06 Sep 2024 06:27:02 -0700 (PDT) Received: from jlinkes-PT-Latitude-5530.. ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a7c504701sm168943566b.25.2024.09.06.06.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 06:27:02 -0700 (PDT) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= 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, =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Eurovec?= Subject: [RFC PATCH v1 03/12] dts: fix remote session transferring files Date: Fri, 6 Sep 2024 15:26:47 +0200 Message-ID: <20240906132656.21729-4-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240906132656.21729-1-juraj.linkes@pantheon.tech> References: <20240906132656.21729-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Tomáš Ďurovec Fix parameters layout between source and destination according to docs. Signed-off-by: Tomáš Ďurovec --- 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