2021-03-15 09:26:21 +08:00
|
|
|
*** Settings ***
|
|
|
|
|
Force Tags tsg-ui settings response_pages
|
|
|
|
|
Resource ../../../03-Variable/bifangapivariable.txt
|
|
|
|
|
Library OperatingSystem
|
|
|
|
|
Resource ../../../02-Keyword/tsg_ui/setting/Settings.robot
|
2021-03-25 09:28:12 +08:00
|
|
|
Library ../../../04-CustomLibrary/Custometest/UIAssert.py
|
2021-04-09 14:31:00 +08:00
|
|
|
Library ../../../04-CustomLibrary/Custometest/ReportSchema.py
|
|
|
|
|
Library DateTime
|
|
|
|
|
Library json
|
|
|
|
|
Library Selenium2Library
|
|
|
|
|
Library RequestsLibrary
|
|
|
|
|
Library Collections
|
|
|
|
|
Library String
|
|
|
|
|
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}
|
2021-03-15 09:26:21 +08:00
|
|
|
|
|
|
|
|
*** Test Cases ***
|
|
|
|
|
CreateAndEdit
|
|
|
|
|
${ResponsrPageInfo} Create Dictionary CreateOrEdit=Create search=name Name=${TEST NAME} file=${path}response_pages_files\\Create-ResponsePages-test.html
|
|
|
|
|
${EditResponsrPageInfo} Create Dictionary CreateOrEdit=Edit search=id Name=${TEST NAME} file=${path}response_pages_files\\Create-ResponsePages-test.html
|
|
|
|
|
... EditName=Edit${TEST NAME} Delete=yes
|
|
|
|
|
ResponsrPageCreateAndEdit ${ResponsrPageInfo}
|
|
|
|
|
ResponsrPageCreateAndEdit ${EditResponsrPageInfo}
|
|
|
|
|
|
|
|
|
|
NoName
|
|
|
|
|
${ResponsrPageInfo} Create Dictionary CreateOrEdit=Create search=name Name=${EMPTY} file=${path}response_pages_files\\Create-ResponsePages-test.html
|
|
|
|
|
... Negtive=yes Assertposition=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[1]/div/div[3] asserttext=Please enter the content
|
2021-03-25 09:28:12 +08:00
|
|
|
ResponsrPageCreateAndEdit ${ResponsrPageInfo}
|
|
|
|
|
|
|
|
|
|
|
2021-04-09 14:31:00 +08:00
|
|
|
ReportInterfaceTest
|
|
|
|
|
log report
|
|
|
|
|
${logtype} Set Variable security_event_log
|
|
|
|
|
${schemaurl} Set Variable http://${host}:${port}/${version}/log/schema?logType=${logtype}
|
|
|
|
|
${dataset_url} Set Variable http://${host}:${port}/${version}/report/dataset
|
|
|
|
|
${char_url} Set Variable http://${host}:${port}/${version}/report/chart
|
|
|
|
|
${report_url} Set Variable http://${host}:${port}/${version}/report/offlinejob
|
|
|
|
|
${dataset_geturl} Set Variable ${dataset_url}?pageSize=20&pageNo=1&id=&name=${TEST NAME}&logType=&opStartTime=&opEndTime=&opUser=
|
|
|
|
|
${char_geturl} Set Variable ${char_url}?pageSize=20&pageNo=1&id=&name=${TEST NAME}&opUser=
|
|
|
|
|
ReportInterfaceTest ${schemaurl} ${token} ${dataset_url} ${char_url} ${report_url} ${dataset_geturl} ${char_geturl} ${TEST NAME} ${logtype}
|
|
|
|
|
# log ${aaaa}
|
|
|
|
|
# BasePostRequestOK ${chart_url} {"list":{"id":null,"name":"${TEST NAME}","description":"","datasetId":"${id}","chartType":"line","dataTop":0,"orderBy":"","orderDesc":0,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Client IP","type":"Line Up","format":"Default","legend":"Client IP"}],"groupBy":null},"refuseCode":true}
|
|
|
|
|
# ${response1} BaseGetRequestOK ${chart_url} pageSize=20&pageNo=1&id=&name=${TEST NAME}&opUser=
|
|
|
|
|
# ${chartId} Set Variable ${response1}[data][list][0][id]
|
|
|
|
|
|
|
|
|
|
# Comment 创建Report
|
|
|
|
|
# BasePostRequestOK ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":"","rangeUnit":"","jobName":"${TEST NAME}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":30,"timeUnit":"minute","disabled":false}],"isNotice":0,"noticeMethod":"","receivers":[""],"receiver":"","startTime":"","endTime":"","filterCondition":null,"isDisplayTrafficTrend":0}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
datasetjsontest
|
|
|
|
|
${schemaurl} Set Variable http://192.168.44.72:8080/v1/log/schema?logType=security_event_log
|
|
|
|
|
log date1111111
|
|
|
|
|
datasetjson ${schemaurl} ${token}
|
|
|
|
|
|
|
|
|
|
reporttest
|
|
|
|
|
log 开始
|
|
|
|
|
BasePostRequestOK ${dataset_url} {"list": {"name": "ReportInterfaceTest", "logType": "security_event_log", "groupColumnList": [{"name": "common_subscriber_id"}, {"name": "common_l7_protocol"}, {"name": "mail_account"}, {"name": "common_device_id"}], "queryColumnList": [{"name": "common_subscriber_id"}, {"name": "common_l7_protocol"}, {"name": "mail_account"}, {"name": "common_device_id"}, {"name": "common_s2c_pkt_num", "expression": "avg"}, {"name": "common_establish_latency_ms", "expression": "max"}], "filterCondition": {"andConditions": [{"orConditions": [{"name": "common_con_duration_ms", "expression": "!=", "value": ["12289"], "type": "int"}]}, {"orConditions": [{"name": "common_establish_latency_ms", "expression": ">", "value": ["12289"], "type": "int"}]}, {"orConditions": [{"name": "common_sled_ip", "expression": "!=", "value": ["192.168.50.11"], "type": "string"}]}]}, "havingCondition": {"andConditions": [{"orConditions": [{"name": "mail_to", "function": "count_distinct", "expression": "=", "value": "97658"}]}, {"orConditions": [{"name": "common_subscriber_id", "function": "count_distinct", "expression": "<", "value": "97658"}]}, {"orConditions": [{"name": "ssl_sni", "function": "count", "expression": "<", "value": "97658"}]}]}}}
|
|
|
|
|
${response} BaseGetRequestOK ${dataset_url} pageSize=20&pageNo=1&id=&name=test&logType=&opStartTime=&opEndTime=&opUser=
|
|
|
|
|
${datasetId} Set Variable ${response}[data][list][0][id]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chartest
|
|
|
|
|
BasePostRequestOK ${chart_url} {"list": {"name": "ReportInterfaceTest", "datasetId": 281, "datasetName": "", "chartType": "pie", "dataTop": 0, "orderBy": "", "orderDesc": "", "xAxis": {"dataBinding": "Client Location", "dataTop": 5, "dataType": 3}, "yAxis": [{"dataBinding": "Establish Latency(ms)", "format": "Default"}]}}
|
|
|
|
|
# ${response1} BaseGetRequestOK ${chart_url} pageSize=20&pageNo=1&id=&name=${TEST NAME}&opUser=
|
|
|
|
|
# ${chartId} Set Variable ${response1}[data][list][0][id]
|
|
|
|
|
|
|
|
|
|
chartest11
|
|
|
|
|
log 输出111111
|
|
|
|
|
${logtype} Set Variable security_event_log
|
|
|
|
|
${schemaurl} Set Variable http://${host}:${port}/${version}/log/schema?logType=${logtype}
|
|
|
|
|
chartest ${schemaurl} ${token}
|
2021-03-25 09:28:12 +08:00
|
|
|
|