1、中间件比率测试:只出数据不出结论;增加日志总量查询关键字;

2、制造http支持alert数据;
3、删除策略中目标对象的默认引用
This commit is contained in:
dongxiaoyan
2020-04-28 12:46:43 +08:00
parent 51eb81f6bf
commit 7dea8cc295
7 changed files with 569 additions and 27 deletions

View File

@@ -31,3 +31,39 @@ PostRemoteData
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Post Request api ${url} data=${data} headers=${header}
[Return] ${remoteResponse}
GetALLLogCondition
[Arguments] ${logname} ${startTime} ${endTime} ${client_ip} ${policy_id} ${pageSize} ${pageNo}
Set Headers {"Content-Type":"application/x-www-form-urlencoded","Authorization":"${token}"}
&{LogSchemaResponse}= GET /v1/log/schema?logType=${logname}
log ${logname}
#Output Schema response body
Object response body
#Integer $.code 200
log ${LogSchemaResponse.body['data']}
${field} Evaluate json.dumps(eval(str(${LogSchemaResponse.body['data']['fields']}))) json
log ${field}
#${pageSize} Set Variable 30
#${pageNo} Set Variable 1
${condition} Set Variable [{"value":["${startTime}","${endTime}"],"symbol":"between","field":"common_recv_time","type":"timestamp"}]
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","fields":${field},"start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition} ,"common_client_ips":"${client_ip}","common_policy_ids":"${policy_id}"}
log this time query condition:${logCondition}
[Return] ${logCondition}
GetLogCountConditon
[Arguments] ${logname} ${startTime} ${endTime} ${client_ip} ${policy_id} ${pageSize} ${pageNo}
Set Headers {"Content-Type":"application/x-www-form-urlencoded","Authorization":"${token}"}
&{LogSchemaResponse}= GET /v1/log/schema?logType=${logname}
log ${logname}
#Output Schema response body
Object response body
#Integer $.code 200
log ${LogSchemaResponse.body['data']}
${field} Evaluate json.dumps(eval(str(${LogSchemaResponse.body['data']['fields']}))) json
log ${field}
#${pageSize} Set Variable 30
#${pageNo} Set Variable 1
${condition} Set Variable [{"value":["${startTime}","${endTime}"],"symbol":"between","field":"common_recv_time","type":"timestamp"}]
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","fields":${field},"start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition} ,"common_client_ips":"${client_ip}","common_policy_ids":"${policy_id}"}
log this time query condition:${logCondition}
[Return] ${logCondition}

View File

@@ -29,4 +29,32 @@ GetLogList
Should Contain ${logs}"" ${client_ip}
Should Contain ${logs}"" ${policy_id}
Should Contain ${logs}"" ${parmkey}
Should Contain ${logs}"${parmkey}" ${parmvalue}
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 /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 /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}

View File

@@ -103,6 +103,29 @@ CreatePolicyFile3
Log profileId:${profileId}
[Return] ${response}
CreatePolicyFileNoFile
[Documentation]
... 必传参数url
... 可选参数data不传时使用默认值
[Arguments] ${url} ${data}
${suffix} Generate Random String
${profileName} Catenate SEPARATOR=_ test ${suffix}
${listlenth}= Get Length ${data}
${requestbody} Set Variable {"opAction":"add","returnData":1,"trafficMirrorList":[{"profileName":"${profileName}","addrType":"mac","isValid":1,"addrArray":["00:A1:B2:06:C3:29"]}]}
FOR ${var} IN RANGE ${listlenth}
#log ${var}
${request} Set Variable ${data}[${var}]
END
${content} Post-Request ${url} ${requestbody}
${msg} Set Variable ${content['msg']}
${list} Set Variable ${content['data']['list']}
${profileId} Set Variable ${list[0]['profileId']}
${profileName} Set Variable ${list[0]['profileName']}
${response} Create Dictionary msg=${msg} profileId=${profileId} profileName=${profileName}
Log add operation:${msg}
Log profileId:${profileId}
[Return] ${response}
CreatePolicyMutipartFile
[Documentation]
... 必传参数url、filePath文件路径、pubFileName证书文件名、priFileName私钥文件名