Ejemplo n.º 1
0
    def _list_testers(self):
        env = globals().copy()
        self._exec_apps(env)

        testers = [i() for i in utils.get_subclasses(TestsManager, env)]
        for tester in testers:
            if tester.init() is True:
                self.testers.append(tester)
            else:
                self.warning("Can not init tester: %s -- PATH is %s"
                             % (tester.name, os.environ["PATH"]))
Ejemplo n.º 2
0
    def __init__(self):
        modules = list(
            map(
                lambda f: ".".join([self.discovery_path, f[:f.find(".py")]]),
                filter(lambda f: not f.startswith("__"),
                       os.listdir(self.discovery_path))))
        for module in modules:
            importlib.import_module(module)

        base_subclasses = get_subclasses(self.base_class)
        for subclass in base_subclasses:
            # Store the type. Lazily instantiate it when needed
            self.registry[subclass.name] = subclass
Ejemplo n.º 3
0
    def _list_testers(self):
        env = globals().copy()
        d = os.path.dirname(__file__)
        for f in os.listdir(os.path.join(d, "apps")):
            if f.endswith(".py"):
                execfile(os.path.join(d, "apps", f), env)

        testers = [i() for i in utils.get_subclasses(TestsManager, env)]
        for tester in testers:
            if tester.init() is True:
                self.testers.append(tester)
            else:
                self.warning("Can not init tester: %s -- PATH is %s"
                             % (tester.name, os.environ["PATH"]))
Ejemplo n.º 4
0
def dts_run_suite(duts, tester, test_suites, target):
    """
    Run each suite in test suite list.
    """
    for suite_name in test_suites:
        try:
            result.test_suite = suite_name
            suite_module = __import__('TestSuite_' + suite_name)
            for test_classname, test_class in get_subclasses(
                    suite_module, TestCase):

                suite_obj = test_class(duts, tester, target, suite_name)
                suite_obj.init_log()
                suite_obj.set_requested_cases(requested_tests)
                suite_obj.set_check_inst(check=check_case_inst,
                                         support=support_case_inst)
                result.nic = suite_obj.nic

                dts_log_testsuite(duts, tester, suite_obj, log_handler,
                                  test_classname)

                log_handler.info("\nTEST SUITE : " + test_classname)
                log_handler.info("NIC :        " + result.nic)

                if suite_obj.execute_setup_all():
                    suite_obj.execute_test_cases()
                    suite_obj.execute_tear_downall()

                # save suite cases result
                result.copy_suite(suite_obj.get_result())
                save_all_results()

                log_handler.info("\nTEST SUITE ENDED: " + test_classname)
                dts_log_execution(duts, tester, log_handler)
        except VerifyFailure:
            settings.report_error("SUITE_EXECUTE_ERR")
            log_handler.error(" !!! DEBUG IT: " + traceback.format_exc())
        except KeyboardInterrupt:
            # stop/save result/skip execution
            log_handler.error(" !!! STOPPING DTS")
            suite_obj.execute_tear_downall()
            save_all_results()
            break
        except Exception as e:
            settings.report_error("GENERIC_ERR")
            log_handler.error(str(e))
        finally:
            suite_obj.execute_tear_downall()
            save_all_results()
Ejemplo n.º 5
0
def get_project_obj(project_name, super_class, crbInst, serializer, dut_id):
    """
    Load project module and return crb instance.
    """
    project_obj = None
    PROJECT_MODULE_PREFIX = 'project_'
    try:
        project_module = __import__(PROJECT_MODULE_PREFIX + project_name)

        for project_subclassname, project_subclass in get_subclasses(
                project_module, super_class):
            project_obj = project_subclass(crbInst, serializer, dut_id)
        if project_obj is None:
            project_obj = super_class(crbInst, serializer, dut_id)
    except Exception as e:
        log_handler.info("LOAD PROJECT MODULE INFO: " + str(e))
        project_obj = super_class(crbInst, serializer, dut_id)

    return project_obj
Ejemplo n.º 6
0
def rerun_command():
    """
    Rerun test case specified in command line
    """
    global AliveSuite, AliveModule, AliveCase
    new_module = imp.reload(AliveModule)

    # save arguments required to initialize suite
    duts = AliveSuite.__dict__['duts']
    tester = AliveSuite.__dict__['tester']
    target = AliveSuite.__dict__['target']
    suite = AliveSuite.__dict__['suite_name']

    for test_classname, test_class in get_subclasses(new_module, TestCase):
        suite_obj = test_class(duts, tester, target, suite)

        # copy all element from previous suite to reloaded suite
        copy_instance_attr(AliveSuite, suite_obj)
        # re-run specified test case
        for case in suite_obj._get_test_cases(r'%s' % AliveCase):
            if callable(case):
                case()
Ejemplo n.º 7
0
You can generate such a file doing:

.   $gst-validate-media-check-1.0 http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 --output-file /somewhere/in/you/media/path/bipbop.stream_info

Once this is done, gst-validate-launcher will run the scenarios on those media files the
same way as if they were local files.


4. Debug gst-validate-launcher execution
----------------------------------------

You can activate debug logs setting the environment variable GST_VALIDATE_LAUNCHER_DEBUG.
It uses the same syntax as PITIVI_DEBUG (more information at:
http://wiki.pitivi.org/wiki/Bug_reporting#Debug_logs).
''' % ("\n  * ".join([reporter.name for reporter in
                      utils.get_subclasses(reporters.Reporter, reporters.__dict__)]
                     ),
       DEFAULT_MAIN_DIR,
       "\n  * ".join([getattr(Protocols, att) for att in
                      dir(Protocols) if isinstance(getattr(Protocols, att), str) and not
                      att.startswith("_")]))

QA_ASSETS = "gst-integration-testsuites"
MEDIAS_FOLDER = "medias"
DEFAULT_GST_QA_ASSETS_REPO = "git://anongit.freedesktop.org/gstreamer/gst-integration-testsuites"
OLD_DEFAULT_GST_QA_ASSETS_REPO = "https://gitlab.com/thiblahute/gst-integration-testsuites.git"
DEFAULT_TESTSUITES_DIR = os.path.join(DEFAULT_MAIN_DIR, QA_ASSETS, "testsuites")


def download_assets(options):
    try:
Ejemplo n.º 8
0
You can generate such a file doing:

.   $gst-validate-media-check-1.0 http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 --output-file /somewhere/in/you/media/path/bipbop.stream_info

Once this is done, gst-validate-launcher will run the scenarios on those media files the
same way as if they were local files.


4. Debug gst-validate-launcher execution
----------------------------------------

You can activate debug logs setting the environment variable GST_VALIDATE_LAUNCHER_DEBUG.
It uses the same syntax as PITIVI_DEBUG (more information at:
http://wiki.pitivi.org/wiki/Bug_reporting#Debug_logs).
''' % ("\n  * ".join([reporter.name for reporter in
                      utils.get_subclasses(reporters.Reporter, reporters.__dict__)]
                     ),
       DEFAULT_MAIN_DIR,
       "\n  * ".join([getattr(Protocols, att) for att in
                      dir(Protocols) if isinstance(getattr(Protocols, att), str)
                      and not att.startswith("_")]))

QA_ASSETS = "gst-integration-testsuites"
MEDIAS_FOLDER = "medias"
DEFAULT_GST_QA_ASSETS_REPO = "git://anongit.freedesktop.org/gstreamer/gst-integration-testsuites"
OLD_DEFAULT_GST_QA_ASSETS_REPO = "https://gitlab.com/thiblahute/gst-integration-testsuites.git"
DEFAULT_SYNC_ASSET_COMMAND = "git fetch origin && git checkout origin/master && git annex get medias/defaults/"
DEFAULT_SYNC_ALL_ASSET_COMMAND = "git fetch origin && git checkout origin/master && git annex get ."
DEFAULT_TESTSUITES_DIR = os.path.join(DEFAULT_MAIN_DIR, QA_ASSETS, "testsuites")

Ejemplo n.º 9
0
You can generate such a file doing:

.   $gst-validate-media-check-1.0 http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 --output-file /somewhere/in/you/media/path/bipbop.stream_info

Once this is done, gst-validate-launcher will run the scenarios on those media files the
same way as if they were local files.


4. Debug gst-validate-launcher execution
----------------------------------------

You can activate debug logs setting the environment variable GST_VALIDATE_LAUNCHER_DEBUG.
It uses the same syntax as PITIVI_DEBUG (more information at:
http://wiki.pitivi.org/wiki/Bug_reporting#Debug_logs).
''' % ("\n  * ".join([
    reporter.name for reporter in utils.get_subclasses(reporters.Reporter,
                                                       reporters.__dict__)
]), DEFAULT_MAIN_DIR, "\n  * ".join([
    getattr(Protocols, att) for att in dir(Protocols)
    if isinstance(getattr(Protocols, att), str) and not att.startswith("_")
]))

QA_ASSETS = "gst-integration-testsuites"
MEDIAS_FOLDER = "medias"
DEFAULT_GST_QA_ASSETS_REPO = "git://anongit.freedesktop.org/gstreamer/gst-integration-testsuites"
OLD_DEFAULT_GST_QA_ASSETS_REPO = "https://gitlab.com/thiblahute/gst-integration-testsuites.git"
DEFAULT_TESTSUITES_DIR = os.path.join(DEFAULT_MAIN_DIR, QA_ASSETS,
                                      "testsuites")


def download_assets(options):
    try: