test_go.py 1013 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 TestGoBin(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_BIN=y
  16. BR2_PACKAGE_FLANNEL=y
  17. """
  18. def test_run(self):
  19. self.login()
  20. self.assertRunOk("/opt/bin/flanneld -h")
  21. class TestGoSource(TestGoBase):
  22. config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
  23. """
  24. BR2_TARGET_ROOTFS_CPIO=y
  25. BR2_PACKAGE_HOST_GO=y
  26. BR2_PACKAGE_HOST_GO_SRC=y
  27. BR2_PACKAGE_FLANNEL=y
  28. """
  29. def test_run(self):
  30. self.login()
  31. self.assertRunOk("/opt/bin/flanneld -h")