test_perftest.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import os
  2. import infra.basetest
  3. class TestPerftest(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="5.15.91"
  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_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
  16. BR2_TARGET_ROOTFS_CPIO=y
  17. BR2_TARGET_ROOTFS_CPIO_GZIP=y
  18. # BR2_TARGET_ROOTFS_TAR is not set
  19. BR2_PACKAGE_IPROUTE2=y
  20. BR2_PACKAGE_LIBMNL=y
  21. BR2_PACKAGE_RDMA_CORE=y
  22. BR2_PACKAGE_PERFTEST=y
  23. """.format(
  24. infra.filepath("tests/package/test_rdma_core/linux-rdma.fragment")
  25. )
  26. def test_run(self):
  27. img = os.path.join(self.builddir, "images", "rootfs.cpio.gz")
  28. kern = os.path.join(self.builddir, "images", "Image")
  29. self.emulator.boot(arch="aarch64",
  30. kernel=kern,
  31. kernel_cmdline=["console=ttyAMA0"],
  32. options=["-M", "virt", "-cpu", "cortex-a57", "-m", "512M", "-initrd", img])
  33. self.emulator.login()
  34. # Add the rxe0 interface
  35. self.assertRunOk("ip link set dev eth0 up")
  36. self.assertRunOk("rdma link add rxe0 type rxe netdev eth0")
  37. # start a server
  38. self.assertRunOk("ib_read_bw > /dev/null 2>&1 &")
  39. # start a client
  40. self.assertRunOk("sleep 1 && ib_read_bw 127.0.0.1")