def base_test(self, cl, agfi, afi, install_xdma_driver, slots_to_test, option_tag): if len(slots_to_test): # Make sure that the requested slots are valid for this instance type for slot in slots_to_test: assert slot >= 0 and slot < self.num_slots else: slots_to_test = range(self.num_slots) # Make sure that the test can be built first logger.info("Building runtime software") (rc, stdout_lines, stderr_lines) = self.run_cmd( "cd {}/hdk/cl/examples/{}/software/runtime && make -f Makefile SDK_DIR={}/sdk" .format(self.WORKSPACE, cl, self.WORKSPACE)) assert rc == 0, "Runtime software build failed." # Load the AFI onto all available FPGAs # This is required for the XDMA driver to correctly install for all slots # We do this because otherwise installation on slots 1-7 doesn't seem to work. logger.info("Loading the AFI into all slots") for slot in slots_to_test: self.load_agfi(cl, agfi, afi, slot) if install_xdma_driver: aws_fpga_test_utils.install_xdma_driver() for slot in slots_to_test: logger.info("Running runtime software on slot {}".format(slot)) self.check_runtime_software(cl, slot) for slot in slots_to_test: self.fpga_clear_local_image(slot)
def test_fio_dma_verify(self, driver_mode): aws_fpga_test_utils.install_xdma_driver(mode=driver_mode) assert aws_fpga_test_utils.xdma_driver_installed() == True (rc, stdout_lines, stderr_lines) = self.run_cmd("sudo {} {}".format( self.get_fio_tool_run_script(), self.get_fio_verify_script()), echo=True, check=False) if rc != 0: logger.error("FIO xdma verify test failed") # Create some diagnostic information # Debug is problematic for intermittent problems because the instance is terminated when the tests finish. self.run_cmd("sudo fpga-describe-local-image-slots", check=False, echo=True) for slot in range(self.num_slots): self.run_cmd( "sudo fpga-describe-local-image -S {} -M".format(slot), check=False, echo=True) assert rc == 0
def test_install(self): aws_fpga_test_utils.install_xdma_driver() assert aws_fpga_test_utils.xdma_driver_installed() == True
def test_install(self, driver_mode): aws_fpga_test_utils.install_xdma_driver(mode=driver_mode) assert aws_fpga_test_utils.xdma_driver_installed() == True