test_glslsandbox_player.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import os
  2. import infra.basetest
  3. class TestGlslsandboxPlayer(infra.basetest.BRTest):
  4. config = \
  5. """
  6. BR2_aarch64=y
  7. BR2_TOOLCHAIN_EXTERNAL=y
  8. BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
  9. BR2_LINUX_KERNEL=y
  10. BR2_LINUX_KERNEL_CUSTOM_VERSION=y
  11. BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.32"
  12. BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
  13. BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
  14. BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}"
  15. BR2_PACKAGE_LIBDRM=y
  16. BR2_PACKAGE_MESA3D=y
  17. BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
  18. BR2_PACKAGE_MESA3D_LLVM=y
  19. BR2_PACKAGE_MESA3D_OPENGL_EGL=y
  20. BR2_PACKAGE_MESA3D_OPENGL_ES=y
  21. BR2_PACKAGE_GLSLSANDBOX_PLAYER=y
  22. BR2_PACKAGE_GLSLSANDBOX_PLAYER_KMS=y
  23. BR2_TARGET_ROOTFS_CPIO=y
  24. BR2_TARGET_ROOTFS_CPIO_GZIP=y
  25. # BR2_TARGET_ROOTFS_TAR is not set
  26. """.format(
  27. infra.filepath("tests/package/test_glslsandbox_player/linux-vkms.fragment"))
  28. def test_run(self):
  29. img = os.path.join(self.builddir, "images", "rootfs.cpio.gz")
  30. kern = os.path.join(self.builddir, "images", "Image")
  31. self.emulator.boot(arch="aarch64",
  32. kernel=kern,
  33. kernel_cmdline=["console=ttyAMA0"],
  34. options=["-M", "virt", "-cpu", "cortex-a57", "-m", "256M", "-initrd", img])
  35. self.emulator.login()
  36. # We force a small resolution in order to keep a relatively
  37. # fast software rendering
  38. cmd = "GSP_DRM_MODE=640x480 "
  39. # We run 3 frames of a reduced resolution of SimpleMandel
  40. cmd += "glslsandbox-player -S SimpleMandel -w0 -f3 -R8 -N -vv -r1 -D"
  41. self.assertRunOk(cmd, timeout=30)
  42. # Since we render 3 frames and request a dump of the last one,
  43. # a ppm image file is expected to be present
  44. self.assertRunOk("test -s SimpleMandel-00002.ppm")