From 8337e700ac11952bc95e4cd760b5f1d26182ad26 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Sat, 18 Jan 2025 21:06:59 +0100 Subject: [PATCH] support/testing: add lighttpd runtime test Signed-off-by: Julien Olivain (cherry picked from commit f438ae3422b0b860ef96cb213c71fe7508777b25) Signed-off-by: Thomas Perale --- DEVELOPERS | 1 + .../testing/tests/package/test_lighttpd.py | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 support/testing/tests/package/test_lighttpd.py diff --git a/DEVELOPERS b/DEVELOPERS index 3d4674eebe..6f49308ab7 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1934,6 +1934,7 @@ F: support/testing/tests/package/test_libcamera/ F: support/testing/tests/package/test_libcurl.py F: support/testing/tests/package/test_libgpgme.py F: support/testing/tests/package/test_libjxl.py +F: support/testing/tests/package/test_lighttpd.py F: support/testing/tests/package/test_links.py F: support/testing/tests/package/test_links/ F: support/testing/tests/package/test_lrzip.py diff --git a/support/testing/tests/package/test_lighttpd.py b/support/testing/tests/package/test_lighttpd.py new file mode 100644 index 0000000000..54dd68bcda --- /dev/null +++ b/support/testing/tests/package/test_lighttpd.py @@ -0,0 +1,26 @@ +import os + +import infra.basetest + + +class TestLighttpd(infra.basetest.BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_LIGHTTPD=y + BR2_TARGET_ROOTFS_CPIO=y + # BR2_TARGET_ROOTFS_TAR is not set + """ + + def test_run(self): + cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") + self.emulator.boot(arch="armv5", + kernel="builtin", + options=["-initrd", cpio_file]) + self.emulator.login() + + msg = "Hello Buildroot!" + + self.assertRunOk("lighttpd -v") + self.assertRunOk(f"echo '{msg}' > /var/www/index.html") + self.assertRunOk("wget http://localhost/index.html") + self.assertRunOk(f"grep -F '{msg}' index.html")