2
1

test_execline.py 705 B

1234567891011121314151617181920212223
  1. import os
  2. import infra.basetest
  3. class TestExecline(infra.basetest.BRTest):
  4. config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
  5. """
  6. BR2_PACKAGE_EXECLINE=y
  7. BR2_TARGET_ROOTFS_CPIO=y
  8. # BR2_TARGET_ROOTFS_TAR is not set
  9. """
  10. def test_run(self):
  11. img = os.path.join(self.builddir, "images", "rootfs.cpio")
  12. self.emulator.boot(arch="armv5",
  13. kernel="builtin",
  14. options=["-initrd", img])
  15. self.emulator.login()
  16. output, exit_code = self.emulator.run("execlineb -c 'echo hello world'")
  17. self.assertEqual(exit_code, 0)
  18. self.assertEqual(output[0].strip(), "hello world")