예제 #1
0
    def base_test(self, cl, agfi, afi, install_edma_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."

        if install_edma_driver:
            # Uninstall drivers just in case a previous test left them installed
            aws_fpga_test_utils.remove_edma_driver()
            aws_fpga_test_utils.remove_xdma_driver()

            # Load the AFI onto all available FPGAs
            # This is required for the EDMA driver to correctly installfor 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 before installing EDMA driver")
            for slot in range(self.num_slots):
                self.load_agfi(cl, agfi, afi, slot)

            aws_fpga_test_utils.install_edma_driver()
            # Make sure that driver was installed on all slots
            for slot in range(self.num_slots):
                device_name = "/dev/edma{}_queue_0".format(slot)
                assert os.path.exists(
                    device_name
                ), "EDMA driver not installed on slot {}".format(slot)
        else:
            # Load the AFI onto all the slots to be tested
            for slot in slots_to_test:
                self.load_agfi(cl, agfi, afi, slot)

        for slot in slots_to_test:
            logger.info("Running runtime software on slot {}".format(slot))
            self.check_runtime_software(cl, slot)

        if install_edma_driver:
            logger.info("Removing EDMA driver")
            aws_fpga_test_utils.remove_edma_driver()

            for slot in range(self.num_slots):
                self.fpga_clear_local_image(slot)
        else:
            for slot in slots_to_test:
                self.fpga_clear_local_image(slot)
예제 #2
0
 def teardown_method(self, test_method):
     aws_fpga_test_utils.remove_edma_driver()
예제 #3
0
 def setup_method(self, test_method):
     aws_fpga_test_utils.remove_edma_driver()
     aws_fpga_test_utils.remove_xdma_driver()