diff --git a/01-TestCase/tsg_adc/api_proxy/RedirectSSLTests.robot b/01-TestCase/tsg_adc/api_proxy/RedirectSSLTests.robot index 677c084..2bbc5f9 100644 --- a/01-TestCase/tsg_adc/api_proxy/RedirectSSLTests.robot +++ b/01-TestCase/tsg_adc/api_proxy/RedirectSSLTests.robot @@ -187,7 +187,7 @@ ProxyPolicy-Redirect-ssl-00007 #${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00007.bat #${commandstr} set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.gamersky.com/news/ ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00007.bat - ... ELSE set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00007.bat + ... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.gamersky.com/news/ ${stringlist} Create List Tango Secure Gateway CA Host: www.gamersky.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 301 Moved Permanently Location: http://video.cnfol.com/wptzj/ ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s diff --git a/01-TestCase/tsg_adc/selfserver/SelfServerDenyAllTests.robot b/01-TestCase/tsg_adc/selfserver/SelfServerDenyAllTests.robot index 9a33f3c..2e673a4 100644 --- a/01-TestCase/tsg_adc/selfserver/SelfServerDenyAllTests.robot +++ b/01-TestCase/tsg_adc/selfserver/SelfServerDenyAllTests.robot @@ -50,13 +50,14 @@ SelfServerSecurityPolicy-Deny-AllProtol-00001 ... policyDesc=${Default_PolicyDesc} ... action=deny ... effectiveRange=${Default_EffectiveRange} - ... userRegion=${Default_UserRegion} + ... userRegion=method:rst ... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR ... isValid=${Default_IsValid} ... appObjectIdArray=${Default_AppObjectIdArray} ... userTags=${Default_UserTags} ... doLog=${Default_DoLog} ... scheduleId=${Default_ScheduleId} + #默认客户端条件类型:clientip or clientsubid ${Default_Client_Type} ${rescode} ${policyId} AddPolicy2 ${1} ${policyDict} ${s} Convert to String ${policyId} ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]} diff --git a/02-Keyword/tsg_bfapi/PolicyObject.robot b/02-Keyword/tsg_bfapi/PolicyObject.robot index 6a8da11..f3c47b0 100644 --- a/02-Keyword/tsg_bfapi/PolicyObject.robot +++ b/02-Keyword/tsg_bfapi/PolicyObject.robot @@ -167,4 +167,6 @@ DeletePolicyAndObject log todeleteobj_DeletePolicyAndObject DeleteObject ${objectids} - +DeleteAfterCase + [Arguments] ${policyids} ${objectids} + Run Keyword If '${testPart}'=='all' or '${testPart}'=='3' DeletePolicyAndObject ${policyids} ${objectids} diff --git a/02-Keyword/tsg_common/ManagePolicyBody.robot b/02-Keyword/tsg_common/ManagePolicyBody.robot index 4356205..24a53c9 100644 --- a/02-Keyword/tsg_common/ManagePolicyBody.robot +++ b/02-Keyword/tsg_common/ManagePolicyBody.robot @@ -183,8 +183,14 @@ AnalysisUserRegion ManageReferenceObject # 处理引用对象字符串 [Arguments] ${policyList} - ${emptyList} Create List - Run Keyword If '${addTestClentIPFlag}'=='1' ManageClientObject ${emptyList} + ${emptyList} Create List + #默认客户端条件类型:clientip or clientsubid + ${return} ${defaultClient} Run Keyword And Ignore Error Set Variable ${policyList}[defalutClient] + ${defaultClient} Run Keyword If "${return}"=="FAIL" or "${defaultClient}"=="${EMPTY}" Set Variable ${Default_Client_Type} + ... ELSE Set Variable ${defaultClient} + Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient}'=='clientip' ManageClientIPObject ${emptyList} + Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient}'=='clientsubid' ManageClientSubIDObject ${emptyList} + #Run Keyword If '${addTestClentIPFlag}'=='1' ManageClientObject ${emptyList} # Run Keyword If "${clientHostObj}"!="${None}" Append To List ${emptyList} ${clientHostObj} ${defaultObj} Create Dictionary @@ -199,7 +205,7 @@ ManageReferenceObject END Set To Dictionary ${policyList} referenceObject=${emptyList} -ManageClientObject +ManageClientIPObject [Arguments] ${emptyList} # 增加引用测试终端IP策略对象 ${list1} Create List TSG_SECURITY_SOURCE_ADDR @@ -208,7 +214,12 @@ ManageClientObject # ${list2} Create List null # ${obj2} Create Dictionary objectId=${testClentSubID} protocolFields=${list2} # Append To List ${emptyList} ${obj2} - +ManageClientSubIDObject + [Arguments] ${emptyList} + # 增加引用测试终端IP策略对象 + ${list1} Create List + ${obj1} Create Dictionary objectId=${testClentSubID} protocolFields=${list1} + Append To List ${emptyList} ${obj1} AnalysisReferenceObject # 解析引用对象 diff --git a/03-Variable/PolicyObjectDefault.txt b/03-Variable/PolicyObjectDefault.txt index fb643c2..c49dbdc 100644 --- a/03-Variable/PolicyObjectDefault.txt +++ b/03-Variable/PolicyObjectDefault.txt @@ -35,4 +35,6 @@ ${Default_AddItem_IsHexbin} ${0} ${Default_AddItem_IsInitialize} ${0} ${Default_AddItem_ItemName} ${EMPTY} ${Default_AddItem_ItemDesc} ${EMPTY} +#默认客户端条件类型:clientip or clientsubid +${Default_Client_Type} clientip