Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] package/python-scp: new package
@ 2025-10-17  7:42 Alexis Lothoré via buildroot
  2025-10-17  7:42 ` [Buildroot] [PATCH 1/2] " Alexis Lothoré via buildroot
  2025-10-17  7:42 ` [Buildroot] [PATCH 2/2] support/testing: add runtime tests for python-scp Alexis Lothoré via buildroot
  0 siblings, 2 replies; 5+ messages in thread
From: Alexis Lothoré via buildroot @ 2025-10-17  7:42 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard, Alexis Lothoré, Thomas Petazzoni

Hello,
this small series adds support for the small python-scp package, which
comes on top of the paramiko python package to ease download/upload of
files thanks to SCP protocol.

- Patch 1 brings the new package. It is mostly based on ./utils/scanpypi
  scp -o package
- Patch 2 brings a small test ensuring that python-scp is properly
  installed and is usable

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
Alexis Lothoré (2):
      package/python-scp: new package
      support/testing: add runtime tests for python-scp

 DEVELOPERS                                         |  3 +++
 package/Config.in                                  |  1 +
 package/python-scp/Config.in                       |  7 +++++++
 package/python-scp/python-scp.hash                 |  5 +++++
 package/python-scp/python-scp.mk                   | 14 +++++++++++++
 support/testing/tests/package/sample_python_scp.py | 10 +++++++++
 support/testing/tests/package/test_python_scp.py   | 24 ++++++++++++++++++++++
 7 files changed, 64 insertions(+)
---
base-commit: 0c2a0a44f00e2ab9b41a2bc3bf019e17ef37c471
change-id: 20250924-python-scp-12cf67ae9b0e

Best regards,
-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] package/python-scp: new package
  2025-10-17  7:42 [Buildroot] [PATCH 0/2] package/python-scp: new package Alexis Lothoré via buildroot
@ 2025-10-17  7:42 ` Alexis Lothoré via buildroot
  2025-10-18 14:42   ` Julien Olivain via buildroot
  2025-10-17  7:42 ` [Buildroot] [PATCH 2/2] support/testing: add runtime tests for python-scp Alexis Lothoré via buildroot
  1 sibling, 1 reply; 5+ messages in thread
From: Alexis Lothoré via buildroot @ 2025-10-17  7:42 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard, Alexis Lothoré, Thomas Petazzoni

Add python-scp as a new package. python-scp allows to send and receives
files in python through the scp1 protocol, on top of paramiko.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 DEVELOPERS                         |  3 +++
 package/Config.in                  |  1 +
 package/python-scp/Config.in       |  7 +++++++
 package/python-scp/python-scp.hash |  5 +++++
 package/python-scp/python-scp.mk   | 14 ++++++++++++++
 5 files changed, 30 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 84ca8c76dc52d23a64edc43dab91924e8509d8d5..d0664e8723cd2223f5180ca5ee311dc78b0376bd 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -148,6 +148,9 @@ F:	configs/cubieboard2_defconfig
 N:	Alexey Lukyanchuk <skif@skif-web.ru>
 F:	package/zabbix/
 
+N: 	Alexis Lothoré <alexis.lothore@bootlin.com>
+F: 	package/python-scp
+
 N:	Alistair Francis <alistair@alistair23.me>
 F:	board/sifive/
 F:	boot/opensbi/
diff --git a/package/Config.in b/package/Config.in
index 1ae92409c4bd11bbbbafd0f9f8287e5601603568..3561ec81476a30e924baf0276ec86da5119ea457 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1383,6 +1383,7 @@ menu "External python modules"
 	source "package/python-scapy/Config.in"
 	source "package/python-schedule/Config.in"
 	source "package/python-scipy/Config.in"
+	source "package/python-scp/Config.in"
 	source "package/python-sdbus/Config.in"
 	source "package/python-sdbus-modemmanager/Config.in"
 	source "package/python-sdbus-networkmanager/Config.in"
diff --git a/package/python-scp/Config.in b/package/python-scp/Config.in
new file mode 100644
index 0000000000000000000000000000000000000000..1db0e910f4b2041ac63871a66b07382b6c1c4c87
--- /dev/null
+++ b/package/python-scp/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_SCP
+	bool "python-scp"
+	select BR2_PACKAGE_PYTHON_PARAMIKO # runtime
+	help
+	  scp module for paramiko.
+
+	  https://github.com/jbardin/scp.py
diff --git a/package/python-scp/python-scp.hash b/package/python-scp/python-scp.hash
new file mode 100644
index 0000000000000000000000000000000000000000..4ec4e6a41a4d44331189417e336023ade637c09e
--- /dev/null
+++ b/package/python-scp/python-scp.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/scp/json
+md5  54c0e3b6cc52620ce3a81362fa8bb29d  scp-0.15.0.tar.gz
+sha256  f1b22e9932123ccf17eebf19e0953c6e9148f589f93d91b872941a696305c83f  scp-0.15.0.tar.gz
+# Locally computed sha256 checksums
+sha256  2455cf0fc78e13772bf10ef5f209e7eb8625706d671b2f420cc8add37d548c1c  LICENSE.txt
diff --git a/package/python-scp/python-scp.mk b/package/python-scp/python-scp.mk
new file mode 100644
index 0000000000000000000000000000000000000000..d223b16290760a9c78b5bb58dd4d4af21b49a43a
--- /dev/null
+++ b/package/python-scp/python-scp.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-scp
+#
+################################################################################
+
+PYTHON_SCP_VERSION = 0.15.0
+PYTHON_SCP_SOURCE = scp-$(PYTHON_SCP_VERSION).tar.gz
+PYTHON_SCP_SITE = https://files.pythonhosted.org/packages/d6/1c/d213e1c6651d0bd37636b21b1ba9b895f276e8057f882c9f944931e4f002
+PYTHON_SCP_SETUP_TYPE = setuptools
+PYTHON_SCP_LICENSE = LGPL-2.1+
+PYTHON_SCP_LICENSE_FILES = LICENSE.txt
+
+$(eval $(python-package))

-- 
2.51.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] support/testing: add runtime tests for python-scp
  2025-10-17  7:42 [Buildroot] [PATCH 0/2] package/python-scp: new package Alexis Lothoré via buildroot
  2025-10-17  7:42 ` [Buildroot] [PATCH 1/2] " Alexis Lothoré via buildroot
@ 2025-10-17  7:42 ` Alexis Lothoré via buildroot
  1 sibling, 0 replies; 5+ messages in thread
From: Alexis Lothoré via buildroot @ 2025-10-17  7:42 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard, Alexis Lothoré, Thomas Petazzoni

Add a basic test involving a local SSH connection (based on dropbear
server). The test validates that we are able, through python-scp, to
fetch the /etc/hostname file.

The test needs some basic key initialization to allow connecting to the
dropbear server, hence the custom run_sample_scripts method.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 support/testing/tests/package/sample_python_scp.py | 10 +++++++++
 support/testing/tests/package/test_python_scp.py   | 24 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/support/testing/tests/package/sample_python_scp.py b/support/testing/tests/package/sample_python_scp.py
new file mode 100644
index 0000000000000000000000000000000000000000..fdb4b720a9e6346a650e6d90120c598af9f2988d
--- /dev/null
+++ b/support/testing/tests/package/sample_python_scp.py
@@ -0,0 +1,10 @@
+from paramiko import SSHClient
+from paramiko.client import AutoAddPolicy
+from scp import SCPClient
+
+ssh_client = SSHClient()
+ssh_client.load_system_host_keys()
+ssh_client.set_missing_host_key_policy(AutoAddPolicy)
+ssh_client.connect('127.0.0.1', username='root')
+scp_client = SCPClient(ssh_client.get_transport())
+scp_client.get("/etc/hostname", "/tmp/hostname")
diff --git a/support/testing/tests/package/test_python_scp.py b/support/testing/tests/package/test_python_scp.py
new file mode 100644
index 0000000000000000000000000000000000000000..2cb4f1e67e6e74c643167f4c621e18895d36e6f6
--- /dev/null
+++ b/support/testing/tests/package/test_python_scp.py
@@ -0,0 +1,24 @@
+import os
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonSCP(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_DROPBEAR=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_SCP=y
+        """
+    sample_scripts = ["tests/package/sample_python_scp.py"]
+
+    def run_sample_scripts(self):
+        # Allow passwordless root login in SSH server
+        output, exit_code = self.emulator.run('mkdir /root/.ssh')
+        output, exit_code = self.emulator.run('dropbearkey -t ed25519 -f .ssh/id_dropbear')
+        output, exit_code = self.emulator.run('dropbearkey -y -f .ssh/id_dropbear|grep "^ssh-ed25519" > .ssh/authorized_keys')
+        output, exit_code = self.emulator.run('dropbearconvert dropbear openssh .ssh/id_dropbear .ssh/id_ed25519')
+
+        for script in self.sample_scripts:
+            cmd = self.interpreter + " " + os.path.basename(script)
+            self.assertRunOk(cmd, timeout=self.timeout)

-- 
2.51.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/python-scp: new package
  2025-10-17  7:42 ` [Buildroot] [PATCH 1/2] " Alexis Lothoré via buildroot
@ 2025-10-18 14:42   ` Julien Olivain via buildroot
  2025-10-19  8:40     ` Alexis Lothoré via buildroot
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Olivain via buildroot @ 2025-10-18 14:42 UTC (permalink / raw)
  To: Alexis Lothoré; +Cc: buildroot, James Hilliard, Thomas Petazzoni

On 17/10/2025 09:42, Alexis Lothoré via buildroot wrote:
> Add python-scp as a new package. python-scp allows to send and receives
> files in python through the scp1 protocol, on top of paramiko.
> 
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>

Series applied to master, thanks.

For info, I did few minor changes to the runtime test. See:
https://gitlab.com/buildroot.org/buildroot/-/commit/7470587cfa9a24d3c49adc0fb6cc60512907f31a

Best regards,

Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/python-scp: new package
  2025-10-18 14:42   ` Julien Olivain via buildroot
@ 2025-10-19  8:40     ` Alexis Lothoré via buildroot
  0 siblings, 0 replies; 5+ messages in thread
From: Alexis Lothoré via buildroot @ 2025-10-19  8:40 UTC (permalink / raw)
  To: Julien Olivain, Alexis Lothoré
  Cc: buildroot, James Hilliard, Thomas Petazzoni

Hello Julien,

On Sat Oct 18, 2025 at 4:42 PM CEST, Julien Olivain wrote:
> On 17/10/2025 09:42, Alexis Lothoré via buildroot wrote:
>> Add python-scp as a new package. python-scp allows to send and receives
>> files in python through the scp1 protocol, on top of paramiko.
>> 
>> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
>
> Series applied to master, thanks.
>
> For info, I did few minor changes to the runtime test. See:
> https://gitlab.com/buildroot.org/buildroot/-/commit/7470587cfa9a24d3c49adc0fb6cc60512907f31a

ACK, thanks for the improvements !

Alexis

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-19  8:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17  7:42 [Buildroot] [PATCH 0/2] package/python-scp: new package Alexis Lothoré via buildroot
2025-10-17  7:42 ` [Buildroot] [PATCH 1/2] " Alexis Lothoré via buildroot
2025-10-18 14:42   ` Julien Olivain via buildroot
2025-10-19  8:40     ` Alexis Lothoré via buildroot
2025-10-17  7:42 ` [Buildroot] [PATCH 2/2] support/testing: add runtime tests for python-scp Alexis Lothoré via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox