Files
rpi-buildroot/support/testing/tests/package/test_atftp.py
Brandon Maier 6b625b42aa support/testing: add atftp test
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-09 22:15:24 +02:00

29 lines
926 B
Python

import os
import infra.basetest
class TestAtftp(infra.basetest.BRTest):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
"""
BR2_PACKAGE_ATFTP=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_ROOTFS_CPIO=y
"""
def test_run(self):
cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
self.emulator.boot(arch="armv7",
kernel="builtin",
options=["-initrd", cpio_file])
self.emulator.login()
self.assertRunOk("mkdir -p /tftpboot")
self.assertRunOk("echo 'Hello World' >/tftpboot/test_atftp.txt")
# atftpd is launched by /etc/init.d/S80atftpd
self.assertRunOk("atftp -g -r test_atftp.txt -l /tmp/test_atftp.txt localhost")
output, exit_code = self.emulator.run("cat /tmp/test_atftp.txt")
self.assertEqual("".join(output), "Hello World")