test_go.py 681 B

123456789101112131415161718192021222324252627
  1. import os
  2. import infra.basetest
  3. class TestGoBase(infra.basetest.BRTest):
  4. def login(self):
  5. cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
  6. self.emulator.boot(arch="armv5",
  7. kernel="builtin",
  8. options=["-initrd", cpio_file])
  9. self.emulator.login()
  10. class TestGoSource(TestGoBase):
  11. config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
  12. """
  13. BR2_TARGET_ROOTFS_CPIO=y
  14. BR2_PACKAGE_HOST_GO=y
  15. BR2_PACKAGE_HOST_GO_SRC=y
  16. BR2_PACKAGE_FLANNEL=y
  17. """
  18. def test_run(self):
  19. self.login()
  20. self.assertRunOk("/opt/bin/flanneld -h")