fix(策略对象新增):关键字单元,扩展类字符串单元修改为dict方式传入
This commit is contained in:
@@ -10,6 +10,7 @@ Library DateTime
|
||||
*** Variables ***
|
||||
@{policyIds}
|
||||
@{profiles}
|
||||
${objectIds} ${EMPTY}
|
||||
*** Test Cases ***
|
||||
Policy-Get-v1-00001
|
||||
${policy} Create Dictionary policyType=tsg_security action=deny
|
||||
@@ -115,12 +116,12 @@ Policy-Post-v2-00005
|
||||
... 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 Object
|
||||
Log Create IP Object
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com
|
||||
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId2},${objectIds}
|
||||
Log To Console Create url Object
|
||||
Log Create url Object
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_SecurityPolicy-v2-00005 policyType=tsg_security
|
||||
... policyDesc=wx-autotest
|
||||
@@ -162,24 +163,24 @@ Policy-Post-v2-00007
|
||||
... 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
|
||||
Log Create IP Object1
|
||||
Comment 创建IP1
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1}
|
||||
... isInitialize=0
|
||||
... addItemList=range|192.168.41.67|192.168.41.67|0/0
|
||||
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId2}
|
||||
Log To Console Create IP Object2
|
||||
Log Create IP Object2
|
||||
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
|
||||
Log Create url Object3
|
||||
Comment 创建url1
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*google.com.com
|
||||
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId4},${objectIds}
|
||||
Log To Console Create url Object4
|
||||
Log Create url Object4
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00007 policyType=tsg_security
|
||||
... policyDesc=wx-autotest
|
||||
@@ -207,12 +208,12 @@ Policy-Post-v2-00008
|
||||
... 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
|
||||
Log 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
|
||||
Log Create url Object3
|
||||
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00008 policyType=tsg_security
|
||||
@@ -236,12 +237,12 @@ Policy-Post-v2-00009
|
||||
... 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
|
||||
Log 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
|
||||
Log Create url Object3
|
||||
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00009 policyType=tsg_security
|
||||
@@ -265,12 +266,12 @@ Policy-Post-v2-00010
|
||||
... 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
|
||||
Log 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
|
||||
Log Create url Object3
|
||||
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00010 policyType=tsg_security
|
||||
@@ -293,12 +294,12 @@ Policy-Post-v2-00011
|
||||
... 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
|
||||
Log 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
|
||||
Log Create url Object3
|
||||
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00011 policyType=tsg_security
|
||||
@@ -316,60 +317,96 @@ Policy-Post-v2-00011
|
||||
${rescode} UpdatePolicies 1 ${policy} v2 disable
|
||||
Policy-Post-v1-00012
|
||||
Comment 创建IP
|
||||
${item1} Create Dictionary isSession=endpoint ip=192.168.32.32
|
||||
... port=80 direction=${0} protocol=${6} isInitialize=${0}
|
||||
${addItemList} Create List ${item1}
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1}
|
||||
... isInitialize=0
|
||||
... addItemList=range|192.168.41.68|192.168.41.68|0/0
|
||||
... addItemList=${addItemList}
|
||||
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId1}
|
||||
Log To Console Create IP Object
|
||||
Log Create IP Object
|
||||
Comment 更新IP
|
||||
${objectDict} Create Dictionary objectId=${objectId1} objectType=ip
|
||||
${rescode} UpdateObjects ${1} ${objectDict} disable
|
||||
Log To Console Create IP Object
|
||||
Log Create IP Object
|
||||
Policy-Post-v1-00013
|
||||
Comment 创建IP
|
||||
${item1} Create Dictionary isSession=endpoint ip=192.168.32.32
|
||||
... port=80 direction=${0} protocol=${6} isInitialize=${0}
|
||||
${addItemList} Create List ${item1}
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${0}
|
||||
... isInitialize=0
|
||||
... addItemList=range|192.168.41.68|192.168.41.68|0/0
|
||||
... addItemList=${addItemList}
|
||||
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId1}
|
||||
Log To Console Create IP Object
|
||||
Log Create IP Object
|
||||
${params} Create Dictionary objectId=${objectId1} itemType=ip
|
||||
${rescode} ${itemIds} ${itemList} GetObjectItems ${params}
|
||||
Log To Console ${itemIds}
|
||||
Log ${itemIds}
|
||||
Comment 更新IP
|
||||
FOR ${item} IN @{itemList}
|
||||
Set To Dictionary ${item} clientIp1 192.168.41.67
|
||||
Set To Dictionary ${item} clientIp2 192.168.41.67
|
||||
Remove From Dictionary ${item} isInitialize
|
||||
Set To Dictionary ${item} serverIp1 192.168.41.68
|
||||
Set To Dictionary ${item} serverIp2 192.168.41.68
|
||||
Set To Dictionary ${item} ip 192.168.41.67
|
||||
END
|
||||
Set To Dictionary ${addItemList[0]} itemId=${itemIds[0]}
|
||||
Remove From Dictionary ${addItemList[0]} isInitialize
|
||||
${objectDict} Create Dictionary objectId=${objectId1} objectType=ip
|
||||
... updateItemList=${itemList}
|
||||
... updateItemList=${addItemList}
|
||||
${rescode} UpdateObjects ${1} ${objectDict} update
|
||||
Log To Console Create IP Object
|
||||
Log Create IP Object
|
||||
Policy-Post-v1-00014
|
||||
Comment 创建urls
|
||||
${objectDict1} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com,
|
||||
${objectDict2} Create Dictionary objectType=url isValid=${1} addItemList=*google.com
|
||||
${objectDict} Create List ${objectDict1} ${objectDict2}
|
||||
${rescode} ${objectIds} AddObjects ${1} ${objectDict}
|
||||
|
||||
${item1} Create Dictionary keywordArray=*baidu.com isHexbin=${0}
|
||||
${item2} Create Dictionary keywordArray=*google.com isHexbin=${0}
|
||||
${addItemList} Create List ${item1}
|
||||
${addItemList1} Create List ${item2}
|
||||
${objectDict1} Create Dictionary objectType=url isValid=${1} addItemList=${addItemList}
|
||||
${objectDict2} Create Dictionary objectType=url isValid=${1} addItemList=${addItemList1}
|
||||
${objectList} Create List ${objectDict1} ${objectDict2}
|
||||
${rescode} ${objectIds} AddObjects ${1} ${objectList}
|
||||
Policy-Post-v1-00015
|
||||
Comment 创建urls
|
||||
${objectDict1} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com,*google.com
|
||||
${item1} Create Dictionary keywordArray=*baidu.com isHexbin=${0}
|
||||
${item2} Create Dictionary keywordArray=*google.com isHexbin=${0}
|
||||
${addItemList} Create List ${item1} ${item2}
|
||||
${objectDict1} Create Dictionary objectType=url isValid=${1} addItemList=${addItemList}
|
||||
${rescode} ${objectIds} AddObjects ${1} ${objectDict1}
|
||||
${params} Create Dictionary objectId=${objectIds} itemType=url
|
||||
${rescode} ${itemIds} ${itemList} GetObjectItems ${params}
|
||||
Log To Console ${itemIds}
|
||||
Log ${itemIds}
|
||||
Comment 修改urls
|
||||
${updateList} Create List *baidu.com* *baidu1.com*
|
||||
Set To Dictionary ${itemList}[0] keywordArray ${updateList}
|
||||
${addItem1} Create Dictionary keywordArray=*baidu.com* isHexbin=${0}
|
||||
${updateItem2} Create Dictionary keywordArray=*baidu1.com* isHexbin=${0} itemId=${itemIds[0]}
|
||||
${addItemList} Create List ${addItem1}
|
||||
${updateList} Create List ${updateItem2}
|
||||
|
||||
${objectDict} Create Dictionary objectId=${objectIds} objectType=url
|
||||
... addItemList=putty.com
|
||||
... updateItemList=${itemList}[0]
|
||||
... addItemList=${addItemList}
|
||||
... updateItemList=${updateList}
|
||||
... deleteItemIds=${itemIds}[1]
|
||||
${rescode} UpdateObjects ${1} ${objectDict} update
|
||||
${rescode} UpdateObjects ${1} ${objectDict} update
|
||||
Policy-Post-v1-00015-1
|
||||
Comment 创建http_signature
|
||||
${item1} Create Dictionary keywordArray=*baidu.com isHexbin=${0} district=Cookie isInitialize=0
|
||||
${item2} Create Dictionary keywordArray=*google.com isHexbin=${0} district=Content-Type
|
||||
${addItemList} Create List ${item1} ${item2}
|
||||
${objectDict1} Create Dictionary objectType=http_signature isValid=${1} addItemList=${addItemList}
|
||||
${rescode} ${objectIds} AddObjects ${1} ${objectDict1}
|
||||
${params} Create Dictionary objectId=${objectIds} itemType=http_signature
|
||||
${rescode} ${itemIds} ${itemList} GetObjectItems ${params}
|
||||
Log ${itemIds}
|
||||
Comment 修改urls
|
||||
${addItem1} Create Dictionary keywordArray=*baidu.com* isHexbin=${0} district=Cookie
|
||||
${updateItem2} Create Dictionary keywordArray=*baidu1.com* isHexbin=${0} itemId=${itemIds[0]} isInitialize=0
|
||||
${addItemList} Create List ${addItem1}
|
||||
${updateList} Create List ${updateItem2}
|
||||
|
||||
${objectDict} Create Dictionary objectId=${objectIds} objectType=http_signature
|
||||
... addItemList=${addItemList}
|
||||
... updateItemList=${updateList}
|
||||
... deleteItemIds=${itemIds}[1]
|
||||
${rescode} UpdateObjects ${1} ${objectDict} update
|
||||
Policy-Delete-v1-00016
|
||||
Comment 创建IP
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1}
|
||||
@@ -377,12 +414,12 @@ Policy-Delete-v1-00016
|
||||
... 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
|
||||
Log 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
|
||||
Log Create url Object3
|
||||
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00011 policyType=tsg_security
|
||||
@@ -405,12 +442,12 @@ Policy-Delete-v1-00017
|
||||
... 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
|
||||
Log 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
|
||||
Log Create url Object3
|
||||
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00011 policyType=tsg_security
|
||||
@@ -565,6 +602,8 @@ Policy-log-v1-00028
|
||||
${resData} QueryLogs ${params} batch
|
||||
Policy-Delete-v1-00029
|
||||
Comment 创建urls
|
||||
${addItem1} Create Dictionary
|
||||
${addItemList} Create List
|
||||
${objectDict1} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com,
|
||||
${objectDict2} Create Dictionary objectType=url isValid=${1} addItemList=*google.com
|
||||
${objectDict} Create List ${objectDict1} ${objectDict2}
|
||||
|
||||
Reference in New Issue
Block a user