60 lines
2.9 KiB
Plaintext
60 lines
2.9 KiB
Plaintext
*** Settings ***
|
||
Resource ../../03-Variable/BifangApiVariable.txt
|
||
Resource LogSchema.robot
|
||
Library REST http://${host}:${port}
|
||
Library RequestsLibrary
|
||
Library OperatingSystem
|
||
Library Collections
|
||
Library string
|
||
|
||
*** Keywords ***
|
||
GetLogList
|
||
[Arguments] ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} ${parmkey} ${parmvalue}
|
||
${logCondition} GetLogCondition ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id}
|
||
log ${logCondition}
|
||
${LogListResponse} PostRemoteData /${version}/log/list ${logCondition}
|
||
Should Be Equal As Strings ${LogListResponse.status_code} 200
|
||
${returnData} To Json ${LogListResponse.content}
|
||
${responseCode} Get From Dictionary ${returnData} code
|
||
Log ${responseCode}
|
||
Should Be Equal ${responseCode} ${200} security_event_log \ \ test query list failed
|
||
log this time request security_event_log \ table logRecord \ : ${LogListResponse.content}
|
||
${a} Set Variable this time request security_event_log \ table logRecord \ : ${LogListResponse.content}
|
||
log ${a}
|
||
${log} Set Variable ${LogListResponse.json()}[data][list]
|
||
FOR ${logs} IN ${log}
|
||
log ${logs}
|
||
END
|
||
log %%%%%%%%%%%%%%%%%%%%%%%%${logs}
|
||
Should Contain ${logs}"" ${client_ip}
|
||
Should Contain ${logs}"" ${policy_id}
|
||
Should Contain ${logs}"" ${parmkey}
|
||
Should Contain ${logs}"${parmkey}" ${parmvalue}
|
||
|
||
|
||
|
||
GetLogListSize
|
||
[Documentation]
|
||
... 描述:ProxyPinning
|
||
...
|
||
[Arguments] ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} ${parmkey} ${parmvalue}
|
||
${logCondition} GetALLLogCondition ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} 10000 1
|
||
log ${logCondition}
|
||
${LogListResponse} PostRemoteData /${version}/log/list ${logCondition}
|
||
Should Be Equal As Strings ${LogListResponse.status_code} 200
|
||
${returnData} To Json ${LogListResponse.content}
|
||
${data} Get From Dictionary ${returnData} data
|
||
${len} Get Length ${data}[list]
|
||
[Return] ${len}
|
||
|
||
|
||
GetLogCount
|
||
[Arguments] ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} ${parmkey} ${parmvalue}
|
||
${logCondition} GetALLLogCondition ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} 10000 1
|
||
${LogListResponse} PostRemoteData /${version}/log/count ${logCondition}
|
||
Should Be Equal As Strings ${LogListResponse.status_code} 200
|
||
${returnData} To Json ${LogListResponse.content}
|
||
${len} Set Variable ${LogListResponse.json()}[data][total]
|
||
#${len} Get From Dictionary ${returnData} total
|
||
[Return] ${len}
|
||
|