This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_bfapi/report/ReportCase.robot

31 lines
2.4 KiB
Plaintext

*** Settings ***
Force Tags tsg_bf_api report
Library OperatingSystem
Library GetTimeLibrary
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/offline_stat_report/ApiRequest1.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
*** Variables ***
${dataset_url} /${version}/report/dataset
${datasetId} ${EMPTY}
${reportId} ${EMPTY}
${report_url} /${version}/report/offlinejob
${chartId} ${EMPTY}
${chart_url} /${version}/report/chart
${result_url} /${version}/report/offlinejob/result
${resultId} ${EMPTY}
*** Test Cases ***
testSecurity Event
${name} Set Variable Report_SecurityEventActionHit-006-1
#新建DataSet
#${name} Set Variable Report_Result-001
BasePostRequestOK ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","groupColumnList":[{"name":"common_action"}],"queryColumnList":[{"name":"common_action","expression":"","label":"Action"},{"name":"common_c2s_pkt_num,common_s2c_pkt_num","expression":"sum","label":"Packets Sent+Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num,common_s2c_byte_num","expression":"sum","label":"Bytes Sent+Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]}],"filterCondition":null,"havingCondition":null,"isInitialize":0}}
#获取dataset的ID
${response} BaseGetRequestOK ${dataset_url} pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
${datasetId} Set Variable ${response}[data][list][0][id]
${data1} Create Dictionary ids=${datasetId}
BaseDeleteRequestOK ${dataset_url} ${data1}
insert_Report_to_file1 dateset ${datasetId}