mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-25 19:40:35 -09:00
support/testing: add atftp test
Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
e912b3bcfa
commit
6b625b42aa
@@ -551,6 +551,7 @@ F: package/python-pysensors/
|
||||
F: package/qoriq-fm-ucode/
|
||||
F: package/unifdef/
|
||||
F: package/vmtouch/
|
||||
F: support/testing/tests/package/test_atftp.py
|
||||
F: support/testing/tests/package/test_zip.py
|
||||
|
||||
N: Brock Williams <brock@cottonwoodcomputer.com>
|
||||
|
||||
28
support/testing/tests/package/test_atftp.py
Normal file
28
support/testing/tests/package/test_atftp.py
Normal file
@@ -0,0 +1,28 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user