From a0d66edfd0e19a848b3fdcb91469c85d81cf37b1 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Tue, 21 Apr 2020 13:30:41 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E9=87=8D=E5=AE=9A?= =?UTF-8?q?=E5=90=91=E4=B8=8D=E5=90=8C=E6=93=8D=E4=BD=9C=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=87=E4=BB=B6=EF=BC=9B=202=E3=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E6=97=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E6=9C=BAIP=E6=88=96subid?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tsg_adc/api_proxy/RedirectSSLTests.robot | 2 +- .../selfserver/SelfServerDenyAllTests.robot | 3 ++- 02-Keyword/tsg_bfapi/PolicyObject.robot | 4 +++- 02-Keyword/tsg_common/ManagePolicyBody.robot | 19 +++++++++++++++---- 03-Variable/PolicyObjectDefault.txt | 2 ++ 5 files changed, 23 insertions(+), 7 deletions(-) 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