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/api_log/NewApiLogCase.robot
lyf 47ca680bba 1、提交application接口关键字,2、提交Signatures接口关键字,3、提交删除application和Signatures关键字
4、提交新建monitor策略的application用例以及删除策略和对象的用例
2021-04-26 09:38:04 +08:00

145 lines
5.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

*** Settings ***
Resource ../../../03-Variable/BifangApiVariable.txt
Library ../../../04-CustomLibrary/Custometest/Schema.py
Library DateTime
Library json
Library OperatingSystem
Library Selenium2Library
Library RequestsLibrary
Library Collections
Library String
*** Variables ***
${url} /${version}/report/url/recommend
*** Test Cases ***
LogApiVerifyCase-001
[Documentation] 验证api接口
${Logurl} Set Variable http://${host}:${port}/v1/log/list
${logType} Set Variable security_event_log
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logType}
${EndTime} get current date
${EndTime1} Get Substring ${EndTime} \ -4
${StartTime} add time to date ${EndTime} -01:00:00
${StartTime1} Get Substring ${StartTime} \ -4
logapiverify ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType}
LogApiVerifyCase-002
[Documentation] 验证api接口
${Logurl} Set Variable http://${host}:${port}/v1/log/list
${logType} Set Variable security_event_log
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logType}
${EndTime} get current date
${EndTime1} Get Substring ${EndTime} \ -4
${StartTime} add time to date ${EndTime} -01:00:00
${StartTime1} Get Substring ${StartTime} \ -4
${filter} Set Variable common_recv_time = 45535
${responsebody} loglistverify ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType} ${filter}
log ${responsebody}
LogApiVerifyCase-003
[Documentation] 验证api接口:事件日志和通联日志时间分布查询
${StartTime} Set Variable 2021-03-26 12:27:03
${EndTime} Set Variable 2021-03-29 12:27:03
${granularity} Set Variable PT5M
${logType} Set Variable security_event_hits_log
${urlpath} Set Variable ?logType=${logType}&startTime=${StartTime}&endTime=${EndTime}&granularity=${granularity}
${Logurl} Set Variable http://${host}:${port}/v1/interface/gateway/sql/galaxy/${logType}/timedistribution${urlpath}
${responsebody} distributed_query ${Logurl} ${token}
log ${responsebody}
LogApiVerifyCase-004
[Documentation] 验证api接口:事件日志和通联日志时间分布查询
${StartTime} Set Variable 2021-03-26 12:27:03
${EndTime} Set Variable 2021-03-29 12:27:03
${granularity} Set Variable PT5M
${logType} Set Variable proxy_event_hits_log
${urlpath} Set Variable ?logType=${logType}&startTime=${StartTime}&endTime=${EndTime}&granularity=${granularity}
${Logurl} Set Variable http://${host}:${port}/v1/interface/gateway/sql/galaxy/${logType}/timedistribution${urlpath}
${responsebody} distributed_query ${Logurl} ${token}
log ${responsebody}
LogApiVerifyCase-005
[Documentation] 验证api接口:事件日志和通联日志时间分布查询
${StartTime} Set Variable 2021-03-26 12:27:03
${EndTime} Set Variable 2021-03-29 12:27:03
${granularity} Set Variable PT5M
${logType} Set Variable traffic_summary_log
${urlpath} Set Variable ?logType=${logType}&startTime=${StartTime}&endTime=${EndTime}&granularity=${granularity}
${Logurl} Set Variable http://${host}:${port}/v1/interface/gateway/sql/galaxy/${logType}/timedistribution${urlpath}
${responsebody} distributed_query ${Logurl} ${token}
log ${responsebody}
LogApiVerifyCase-006
[Documentation] 验证api接口:日志检索条件校验filter内容验证
${logType} Set Variable security_event_log
${filter} Set Variable common_recv_time = 45535
${urlpath} Set Variable ?logType=${logType}&filter=${filter}
${Logurl} Set Variable http://${host}:${port}/v1/interface/gateway/sql/galaxy/log/filter/validation${urlpath}
${responsebody} distributed_query ${Logurl} ${token}
log ${responsebody}
LogApiVerifyCase-007
[Documentation] 验证api接口:原始日志根据条件过滤计算时间分布查询
${Logurl} Set Variable http://${host}:${port}/v1/log/timedistribution
${logType} Set Variable security_event_log
${StartTime} Set Variable 2021-03-26 12:27:03
${EndTime} Set Variable 2021-03-29 12:27:03
${granularity} Set Variable PT5M
${filter} Set Variable common_recv_time = 45535
${responsebody} timedistribution ${logurl} ${token} ${StartTime} ${EndTime} ${logType} ${granularity} ${filter}
log ${responsebody}