package/python-scp: new package
cover package/python-scp: new package
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
---
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,
Signature · 8 lines
Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/2 package/python-scp: new package
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.
--- 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(+)
DEVELOPERS +3 -0
@@ -148,6 +148,9 @@ F: configs/cubieboard2_defconfig N: Alexey Lukyanchuk <[email protected]> F: package/zabbix/ +N: Alexis Lothoré <[email protected]> +F: package/python-scp + N: Alistair Francis <[email protected]> F: board/sifive/ F: boot/opensbi/
package/Config.in +1 -0
@@ -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"
package/python-scp/Config.in new file +7 -0
@@ -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
package/python-scp/python-scp.hash new file +5 -0
@@ -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
package/python-scp/python-scp.mk new file +14 -0
@@ -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))
Signature · 6 lines
2.51.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 4 lines · Alexis Lothoré via buildroot
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é <[email protected]>
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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Julien,
Quoted 10 lines · Julien Olivain
Quoted 4 lines · Alexis Lothoré via buildroot
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é <[email protected]>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
Signature · 8 lines
Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 2/2 support/testing: add runtime tests for python-scp
In reply to Alexis Lothoré via buildrootAdd 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.
--- support/testing/tests/package/sample_python_scp.py | 10 +++++++++ support/testing/tests/package/test_python_scp.py | 24 ++++++++++++++++++++++ 2 files changed, 34 insertions(+)
support/testing/tests/package/sample_python_scp.py new file +10 -0
@@ -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")
support/testing/tests/package/test_python_scp.py new file +24 -0
@@ -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)
Signature · 6 lines
2.51.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot