test_lighttpd.py 793 B

1234567891011121314151617181920212223242526
  1. import os
  2. import infra.basetest
  3. class TestLighttpd(infra.basetest.BRTest):
  4. config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
  5. """
  6. BR2_PACKAGE_LIGHTTPD=y
  7. BR2_TARGET_ROOTFS_CPIO=y
  8. # BR2_TARGET_ROOTFS_TAR is not set
  9. """
  10. def test_run(self):
  11. cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
  12. self.emulator.boot(arch="armv5",
  13. kernel="builtin",
  14. options=["-initrd", cpio_file])
  15. self.emulator.login()
  16. msg = "Hello Buildroot!"
  17. self.assertRunOk("lighttpd -v")
  18. self.assertRunOk(f"echo '{msg}' > /var/www/index.html")
  19. self.assertRunOk("wget http://localhost/index.html")
  20. self.assertRunOk(f"grep -F '{msg}' index.html")