feat:(策略删除逻辑)加入策略删除逻辑

This commit is contained in:
wangxin
2020-06-18 18:40:39 +08:00
parent 249ccfaa9c
commit b8b99f730b
2 changed files with 93 additions and 5 deletions

View File

@@ -369,4 +369,60 @@ Policy-Post-v1-00015
... addItemList=putty.com
... updateItemList=${itemList}[0]
... deleteItemIds=${itemIds}[1]
${rescode} UpdateObjects ${1} ${objectDict} update
${rescode} UpdateObjects ${1} ${objectDict} update
Policy-Delete-v1-00016
Comment 创建IP
${objectDict} Create Dictionary objectType=ip isValid=${1}
... isInitialize=0
... addItemList=range|192.168.41.68|192.168.41.68|0/0
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
${objectIds} Set Variable ${objectId1}
Log To Console Create IP Object1
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
${objectIds} Set Variable ${objectId3},${objectIds}
Log To Console Create url Object3
Comment 创建安全策略
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00011 policyType=tsg_security
... policyDesc=wx-autotest
... action=deny effectiveRange={}
... userRegion={"protocol":"HTTP","method":"drop"}
... source=${objectId1}|TSG_SECURITY_SOURCE_ADDR
... destination=${objectId3}|TSG_FIELD_HTTP_URL
... isValid=${1} appIdObjects=2
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
Log ${rescode}
Comment 删除安全策略
${rescode} WxDeletePolicy1 ${policyIds[0]['policyIds']} tsg_security
${policyIds} Create List
Log ${rescode}
Policy-Delete-v1-00017
Comment 创建IP
${objectDict} Create Dictionary objectType=ip isValid=${1}
... isInitialize=0
... addItemList=range|192.168.41.68|192.168.41.68|0/0
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
${objectIds} Set Variable ${objectId1}
Log To Console Create IP Object1
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
${objectIds} Set Variable ${objectId3},${objectIds}
Log To Console Create url Object3
Comment 创建安全策略
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00011 policyType=tsg_security
... policyDesc=wx-autotest
... action=deny effectiveRange={}
... userRegion={"protocol":"HTTP","method":"drop"}
... source=${objectId1}|TSG_SECURITY_SOURCE_ADDR
... destination=${objectId3}|TSG_FIELD_HTTP_URL
... isValid=${1} appIdObjects=2
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
Log ${rescode}
Comment 删除安全策略
${rescode} DeletePolicies ${policyIds}
${policyIds} Create List
Log ${rescode}