package/python-tftpy: add host variant

A host variant of python-tftpy will be needed for Snagboot, so enable
it, and add a very simple test for the host package. We considered
adding a test that actually starts a TFTP server with tftpy and then
downloads from that server with the client-side of tftpy, but
allocating an available UDP port reliably is tricky, so we kept the
test case very simple for now.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Colin Foster <colin.foster@in-advantage.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Thomas Petazzoni
2025-10-18 21:43:03 +02:00
committed by Julien Olivain
parent 875b4f204c
commit b2a657297d
2 changed files with 10 additions and 0 deletions

View File

@@ -11,3 +11,4 @@ PYTHON_TFTPY_LICENSE_FILES = LICENSE
PYTHON_TFTPY_SETUP_TYPE = setuptools
$(eval $(python-package))
$(eval $(host-python-package))

View File

@@ -1,4 +1,5 @@
from tests.package.test_python import TestPythonPackageBase
import infra.basetest
class TestPythonTftpy(TestPythonPackageBase):
@@ -9,3 +10,11 @@ class TestPythonTftpy(TestPythonPackageBase):
BR2_PACKAGE_PYTHON_TFTPY=y
"""
sample_scripts = ["tests/package/sample_python_tftpy.py"]
class TestHostPythonTftpy(infra.basetest.BRHostPkgTest):
hostpkgs = ["host-python-tftpy"]
def test_run(self):
cmd = ["host/bin/python3", "-c", "import tftpy"]
infra.run_cmd_on_host(self.builddir, cmd)