106 lines
5.9 KiB
Plaintext
106 lines
5.9 KiB
Plaintext
*** Settings ***
|
|
Resource ../../../03-Variable/BifangApiVariable.txt
|
|
Library ../../../04-CustomLibrary/Custometest/LogSchema.py
|
|
Library ../../../04-CustomLibrary/Custometest/LogResponseVAL.py
|
|
Library DateTime
|
|
Library json
|
|
Library OperatingSystem
|
|
Library Selenium2Library
|
|
Library RequestsLibrary
|
|
Library Collections
|
|
Library String
|
|
|
|
*** Variables ***
|
|
|
|
*** Test Cases ***
|
|
|
|
LogApiVerifyCase
|
|
[Documentation] 验证日志查询纯接口测试
|
|
${Logurl} Set Variable http://${host}:${port}/v1/log/list
|
|
${logTypelist} Set Variable security_event_log proxy_event_log connection_record_log radius_record_log voip_record_log live_session_record_log transaction_record_log gtpc_record_log
|
|
${EndTime} get current date
|
|
${EndTime1} Get Substring ${EndTime} \ -4
|
|
${StartTime} add time to date ${EndTime} -01:00:00
|
|
${StartTime1} Get Substring ${StartTime} \ -4
|
|
FOR ${logType} in @{logTypelist}
|
|
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logType}
|
|
${a} logapiverify ${Schemaurl} ${Logurl} ${token} ${StartTime1} ${EndTime1} ${logType}
|
|
END
|
|
|
|
|
|
LogFieldVerifyCase
|
|
[Documentation] 验证日志详情字段
|
|
${Logurl} Set Variable http://${host}:${port}/v1/log/list
|
|
${logTypelist} create list security_event_log proxy_event_log connection_record_log radius_record_log voip_record_log live_session_record_log transaction_record_log gtpc_record_log
|
|
${EndTime} get current date
|
|
${EndTime1} Get Substring ${EndTime} \ -4
|
|
${StartTime} add time to date ${EndTime} -03:00:00
|
|
${StartTime1} Get Substring ${StartTime} \ -4
|
|
${filter} Set Variable
|
|
FOR ${logType} in @{logTypelist}
|
|
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logType}
|
|
${responsebody} loglistverify ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType} ${filter}
|
|
log ${responsebody}
|
|
LogFieldValidation ${Schemaurl} ${token} ${responsebody}
|
|
END
|
|
|
|
LogExportVerifyCase
|
|
[Documentation] 验证日志导出接口
|
|
${Logurl} Set Variable http://${host}:${port}/v1/log/batch
|
|
${logTypelist} create list security_event_log proxy_event_log connection_record_log radius_record_log voip_record_log live_session_record_log transaction_record_log gtpc_record_log
|
|
${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
|
|
FOR ${logType} in @{logTypelist}
|
|
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logType}
|
|
exportlog ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType} ${filter}
|
|
END
|
|
|
|
LogExportCeilingVerifyCase
|
|
[Documentation] 验证日志导出接口上限测试,当前导出上限为十万
|
|
${Logurl} Set Variable http://${host}:${port}/v1/log/batch
|
|
${logTypelist} create list security_event_log proxy_event_log connection_record_log radius_record_log voip_record_log live_session_record_log transaction_record_log gtpc_record_log
|
|
${StartTime1} Set Variable 2020-05-01 00:00:00
|
|
${EndTime1} Set Variable 2021-05-01 00:00:00
|
|
${filter} Set Variable
|
|
FOR ${logType} in @{logTypelist}
|
|
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logType}
|
|
exportlog ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType} ${filter}
|
|
END
|
|
|
|
LogRetrieveVerifyCase
|
|
[Documentation] 验证日志检索条件接口
|
|
${Logurl} Set Variable http://${host}:${port}/v1/log/list
|
|
${logTypelist} create list security_event_log proxy_event_log connection_record_log radius_record_log voip_record_log live_session_record_log transaction_record_log gtpc_record_log
|
|
${EndTime} get current date
|
|
${EndTime1} Get Substring ${EndTime} \ -4
|
|
${StartTime} add time to date ${EndTime} -03:00:00
|
|
${StartTime1} Get Substring ${StartTime} \ -4
|
|
${filter} Set Variable
|
|
FOR ${logType} in @{logTypelist}
|
|
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logType}
|
|
${responsebody} loglistverify ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType} ${filter}
|
|
LogRetrieve ${Schemaurl} ${host} ${port} ${token} ${logType} ${responsebody}
|
|
END
|
|
|
|
LogRetrieveComplexSqlVerifyCase
|
|
[Documentation] 日志检索条件接口复杂SQL验证
|
|
${Logurl} Set Variable http://${host}:${port}/v1/log/list
|
|
${logTypelist} create list security_event_log connection_record_log security_event_log proxy_event_log connection_record_log radius_record_log voip_record_log live_session_record_log transaction_record_log gtpc_record_log
|
|
${EndTime} get current date
|
|
${EndTime1} Get Substring ${EndTime} \ -4
|
|
${StartTime} add time to date ${EndTime} -03:00:00
|
|
${StartTime1} Get Substring ${StartTime} \ -4
|
|
${filter} Set Variable
|
|
FOR ${logType} in @{logTypelist}
|
|
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logType}
|
|
${responsebody} loglistverify ${Logurl} ${Schemaurl} ${token} ${StartTime1} ${EndTime1} ${logType} ${filter}
|
|
LogRetrieveSql ${Schemaurl} ${host} ${port} ${token} ${logType} ${responsebody}
|
|
END
|
|
|
|
|
|
|
|
|