fix:(v2版本策略)1:AddPolicies参数说明

2:v2版本主动防御支持
3:添加主动防御测试用例
This commit is contained in:
wangxin
2020-06-16 16:52:32 +08:00
parent b6cd16e91c
commit 8a41c0112b
3 changed files with 42 additions and 0 deletions

View File

@@ -42,6 +42,21 @@ AddPolicies
... returnData是否返回数据这里需要设置为1
... policyList策略列表支持dict与list两种形式
... version接口版本号
... 支持v1版本接口与v2版本接口
... v1版本特殊参数说明
... referenceObject=${265}|TSG_FIELD_HTTP_HOST,${266}|TSG_FIELD_SSL_SNI&TSG_FIELD_SSL_SAN
... 为字符串类型,每条引用的策略对象信息以','分隔
... [objectId]|[protocolFileds],... 多个protocolFileds用'&'连接
... appObjectIdArray==${2},${3}
... 为字符串类型,以','分隔
... v2版本特殊参数说明
... v2版本中无referenceObject取而代之的是sourcedestinationfilterList
... source= ${265}|TSG_FIELD_HTTP_HOST,${266}|TSG_FIELD_SSL_SNI&TSG_FIELD_SSL_SAN
... destination= ${265}|TSG_FIELD_HTTP_HOST,${266}|TSG_FIELD_SSL_SNI&TSG_FIELD_SSL_SAN
... filterList= ${265}|${257}:TSG_FIELD_HTTP_HOST,${266}|${299}:TSG_FIELD_SSL_SNI&TSG_FIELD_SSL_SAN
... filterList由多个数字用|分隔加上对上对应的protocolFiled,
... 一个filter中的protocolFiled是确定的一个protocolFiled对应多个objectId
... appIdObjects==${2},${3}
[Arguments] ${returnData} ${policyList} ${version}
Log To Console Call AddPolicies
${returnData}= Run Keyword If '${returnData}' == '${EMPTY}' Set Variable 1

View File

@@ -134,6 +134,11 @@ WxPolicyOrganize
${return} ${policyType} Run Keyword And Ignore Error Set Variable ${policy}[policyType]
Run Keyword If "${policyObjectVersion}"=="v1" and "${policyType}"=="active_defence" Set To Dictionary ${policy} referenceObject=${active_defence_emptyList}
Run Keyword If "${policyObjectVersion}"=="v1" and "${policyType}"=="active_defence" Set To Dictionary ${policy} appObjectIdArray=${active_defence_emptyList}
#v版本主动防御
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="active_defence" Set To Dictionary ${policy} source=${active_defence_emptyList}
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="active_defence" Set To Dictionary ${policy} destination=${active_defence_emptyList}
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="active_defence" Set To Dictionary ${policy} filterList=${active_defence_emptyList}
Run Keyword If "${policyObjectVersion}"=="v2" and "${policyType}"=="active_defence" Set To Dictionary ${policy} appIdObjects=${active_defence_emptyList}
# 转为json结构并返回
${json} json.Dumps ${policy} ensure_ascii=False
${json} Replace String ${json} "method:rst" ${userRegion}