提交log用例示例和log关键字(Python文件)
This commit is contained in:
@@ -11,16 +11,25 @@ Resource ../tsg_bfapi/ApiRequest.robot
|
||||
Resource Log_schema.robot
|
||||
Resource ../tsg_bfapi/Common.robot
|
||||
Library ../../04-CustomLibrary/Custometest/Schema.py
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Test Cases ***
|
||||
Apitext
|
||||
${logurl} Set Variable http://192.168.44.72:8080/v1/log/list
|
||||
|
||||
${logtype} Set Variable security_event_log
|
||||
|
||||
${schemaurl} Set Variable http://192.168.44.72:8080/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
|
||||
log ${StartTime1}
|
||||
log ${EndTime1}
|
||||
LogApiSearch ${StartTime1} ${EndTime1} security_event_log v1/log/list
|
||||
|
||||
logapiverify ${logurl} ${schemaurl} ${token} ${StartTime1} ${EndTime1} ${logtype}
|
||||
|
||||
*** Keywords ***
|
||||
log_search
|
||||
@@ -47,10 +56,16 @@ LogApiSearch
|
||||
log 11111111${type1}
|
||||
${schemaresponsedata1} Get From Dictionary ${schemaresponsedata} data
|
||||
${filds} Get From Dictionary ${schemaresponsedata1} fields
|
||||
${filedsJson} json.dumps ${filds}
|
||||
${type3} Evaluate "${filds}".replace(' ','')
|
||||
#${type2} Evaluate ${type3}.replace(' ','')
|
||||
${type2} Evaluate type(${type3})
|
||||
log ${type2}
|
||||
log ${type3}
|
||||
#${filedsJson} json.dumps ${type3}
|
||||
log ${type3}
|
||||
${filter1} run keyword if "${filter}"=="null" Filter1 ${schemaresponsedata}
|
||||
run keyword if "${filter}"=="null" ForFilter ${start-time} ${end-time} ${logtype} ${url}
|
||||
... ${filedsJson} ${conditions} ${filter1}
|
||||
... ${type3} ${conditions} ${filter1}
|
||||
... ELSE LogSearchRequest ${start-time} ${end-time} ${logtype} ${url}
|
||||
... ${conditions} ${filter}
|
||||
# ${requestbody} Set Variable {"start_common_recv_time":"${start-time}","end_common_recv_time":"${end-time}","logType":"${type}","fields":${filedsJson},"conditions":${conditions},"filter":${filter},refuseCode":true}
|
||||
@@ -61,10 +76,11 @@ LogSearchRequest
|
||||
[Arguments] ${start-time} ${end-time} ${logtype} ${url} ${filedsJson} ${conditions} ${filter}
|
||||
# ${type2} Evaluate type(${filedsJson})
|
||||
# log 7777${type2}
|
||||
${requestbody} Set Variable {"start_common_recv_time":"${start-time}","end_common_recv_time":"${end-time}","logType":"${logtype}","fields":${filedsJson},"conditions":${conditions},"filter":${filter},refuseCode":true}
|
||||
${requestbody} Set Variable {"start_common_recv_time":"${start-time}","end_common_recv_time":"${end-time}","logType":"${logtype}","fields":${filedsJson},"conditions":${conditions},"filter":${filter},refuseCode":"true"}
|
||||
log ${requestbody}
|
||||
#${requestbody1} json.loads ${requestbody}
|
||||
#${type1} Evaluate type(${requestbody})
|
||||
#log 88888888${type1}
|
||||
# ${type2} Evaluate type(${requestbody})
|
||||
# log 88888888${type2}
|
||||
${response} Post-Request ${url} ${requestbody}
|
||||
${code} Get From Dictionary ${response} code
|
||||
log 22222222${response}
|
||||
|
||||
Reference in New Issue
Block a user