Пример #1
0
def main():
    # testName = "Configure Dev Enclosure"
    testpath = r'quick_test.robot'
    # testPath = r'C:\rg-fusion\fusion\tests\wpst_crm\developer\rbriggs\configure_dev_enclosure\demo.txt'
    # testPath = r'C:\rg-fusion\fusion\tests\wpst_crm\feature_tests\biggs\biggs.txt'

    suite = TestSuiteBuilder().build(testpath)

    suite.filter(included_tags='hpip')
    # result = suite.filter(included_tags='one')
    # result = suite.filter(included_tags='ENCLOSURE GROUPS')
    # result = suite.filter(included_tags=['LIGS', 'ENCLOSURE GROUPS'])

    result = suite.run(variable=['APPLIANCE_IP:10.178.14.1'],
                       critical='smoke',
                       output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    ResultWriter(result).write_results(report='report.html', log='log.html')
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
Пример #2
0
 def write(self):
     self._create_suite_xmls()
     self._combine_suite_xmls()
     writer = ResultWriter(path.join(self.config['outputdir'], 'output.xml'))
     writer.write_results(
         suitestatlevel=self.config['suite_stat_level'],
         outputdir=self.config['outputdir'],
     )
Пример #3
0
 def write(self):
     self._gather_device_xmls()
     self._combine_all_devices()
     writer = ResultWriter(path.join(self.config['outputdir'], 'devices.xml'))
     writer.write_results(
         suitestatlevel=self.config['suite_stat_level'],
         outputdir=self.config['outputdir'],
         log='devices.html',
         report=None
     )
Пример #4
0
def run():
    """ Run generated test case.
    Write generated test case to robot file """

    with open("robotfile.robot", "w") as testsuite:
        testsuite.write("\n".join(robotfile))
        testsuite.write("\n")
    result = suite.run(output="robot_aal.xml")
    writer = ResultWriter(result)
    writer.write_results(report="aal_robot.html", log=None)
    return result.return_code
def main():
    testName = "FCoE Feature Test"
    testPath = r'C:\rg-fusion\fusion\tests\wpst_crm\feature_tests\fcoe\feature_test_fcoe.txt'

    suite = TestSuiteBuilder().build(testPath)
    result = suite.run(critical='smoke', output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    ResultWriter(result).write_results(report='report.html', log=None)
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
Пример #6
0
def main():
    # testName = "Configure Dev Enclosure"
    testPath = r'C:\rg-fusion\fusion\tests\wpst_crm\developer\rbriggs\configure_dev_enclosure\teardown_dev_enclosure.txt'

    suite = TestSuiteBuilder().build(testPath)
    result = suite.run(critical='smoke', output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    ResultWriter(result).write_results(report='report.html', log=None)
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
Пример #7
0
def main():
    testName = "Mantra Tests"
    testPath = r'C:\robogalaxy\fusion\tests\mantra\ui\Sample.txt'

    suite = TestSuiteBuilder().build(testPath)
    result = suite.run(critical='smoke', output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    ResultWriter(result).write_results(report='repot.html', log=None)
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
def main():
    testName = "Bobby's Test"
    testPath = r'C:\Users\Administrator\git\robogalaxy\tests\demo\wpst_crm\logical_interconnect_groups.txt'

    suite = TestSuiteBuilder().build(testPath)
    result = suite.run(critical='smoke', output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    ResultWriter(result).write_results(report='repot.html', log=None)
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
Пример #9
0
def main():
    # testName = "F117 - Tbird FC DirectAttach Feature Test"
    testName = "F118 - Tbird FC FabricAttach Feature Test"
    # testPath = r'F117_teardown.robot'
    testPath = r'F118_feature_tests.robot'
    # testPath = r'F117_feature_tests.robot'
    # testPath = r'F117_feature_max_us_tests.robot'
    # dataPath = r'C:\rg-fusion\fusion\tests\wpst_crm\feature_tests\TBIRD\FC_POTASH'

    suite = TestSuiteBuilder().build(testPath)

    # result = suite.filter(excluded_tags=['speedChange'])
    # result = suite.filter(included_tags=['Login', 'InsertAsidePotash'])
    # result = suite.filter(included_tags=['setup', 'Happy'])
    # result = suite.filter(included_tags=['Login', 'InsertBsidePotash'])
    # result = suite.filter(included_tags=['Login', 'ServerEnd2End'])
    # result = suite.filter(included_tags=['Login', 'LIUFGRemovePortAfterPowerOnB'])
    # result = suite.filter(included_tags=['Login', 'DisEnaBUplink'])
    # result = suite.filter(included_tags=['Login', 'ExceedMaxLiUSB', 'portStatusReason'])
    # result = suite.filter(included_tags=['Login', 'LiUSNegative'])

    IP = '15.245.131.132'
    VM = None
    result = suite.run(
        variable=['APPLIANCE_IP:%s' % IP, 'VM:%s' % VM],
        # variablefile='data_F117_AZ51_ab.py',
        # variablefile='data_F117_AZ51_ha.py',
        # variablefile='data_F118_AZ51_ha.py',
        variablefile='data_F118_AZ51_ab.py',
        critical='smoke',
        output='output.xml',
        exitonerror=True,
        exitonfailure=True,
        skipteardownonexit=True)
    ResultWriter('output.xml').write_results()
Пример #10
0
def robot_run(username, name, project, output):
    if not exists_path(output):
        mk_dirs(output)

    suite = TestSuiteBuilder().build(project)

    (out, index) = reset_next_build_numb(output)

    result = suite.run(output_directory=out,
                       output=out + "/output.xml",
                       debugfile=out + "/debug.txt",
                       loglevel="TRACE")

    # reset_last_status(result, output, index)

    # Report and xUnit files can be generated based on the result object.
    # ResultWriter(result).write_results(report=out + '/report.html', log=out + '/log.html')
    detail_result = ExecutionResult(out + "/output.xml")

    # detail_result.save(out + "/output_new.xml")
    reset_last_status(detail_result, output, index)

    # Report and xUnit files can be generated based on the result object.
    ResultWriter(detail_result).write_results(report=out + '/report.html',
                                              log=out + '/log.html')

    send_robot_report(username, name, index, detail_result, out)
Пример #11
0
def main():
    testName = ""
    testPath = r'C:\rg-fusion\fusion\tests\wpst_crm\feature_tests\c7000\F749-F751\feature_test_F749-F751.txt'
    #dataPath = r'C:\rg-fusion\fusion\tests\wpst_crm\feature_tests\F748-49\common_variables.py'

    suite = TestSuiteBuilder().build(testPath)

    #result = suite.filter(excluded_tags=['FTS', 'TSS'])
    #result = suite.filter(included_tags=['7', '8', '40'])
    #result = suite.filter(included_tags=['15', '16', '17', '18'])
    #result = suite.filter(included_tags='5')
    #result = suite.filter(included_tags='ENCLOSURE GROUPS')
    #result = suite.filter(included_tags=['FTS', 'TSS'])
    IP = None
    #IP = '15.199.229.190'
    VM = 'HPOneView-SSH_3.00.00_244361p78'
    result = suite.run(variable=['APPLIANCE_IP:%s' % IP,
                                 'VM:%s' % VM],
                       critical='smoke',
                       output='output.xml',
                       exitonerror=True,
                       exitonfailure=True,
                       skipteardownonexit=True)
    # Report and xUnit files can be generated based on the  result object.
    #ResultWriter(result).write_results(report='report.html', log='log.html')
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
Пример #12
0
def main():
    testname = "F105 - Tbird FCoE Feature Test"
    testpath = r'feature_test_F105.txt'
    # dataPath = r'C:\rg-fusion\fusion\tests\wpst_crm\feature_tests\TBIRD\F105\data_variables.py'

    suite = TestSuiteBuilder().build(testpath)

    # result = suite.filter(excluded_tags=['FTS', 'TSS'])
    # result = suite.filter(included_tags=['12', '13', '15'])
    result = suite.filter(included_tags=['2', 'Performance'])
    # result = suite.filter(included_tags=['FTS', 'TSS', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15'])
    # result = suite.filter(included_tags=['3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14'])

    ip = '15.245.131.206'
    vm = None
    result = suite.run(
        variable=['APPLIANCE_IP:%s' % ip],
        variablefile='bb58_me_variables.py',
        critical='smoke',
        output='output.xml',
        exitonerror=True,
        exitonfailure=True,
        skipteardownonexit=True,
        listener='/fusion400/fusion/Tools/performance/listener.py')
    ResultWriter('output.xml').write_results()
Пример #13
0
    def run(self):
        #lock = threading.Lock()

        # self.lock.acquire()
        if not exists_path(self.output):
            mk_dirs(self.output)

        self.suite = TestSuiteBuilder().build(self.project)

        (output, index) = self.reset_next_build_numb()

        self.setName(output)

        self.result = self.suite.run(output_directory=output,
                                     output=output + "/output.xml",
                                     debugfile=output + "/debug.txt",
                                     loglevel="TRACE")

        # self.reset_last_status(index)

        # Report and xUnit files can be generated based on the result object.
        # ResultWriter(self.result).write_results(report=output + '/report.html', log=output + '/log.html')

        # self.lock.release()

        # Generating log files requires processing the earlier generated output XML.
        # ResultWriter(self.output + '/output.xml').write_results()

        self.result = ExecutionResult(out + "/output.xml")

        self.reset_last_status(self.result, output, index)

        # Report and xUnit files can be generated based on the result object.
        ResultWriter(self.result).write_results(report=out + '/report.html',
                                                log=out + '/log.html')
Пример #14
0
 def run_test(self):
     suite = TestSuiteBuilder().build('.')
     suite.filter(included_suites=['Tests'])
     suite.run(output="output.xml")
     ResultWriter("output.xml").write_results(report="Report.html",
                                              log_level='TRACE',
                                              log="Logs.html")
def main():
    testName = "PortMon Feature Test"
    testPath = r'C:\rg-fusion\fusion\tests\wpst_crm\feature_tests\PortMonitoring\port_monitoring.txt'
    dataPath = r'C:\rg-fusion\fusion\tests\wpst_crm\feature_tests\PortMonitoring\data_variables.py'

    suite = TestSuiteBuilder().build(testPath)

    result = suite.filter(included_tags='1')
    #result = suite.filter(included_tags='ENCLOSURE GROUPS')
    #result = suite.filter(included_tags=['LIGS', 'ENCLOSURE GROUPS'])

    result = suite.run(variable=[#'DATA:'+dataPath,
                                 'APPLIANCE_IP:192.173.1.68'],
                                 #'VM:HPOneView-DCS_2.00.00_202884_p39'],
                       critical='smoke',
                       output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    #ResultWriter(result).write_results(report='report.html', log='log.html')
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print ('Total failed %d' % stats.all.failed)
    print ('Total passed %d' % stats.all.passed)
    print ('Total tests %d' % stats.all.total)
def main():
    # testName = "Configure Dev Enclosure"
    testPath = r'C:\RGCore\fusion\tests\cosmos\Storage_api\storage_Volume.txt'

    suite = TestSuiteBuilder().build(testPath)
    result = suite.run(variable=['DATA:data_variables.py'],
                       critical='smoke',
                       output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    ResultWriter(result).write_results(report='report.html', log=None)
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
Пример #17
0
def robot_run(suite, options):

    from robot.api import ResultWriter
    from robot.conf import RobotSettings
    settings = RobotSettings(options)
    suite.configure(**settings.suite_config)
    result = suite.run(settings, critical='smoke')

    ResultWriter(settings.output if settings.log else result).write_results(
        report=settings.report, log=settings.log)
Пример #18
0
def main():

    testPath = r'tunnel-networks.txt'

    suite = TestSuiteBuilder().build(testPath)

    result = suite.run(variable=['APPLIANCE_IP:15.245.131.22'],
                       critical='smoke',
                       output='output.xml')
    result = suite.run(critical='smoke', output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    ResultWriter(result).write_results(report='report.html', log=None)
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
Пример #19
0
 def run(self):
     self.create_variables()
     self.open_browsers()
     self.search_word()
     self.assert_title()
     self.close_browsers()
     # 运行套件
     result = self.suit.run(critical="百度搜索", output="output3.xml")
     ResultWriter(result).write_results(report="report3.html",
                                        log="log3.html")
Пример #20
0
 def result_aggregate(self):
     """
     聚合测试报告
     """
     xml_files = [
         os.path.join(obj.RESULTS_DIR, f)
         for f in os.listdir(obj.RESULTS_DIR) if f.endswith('.xml')
     ]
     ResultWriter(*xml_files).write_results(name=self.resolve.item,
                                            output='output.xml')
Пример #21
0
def robot_run(app, case_key, args='', user='', driver='USER'):

    username = user if user != '' else session['username']

    project = get_projectnamefromkey(case_key)
    output = app.config["AUTO_HOME"] + "/jobs/%s/%s" % (username, project)

    if not exists_path(output):
        mk_dirs(output)

    (out, index) = reset_next_build_numb(output)

    mk_dirs(out) if not exists_path(out) else None

    cmd = 'robot ' + args + ' --outputdir=' + out + ' ' + case_key

    log.info("Robot_run CMD:{}".format(cmd))
    with open(out + "/cmd.txt", 'w') as f:
        f.write("{}|robot|{}|--outputdir={}|{}\n".format(
            driver, args, out, case_key))

    cp = subRun(cmd,
                shell=True,
                stdout=PIPE,
                stderr=STDOUT,
                text=True,
                timeout=7200)  # timeout: sec 2hrs

    with open(out + "/debug.txt", 'w') as f:
        f.write(cp.stdout)

    app.config['DB'].insert_loginfo(username, 'task', 'run', case_key, 'OK')

    # Report and xUnit files can be generated based on the result object.
    # ResultWriter(result).write_results(report=out + '/report.html', log=out + '/log.html')
    try:

        detail_result = ExecutionResult(out + "/output.xml")

    except Exception as e:
        log.error(
            "Open output.xml Exception:{},\n May robot run fail, console:{}".
            format(e, cp.stdout))
        return

    # detail_result.save(out + "/output_new.xml")
    reset_last_status(detail_result, output, index)

    # Report and xUnit files can be generated based on the result object.
    ResultWriter(detail_result).write_results(report=out + '/report.html',
                                              log=out + '/log.html')

    s = detail_result.suite
    dealwith_source(app, username, s)
Пример #22
0
    def test_run(self, app, user_id):
        with app.app_context():
            try:
                task = AutoTask(project_id=self.id,
                                build_no=self.build_no,
                                status="running",
                                create_author_id=user_id)
                db.session.add(task)
                db.session.commit()
                base_dir = self.project_dir + "/%d/" % self.build_no
                test_suite = TestSuiteBuilder().build(base_dir +
                                                      "testcase.robot")
                test_suite.name = self.project_name

                result = test_suite.run(output=base_dir + "/result/output.xml")

                # Report and xUnit files can be generated based on the result object.
                ResultWriter(result).write_results(
                    report=base_dir + "/result/result.html",
                    log=base_dir + "/result/log.txt")

                # Generating log files requires processing the earlier generated output XML.
                ResultWriter(base_dir + "/result/output.xml").write_results()

                task = AutoTask.query.filter(
                    and_(AutoTask.project_id == self.id,
                         AutoTask.build_no == self.build_no)).first()
                task.end_timestamp = datetime.utcnow()
                stats = result.statistics
                if stats.total.critical.failed != 0:
                    task.status = 'fail'
                else:
                    task.status = 'pass'

                db.session.merge(task)
                db.session.commit()
            except Exception as e:
                print(str(e))
                return str(e)

        return None
def main():
    # testName = "Configure Dev Enclosure"
    testPath = r'C:\rg-fusion\fusion\tests\wpst_crm\ci_fit\tests\configure_appliance\setup.txt'
    dataPath = r'C:\rg-fusion\fusion\tests\wpst_crm\developer\rbriggs\configure_dev_enclosure\efit_data_variables.py'

    suite = TestSuiteBuilder().build(testPath)
    result = suite.run(variable=[
        'DATA:..\\..\\..\\feature_tests\\F113\\data_variables.py',
        'VM:ov-russell-tot', 'VMSETUP:no', 'FTS:no', 'CONFIGURE:yes'
    ],
                       critical='smoke',
                       output='output.xml')
    # Report and xUnit files can be generated based on the  result object.
    ResultWriter(result).write_results(report='report.html', log=None)
    # Generating log files requires processing the earlier generated output XML.
    ResultWriter('output.xml').write_results()

    stats = result.suite.statistics
    print('Total failed %d' % stats.all.failed)
    print('Total passed %d' % stats.all.passed)
    print('Total tests %d' % stats.all.total)
Пример #24
0
def main():
    cwd = os.getcwd()
    runner_path = os.getcwd()
    vc_test_path = cwd + vc_test_dir
    os.chdir(vc_test_path)
    # os.chdir(vc_test_path)
    cwd = os.getcwd()
    for vc_test_file in vc_test_files:
        print 'dir is ' + cwd
        suite = TestSuiteBuilder().build(vc_test_path + vc_test_file)
        # suite.filter(included_tags='ACTIVE')
        result = suite.run(critical='smoke',
                           output=runner_path + '/output.xml')
        ResultWriter(result).write_results(report=runner_path + '/report.html',
                                           log=None)
        ResultWriter(runner_path + '/output.xml').write_results()

        stats = result.suite.statistics
        print('Total failed %d' % stats.all.failed)
        print('Total passed %d' % stats.all.passed)
        print('Total tests %d' % stats.all.total)
Пример #25
0
def main(args):
    from robot.api import ResultWriter
    opts, datasources = ArgumentParser(USAGE).parse_args(args)
    keys = set()
    for k in opts:
        if opts[k] is None:
            keys.add(k)
    for k in keys:
        del opts[k]
    opts['dotted'] = True
    runner(datasources, **opts)
    ResultWriter(opts.get('output', 'output.xml')).write_results(settings=None, **opts)
Пример #26
0
    def run(self):
        self.create_variables()
        self.open_browsers()
        self.search_word()
        self.assert_title()
        self.close_browsers()

        # 运行套件
        result = self.suite.run(critical="百度搜索", output="Test-outputxml")

        # 生成日志,报告文件
        ResultWriter(result).write_results(report="Test-report.html",
                                           log="Test-log.html")
Пример #27
0
    def run(self):
        self.create_variables()
        self.open_browsers()
        self.et_word()
        self.assert_title()
        self.close_browsers()

        # 运行套件
        result = self.suite.run(critical="菜小秘财务端",
                                output="../reports/output.xml")

        # 生成日志、报告文件
        ResultWriter(result).write_results(report="../reports/report.html",
                                           log="../reports/log.html")
Пример #28
0
    def run(self):
        self.create_variables()
        self.open_browsers()
        self.login()
        self.assert_title()
        self.add_area()
        self.assert_result()
        self.close_browsers()

        # 运行套件
        result = self.suite.run(critical="登录测试", output="output.xml")

        # 生成日志、报告文件
        ResultWriter(result).write_results(report="report.html",
                                           log="log.html")
Пример #29
0
    def run(self):
        self.create_variables()
        self.open_browsers()
        self.search_word()
        self.assert_title()
        self.close_browsers()

        # 运行套件
        result = self.suite.run(critical="find_baidu",
                                output=os.getcwd() + "/tempfile/output.xml")

        # 生成日志、报告文件
        ResultWriter(result).write_results(
            report=os.getcwd() + "/tempfile/report.html",
            log=os.getcwd() + "/tempfile/log.html")
Пример #30
0
    def _publish(self, result):
        reportname = self.get_standard_reportname()
        upload_file_path = f'/tmp/{reportname}.html'
        ResultWriter(result).write_results(report=upload_file_path, log=None)
        blob_service_client = BlobServiceClient.from_connection_string(
            self.connection_string)
        container_name = "$web"
        target_blob = f"{self.path or ''}{self.prefix or ''}{reportname}.html"
        blob_client = blob_service_client.get_blob_client(
            container=container_name, blob=target_blob)

        static_html_content_settings = ContentSettings(
            content_type='text/html')
        with open(upload_file_path, "rb") as data:
            blob_client.upload_blob(
                data, content_settings=static_html_content_settings)
        self.publish_target = f'{self.blob_url or ""}/{target_blob}'