关键字GetVerifyState,用于校验策略验证时返回策略的状态,补充提交删除默认allow策略时的categoryids参数
This commit is contained in:
@@ -173,6 +173,7 @@ SecurityPolicy-Allow-TSGUIAPI-DEL
|
||||
log toDelTSGUIAPI
|
||||
#${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${testBifangPolicy}]}
|
||||
#${policyIds} Create List ${testBifangPolicy}
|
||||
${objectIds} Create List ${testBifangIP}
|
||||
DeletePolicyAndGroupObject ${testBifangPolicy} ${objectIds}
|
||||
${objectIds} Create List ${testBifangIP}
|
||||
${categories} Create List
|
||||
DeletePolicyAndGroupObject ${testBifangPolicy} ${objectIds} ${categories}
|
||||
log delTSGUIAPISucess
|
||||
@@ -56,6 +56,7 @@ AddPolicies
|
||||
... ELSE IF "${dictType}" == "<class 'dict'>" PolicyDataOperation ${returnData} ${policyList} add ${version}
|
||||
... ELSE Set Variable ${EMPTY}
|
||||
#${body} Set Variable {"opAction":"add","policyList":{"policyName":"wx-test","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"protocol":"SSL","method":"drop"},"source":[{"objectId":3101,"protocolField":"TSG_SECURITY_SOURCE_ADDR"}],"destination":[],"filterList":[{"filter":[{"objectId":3404,"protocolField":"TSG_FIELD_SSL_CN"}]}],"appIdObjects":[3],"isValid":0,"scheduleId":[]}}
|
||||
log ${body}
|
||||
${response} BasePostRequestForV2 ${policyUrl} ${body} ${version}
|
||||
${policyIds} Run Keyword If "${returnData}" == "1" Get-PolicyIds ${response}
|
||||
... ELSE Create List
|
||||
@@ -185,6 +186,21 @@ VerifyPolicies
|
||||
${rescode} Set Variable ${response['code']}
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
[Return] ${rescode} ${response['data']}
|
||||
|
||||
GetVerifyState
|
||||
[Documentation]
|
||||
... 传入VerifyPolicies返回的resData值
|
||||
... 以及已知的被命中的策略id
|
||||
[Arguments] ${resData} ${policyId}
|
||||
${len} Get Length ${resData['hitPolicyList']}
|
||||
${policyState} Create Dictionary
|
||||
FOR ${n} IN RANGE ${len}
|
||||
Set To Dictionary ${policyState} '${resData['hitPolicyList'][${n}]['policyId']}'=${resData['hitPolicyList'][${n}]['isExecutePolicy']}
|
||||
END
|
||||
log ${policyState}
|
||||
${State} Get From Dictionary ${policyState} '${policyId}'
|
||||
Should Be Equal As Strings ${State} True
|
||||
|
||||
GetPolicyTotal
|
||||
[Documentation]
|
||||
... 获取已经存在的策略总量
|
||||
|
||||
Reference in New Issue
Block a user