test_nu.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. import os
  2. import infra.basetest
  3. class TestNu(infra.basetest.BRTest):
  4. # infra.basetest.BASIC_TOOLCHAIN_CONFIG cannot be used as it doesn't
  5. # support a host rustc which is necessary for nushell
  6. config = \
  7. """
  8. BR2_arm=y
  9. BR2_cortex_a9=y
  10. BR2_ARM_ENABLE_NEON=y
  11. BR2_ARM_ENABLE_VFP=y
  12. BR2_TOOLCHAIN_EXTERNAL=y
  13. BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
  14. BR2_SYSTEM_DHCP="eth0"
  15. BR2_PACKAGE_NUSHELL=y
  16. BR2_TARGET_ROOTFS_CPIO=y
  17. BR2_ROOTFS_POST_BUILD_SCRIPT="{}"
  18. BR2_ROOTFS_POST_SCRIPT_ARGS="{}"
  19. """.format(infra.filepath("tests/package/copy-sample-script-to-target.sh"),
  20. infra.filepath("tests/package/sample_nu.nu"))
  21. def test_run(self):
  22. img = os.path.join(self.builddir, "images", "rootfs.cpio")
  23. self.emulator.boot(arch="armv7",
  24. kernel="builtin",
  25. options=["-initrd", img])
  26. self.emulator.login()
  27. cmd = "nu sample_nu.nu"
  28. self.assertRunOk(cmd)