diff --git a/01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot b/01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot index e284a87..8c22e40 100644 --- a/01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot +++ b/01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot @@ -593,7 +593,15 @@ Policy-Statistics-v1-00035 Comment 策略统计 ${objectIds} Set Variable ${EMPTY} ${response} StatisticsPolicies -Policy-ProtocolFields-v1-00035 +Policy-ProtocolFields-v1-00036 Comment 策略对象生效协议字段查询 ${objectIds} Set Variable ${EMPTY} - ${response} PolicProtocolFields tsg_security ${EMPTY} ip \ No newline at end of file + ${response} PolicProtocolFields tsg_security ${EMPTY} ip +Object-Reference-v1-00037 + Comment 策略对象生效协议字段查询 + ${objectIds} Set Variable ${EMPTY} + ${response} ObjectReference 174 +Object-AppIDTree-v1-00038 + Comment 策略对象生效协议字段查询 + ${objectIds} Set Variable ${EMPTY} + ${response} AppIdTreeSearch 174 \ No newline at end of file diff --git a/02-Keyword/tsg_bfapi/policy_object/Object.robot b/02-Keyword/tsg_bfapi/policy_object/Object.robot index 67cd4bc..7b39309 100644 --- a/02-Keyword/tsg_bfapi/policy_object/Object.robot +++ b/02-Keyword/tsg_bfapi/policy_object/Object.robot @@ -199,4 +199,20 @@ PolicProtocolFields ${response} BaseFormRequest ${objectUrl}/protocolFields ${parmStr} ${version} ${rescode} Set Variable ${response['code']} Should Be Equal As Strings ${rescode} 200 + [Return] ${response['data']} +ObjectReference + [Documentation] + ... 策略对象相关性查询 + [Arguments] ${objectId} + ${response} BaseFormRequest ${objectUrl}/reference objectId=${objectId} ${version} + ${rescode} Set Variable ${response['code']} + Should Be Equal As Strings ${rescode} 200 + [Return] ${response['data']} +AppIdTreeSearch + [Documentation] + ... App ID对象树查询 + [Arguments] ${referenceObjectId} + ${response} BaseFormRequest ${objectUrl}/appId/tree referenceObjectId=${referenceObjectId} ${version} + ${rescode} Set Variable ${response['code']} + Should Be Equal As Strings ${rescode} 200 [Return] ${response['data']} \ No newline at end of file diff --git a/02-Keyword/tsg_common/ManagePolicyBody.robot b/02-Keyword/tsg_common/ManagePolicyBody.robot index e185aa1..073d144 100644 --- a/02-Keyword/tsg_common/ManagePolicyBody.robot +++ b/02-Keyword/tsg_common/ManagePolicyBody.robot @@ -4,7 +4,15 @@ Library Collections Resource ../../03-Variable/BifangApiVariable.txt Resource ../../03-Variable/PolicyObjectDefault.txt Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot - +*** Variables *** +#arraySplitor:数组元素之间的分隔符 +${arraySplitor} , +#protocolFiledSplitor:protocolFiled之间的分隔符 +${protocolFiledSplitor} & +#objectIdSplitor:objectId之间的分隔符 +${objectIdSplitor} : +#idFiledSplitor: objectId和protocolFiled之间的分隔符 +${idFiledSplitor} | *** Keywords *** # ... 特殊参数说明: # ... effectiveRange=Nursurtan|Transtelecom&Astel,Almaty&Nursurtan,|Astel&Transtelecom @@ -243,12 +251,12 @@ AnalysisReferenceObject # 解析引用对象 [Arguments] ${referenceObject} ${objList} Create List - ${list} Evaluate re.split('[,]', '${referenceObject}') re + ${list} Evaluate re.split('[${arraySplitor}]', '${referenceObject}') re FOR ${var} IN @{list} ${emptyList} Create List ${emptyObj} Create Dictionary - ${key} Evaluate '${var}'[0:'${var}'.find('|')] - ${values} Evaluate '${var}'['${var}'.find('|')+1:] + ${key} Evaluate '${var}'[0:'${var}'.find('${idFiledSplitor}')] + ${values} Evaluate '${var}'['${var}'.find('${idFiledSplitor}')+1:] ${valueList} InnerForEach ${values} ${key} Run Keyword If '${key}'.isdigit() Evaluate int('${key}') ... ELSE Set Variable ${key} @@ -262,7 +270,7 @@ InnerForEach # 循环嵌套 [Arguments] ${values} ${emptyList} Create List - ${list} Evaluate re.split('[&]', '${values}') re + ${list} Evaluate re.split('[${protocolFiledSplitor}]', '${values}') re FOR ${var} IN @{list} Append To List ${emptyList} ${var} END