import pytest import re import subprocess import sys import traceback try: import aws_fpga_utils import aws_fpga_test_utils from aws_fpga_test_utils.AwsFpgaTestBase import AwsFpgaTestBase except ImportError as e: traceback.print_tb(sys.exc_info()[2]) print("error: {}\nMake sure to source hdk_setup.sh".format( sys.exc_info()[1])) sys.exit(1) logger = aws_fpga_utils.get_logger(__name__) class TestGenDcp(AwsFpgaTestBase): ''' Pytest test class. NOTE: Cannot have an __init__ method. Test all example CLs with different strategies and clock recipes. ''' ADD_XILINX_VERSION = True @classmethod def setup_class(cls):
''' from __future__ import print_function import os from os.path import dirname, realpath, basename import json try: import aws_fpga_utils import aws_fpga_test_utils from aws_fpga_test_utils.AwsFpgaTestBase import AwsFpgaTestBase except ImportError as e: traceback.print_tb(sys.exc_info()[2]) print("error: {}\nMake sure to source shared/bin/setup_test_env.sh".format(sys.exc_info()[1])) sys.exit(1) logger = aws_fpga_utils.get_logger(__name__) class TestBuildSDAccelExample(AwsFpgaTestBase): ''' Pytest test class. NOTE: Cannot have an __init__ method. ''' ADD_EXAMPLEPATH = True ADD_RTENAME = True ADD_XILINX_VERSION = True @classmethod def setup_class(cls): '''
import sys import traceback try: # For Python 3.0 and later from urllib.request import urlopen except ImportError: # Fall back to Python 2's urllib2 from urllib2 import urlopen try: import aws_fpga_utils except ImportError as e: traceback.print_tb(sys.exc_info()[2]) print("error: {}\nMake sure to source hdk_setup.sh".format(sys.exc_info()[1])) sys.exit(1) logger = aws_fpga_utils.get_logger(__file__) def get_git_repo_root(path=None): if not path: path = os.getcwd() repo = git.Repo(path, search_parent_directories=True) repo_dir = repo.git.rev_parse("--show-toplevel") return repo_dir def edma_driver_installed(): if find_files_in_path('/lib/modules', 'edma-drv.ko'): return True if os.path.exists('/etc/modules-load.d/edma.conf'): return True if os.system('/usr/sbin/lsmod | grep edma_drv') == 0: return True
from __future__ import print_function import argparse import boto3 import datetime from datetime import datetime, timedelta import logging import json import os import re import sys import time import traceback try: import aws_fpga_utils logger = aws_fpga_utils.get_logger(__file__) except ImportError as e: traceback.print_tb(sys.exc_info()[2]) print("warning: {}\nMake sure to source hdk_setup.sh".format(sys.exc_info()[1])) logging.basicConfig(stream=sys.stderr, level=logging.INFO) logger = logging.getLogger('aws-fpga') aws_fpga_utils = None SLEEP_SECONDS = 60 DEFAULT_MAX_DURATION_HOURS = 6 description = ''' Waits for AFI generation to complete. Optionally notifies an email address subscribed to an SNS topic. If --notify is used then --email is required.