From 4f59e521deeac086513d6ce3176495d0d063869c Mon Sep 17 00:00:00 2001 From: hebingning Date: Tue, 2 Feb 2021 20:43:50 +0800 Subject: [PATCH] =?UTF-8?q?redirect=E7=94=A8=E4=BE=8B=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E4=B8=8E=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tsg_adc/multi_step/a_Redirect_Tests.robot | 52 ++++++++--- .../tsg_adc/multi_step/b_Redirect_Tests.robot | 89 +++++++++++++++---- .../tsg_adc/multi_step/c_Redirect_Tests.robot | 15 ++-- .../command/ProxyPolicy_redirect_00002.bat | 2 +- .../command/ProxyPolicy_redirect_00006.bat | 2 +- .../command/ProxyPolicy_redirect_00014.bat | 2 +- .../command/ProxyPolicy_redirect_00015.bat | 2 +- 7 files changed, 128 insertions(+), 36 deletions(-) diff --git a/01-TestCase/tsg_adc/multi_step/a_Redirect_Tests.robot b/01-TestCase/tsg_adc/multi_step/a_Redirect_Tests.robot index 6b7e45c..b715243 100644 --- a/01-TestCase/tsg_adc/multi_step/a_Redirect_Tests.robot +++ b/01-TestCase/tsg_adc/multi_step/a_Redirect_Tests.robot @@ -10,13 +10,21 @@ Resource ../../../03-Variable/ApplicationID.txt *** Test Cases *** Proxy-Policy-redirect-00001 - [Tags] fqdn完整匹配 + [Tags] fqdn完整匹配 update policy:ip geo,fqdn Comment 创建fqdn ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$tudou.com ${rescode} ${objectId} AddObject2 ${1} ${objectDict} Comment 创建url ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=tudou ${rescode} ${objectId1} AddObject2 ${1} ${objectDict} + Comment 创建ip geo + ${addItemList1} Create Dictionary keywordArray=XXG地区.* + ${addItemLists} Create list ${addItemList1} + ${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists} + ${rescode} ${objectId2} AddObjects ${1} ${objectDict} + Comment 创建fqdn2 + ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*tudou.com + ${rescode} ${objectId3} AddObject2 ${1} ${objectDict} Comment 创建拦截策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} log ${policyDict} @@ -31,17 +39,22 @@ Proxy-Policy-redirect-00001 ${policyId2} Set Variable ${policyId2}[0] insert_policyId_to_file1 redirect_objectId ${objectId} insert_policyId_to_file1 redirect_objectId44 ${objectId1} + insert_policyId_to_file1 redirect_objectId48 ${objectId2} + insert_policyId_to_file1 redirect_objectId49 ${objectId3} insert_policyId_to_file1 intercept_redirect_policyId ${policyId1} insert_policyId_to_file1 redirect_policyId ${policyId2} Proxy-Policy-redirect-00002 - [Tags] cat右匹配 + [Tags] cat右匹配 update policy:url Comment 创建fqdn # ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*vystarcu.org # ${rescode} ${objectId} AddObject2 ${1} ${objectDict} Comment 创建url - ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.cornetbier.be/ + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=glazok.kz ${rescode} ${objectId1} AddObject2 ${1} ${objectDict} + Comment 创建url2 + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*glazok.kz + ${rescode} ${objectId2} AddObject2 ${1} ${objectDict} Comment Comment 创建拦截策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=101|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} log ${policyDict} @@ -56,6 +69,7 @@ Proxy-Policy-redirect-00002 ${policyId2} Set Variable ${policyId2}[0] #insert_policyId_to_file1 redirect_objectId1 ${objectId} insert_policyId_to_file1 redirect_objectId45 ${objectId1} + insert_policyId_to_file1 redirect_objectId50 ${objectId2} insert_policyId_to_file1 intercept_redirect_policyId1 ${policyId1} insert_policyId_to_file1 redirect_policyId1 ${policyId2} @@ -65,10 +79,10 @@ Proxy-Policy-redirect-00003 # ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*secure.uwcu.org,*cit.com,*alaskausa.org,*tradingtechnologies.com # ${rescode} ${objectId} AddObject2 ${1} ${objectDict} Comment 创建url - ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.sail-croatia*,$www.pagemillwinery.com/,nwrassn.org,poetrysoup + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.shrunke*,$mytinyurl.net/,*hugedomains.com,sg.sgness.click ${rescode} ${objectId1} AddObject2 ${1} ${objectDict} Comment Comment 创建拦截策略 - ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=109|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} + ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=164|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} log ${policyDict} ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2 ${policyId1} Get-Pids ${policyId1} @@ -85,7 +99,7 @@ Proxy-Policy-redirect-00003 insert_policyId_to_file1 redirect_policyId2 ${policyId2} Proxy-Policy-redirect-00004 - [Tags] 请求头左匹配 + [Tags] 请求头左匹配 update policy:请求头 Comment 创建fqdn ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*merrilledge.com ${rescode} ${objectId} AddObject2 ${1} ${objectDict} @@ -95,6 +109,9 @@ Proxy-Policy-redirect-00004 Comment 创建请求头 ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent ${rescode} ${objectId2} AddObject2 ${1} ${objectDict} + Comment 创建请求头2 + ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0|User-Agent + ${rescode} ${objectId3} AddObject2 ${1} ${objectDict} Comment 创建拦截策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} log ${policyDict} @@ -110,6 +127,7 @@ Proxy-Policy-redirect-00004 insert_policyId_to_file1 redirect_objectId4 ${objectId} insert_policyId_to_file1 redirect_objectId5 ${objectId1} insert_policyId_to_file1 redirect_objectId6 ${objectId2} + insert_policyId_to_file1 redirect_objectId51 ${objectId3} insert_policyId_to_file1 intercept_redirect_policyId3 ${policyId1} insert_policyId_to_file1 redirect_policyId3 ${policyId2} @@ -145,10 +163,10 @@ Proxy-Policy-redirect-00005 Proxy-Policy-redirect-00006 [Tags] 请求头字串匹配 Comment 创建fqdn - ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.uwcu.org + ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.dota2.com.cn ${rescode} ${objectId} AddObject2 ${1} ${objectDict} Comment 创建url - ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=about-us/become-a-member/ + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=dota2 ${rescode} ${objectId1} AddObject2 ${1} ${objectDict} Comment 创建请求头 ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=AppleWebKit|User-Agent @@ -201,7 +219,7 @@ Proxy-Policy-redirect-00007 insert_policyId_to_file1 redirect_policyId6 ${policyId2} Proxy-Policy-redirect-00008 - [Tags] 应答头右匹配 + [Tags] 应答头右匹配 update policy:应答头 Comment 创建fqdn ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*essence.com.cn ${rescode} ${objectId} AddObject2 ${1} ${objectDict} @@ -211,6 +229,9 @@ Proxy-Policy-redirect-00008 Comment 创建请求头 ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type ${rescode} ${objectId2} AddObject2 ${1} ${objectDict} + Comment 创建请求头2 + ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=utf-8|Content-Type + ${rescode} ${objectId3} AddObject2 ${1} ${objectDict} Comment Comment 创建拦截策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} log ${policyDict} @@ -226,6 +247,7 @@ Proxy-Policy-redirect-00008 insert_policyId_to_file1 redirect_objectId16 ${objectId} insert_policyId_to_file1 redirect_objectId17 ${objectId1} insert_policyId_to_file1 redirect_objectId18 ${objectId2} + insert_policyId_to_file1 redirect_objectId52 ${objectId3} insert_policyId_to_file1 intercept_redirect_policyId7 ${policyId1} insert_policyId_to_file1 redirect_policyId7 ${policyId2} @@ -375,7 +397,7 @@ Proxy-Policy-redirect-00013 insert_policyId_to_file1 redirect_policyId12 ${policyId2} Proxy-Policy-redirect-00014 - [Tags] 请求体字串匹配 + [Tags] 请求体字串匹配,update policy:请求体 Comment 创建请求体 ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=lksdf ${rescode} ${objectId} AddObject2 ${1} ${objectDict} @@ -385,6 +407,12 @@ Proxy-Policy-redirect-00014 Comment 创建url ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=action ${rescode} ${objectId2} AddObject2 ${1} ${objectDict} + Comment 创建请求体 + ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=lksdf + ${rescode} ${objectId3} AddObject2 ${1} ${objectDict} + Comment 创建请求体2 + ${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=testredirect0014 + ${rescode} ${objectId4} AddObject2 ${1} ${objectDict} Comment 创建拦截策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-redirect policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} log ${policyDict} @@ -392,7 +420,7 @@ Proxy-Policy-redirect-00014 ${policyId1} Get-Pids ${policyId1} ${policyId1} Set Variable ${policyId1}[0] Comment 创建redirect策略 - ${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00014 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} + ${policyDict} Create Dictionary policyName=Proxy-Policy-redirect-00014 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${objectId3}|TSG_FIELD_HTTP_REQ_CONTENT,${objectId2}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} log ${policyDict} ${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2 ${policyId2} Get-Pids ${policyId2} @@ -400,6 +428,8 @@ Proxy-Policy-redirect-00014 insert_policyId_to_file1 redirect_objectId33 ${objectId} insert_policyId_to_file1 redirect_objectId34 ${objectId1} insert_policyId_to_file1 redirect_objectId47 ${objectId2} + insert_policyId_to_file1 redirect_objectId53 ${objectId3} + insert_policyId_to_file1 redirect_objectId54 ${objectId4} insert_policyId_to_file1 intercept_redirect_policyId13 ${policyId1} insert_policyId_to_file1 redirect_policyId13 ${policyId2} diff --git a/01-TestCase/tsg_adc/multi_step/b_Redirect_Tests.robot b/01-TestCase/tsg_adc/multi_step/b_Redirect_Tests.robot index ba8bffc..70b5f79 100644 --- a/01-TestCase/tsg_adc/multi_step/b_Redirect_Tests.robot +++ b/01-TestCase/tsg_adc/multi_step/b_Redirect_Tests.robot @@ -5,6 +5,9 @@ Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot Resource ../../../02-Keyword/tsg_adc/FileOperation.robot +Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot +Resource ../../../03-Variable/ApplicationID.txt +Resource ../../../05-Other/AllFlowCaseVariable.txt *** Test Cases *** Proxy-Policy-redirect-00001 @@ -14,37 +17,61 @@ Proxy-Policy-redirect-00001 ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} - -Proxy-Policy-redirect-00002 + Comment 改变拦截策略 + ${policyDict} Create Dictionary policyId=${intercept_redirect_policyId} source=${redirect_objectId48}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Intercept-redirect-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${redirect_objectId49}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + Comment 改变重定向策略 + ${policyDict} Create Dictionary policyId=${redirect_policyId} source=${redirect_objectId48}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-redirect-00001-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${redirect_objectId49}|TSG_FIELD_HTTP_HOST,${redirect_objectId44}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update Comment 功能端验证HTTP验证 - ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00002.bat - ... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.cornetbier.be/ + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00001.bat + ... ELSE set variable curl -kv https://tudou.com/ ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} - + +Proxy-Policy-redirect-00002 + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00002.bat + ... ELSE set variable curl -kv https://glazok.kz/ + ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA + ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA + ${rescode} SystemCommands ${commandstr} ${stringlist} + Comment 改变重定向策略 + ${policyDict} Create Dictionary policyId=${redirect_policyId1} policyName=Proxy-Policy-redirect-00002-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=101|TSG_FIELD_HTTP_HOST,${redirect_objectId50}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00002.bat + ... ELSE set variable curl -kv https://glazok.kz/ + ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA + ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA + ${rescode} SystemCommands ${commandstr} ${stringlist} + Proxy-Policy-redirect-00003 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00003.bat - ... ELSE set variable curl -kv https://www.sail-croatia.com/ + ... ELSE set variable curl -kv https://mytinyurl.net/ ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00003_1.bat - ... ELSE set variable curl -kv https://www.pagemillwinery.com + ... ELSE set variable curl -kv https://www.hugedomains.com/ ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00003_2.bat - ... ELSE set variable curl -kv https://www.retrowdw.com/ + ... ELSE set variable curl -kv https://www.shrunken.com/ ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00003_3.bat - ... ELSE set variable curl -kv https://www.hugedomains.com/domain_profile.cfm?d=moonvalleyoutfitters&e=com + ... ELSE set variable curl -kv https://sg.sgness.click/ ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} @@ -56,7 +83,17 @@ Proxy-Policy-redirect-00004 ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} - + Comment 改变重定向策略 + ${policyDict} Create Dictionary policyId=${redirect_policyId3} policyName=Proxy-Policy-redirect-00004-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${redirect_objectId5}|TSG_FIELD_HTTP_URL,${redirect_objectId51}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00004.bat + ... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.merrilledge.com/investing/online-trading + ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA + ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA + ${rescode} SystemCommands ${commandstr} ${stringlist} + Proxy-Policy-redirect-00005 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00005.bat @@ -68,9 +105,9 @@ Proxy-Policy-redirect-00005 Proxy-Policy-redirect-00006 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00006.bat - ... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.uwcu.org/about-us/become-a-member/ - ${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset - ... ELSE Create List Connection was reset + ... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.dota2.com.cn/index.htm + ${stringlist} run keyword if '${systemType}'=='Windows' Create List https://yhd.com Tango Secure Gateway CA + ... ELSE Create List https://yhd.com Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} Proxy-Policy-redirect-00007 @@ -88,6 +125,10 @@ Proxy-Policy-redirect-00008 ${stringlist} run keyword if '${systemType}'=='Windows' Create List https://yhd.com ... ELSE Create List https://yhd.com ${rescode} SystemCommands ${commandstr} ${stringlist} + Comment 改变重定向策略 + ${policyDict} Create Dictionary policyId=${redirect_policyId7} policyName=Proxy-Policy-redirect-00008-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"https://yhd.com","code":302,"protocol":"HTTP"} filterList=${redirect_objectId17}|TSG_FIELD_HTTP_URL,${redirect_objectId52}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update Proxy-Policy-redirect-00009 Comment 功能端验证HTTP验证 @@ -137,12 +178,18 @@ Proxy-Policy-redirect-00013 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00013_2.bat ... ELSE set variable curl -kv https://expediapartnersolutions.com/about/our-supply + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00013_2.bat + ... ELSE set variable curl -kv https://expediapartnersolutions.com/about/our-supply ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00013_3.bat ... ELSE set variable curl -kv https://www.tripadvisor.com/Attractions-g60763-Activities-New_York_City_New_York.html + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00013_3.bat + ... ELSE set variable curl -kv https://www.tripadvisor.com/Attractions-g60763-Activities-New_York_City_New_York.html ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ... ELSE Create List http://www.iceo.com.cn/renwu2013/ Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} @@ -150,15 +197,25 @@ Proxy-Policy-redirect-00013 Proxy-Policy-redirect-00014 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00014.bat - ... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=lksdf&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" -kv \ http://open.node.com/action + ... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=lksdf&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" -kv \ http://open.node.com/go ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ ... ELSE Create List http://www.iceo.com.cn/renwu2013/ ${rescode} SystemCommands ${commandstr} ${stringlist} - + Comment 改变重定向策略 + ${policyDict} Create Dictionary policyId=${redirect_policyId13} policyName=Proxy-Policy-redirect-00014-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"redirect","to":"http://www.iceo.com.cn/renwu2013/","code":302,"protocol":"HTTP"} filterList=${redirect_objectId54}|TSG_FIELD_HTTP_REQ_CONTENT,${redirect_objectId47}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00014.bat + ... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=testredirect0014&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" -kv \ http://open.node.com/go + ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ + ... ELSE Create List http://www.iceo.com.cn/renwu2013/ + ${rescode} SystemCommands ${commandstr} ${stringlist} + Proxy-Policy-redirect-00015 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_redirect_00015.bat - ... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=tyuiop&contentType=content-type&resBody=adzx" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com/action + ... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "reqBody=tyuiop&contentType=content-type&resBody=adzx" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com/action ${stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.iceo.com.cn/renwu2013/ ... ELSE Create List http://www.iceo.com.cn/renwu2013/ ${rescode} SystemCommands ${commandstr} ${stringlist} diff --git a/01-TestCase/tsg_adc/multi_step/c_Redirect_Tests.robot b/01-TestCase/tsg_adc/multi_step/c_Redirect_Tests.robot index b50bb77..2bf7e63 100644 --- a/01-TestCase/tsg_adc/multi_step/c_Redirect_Tests.robot +++ b/01-TestCase/tsg_adc/multi_step/c_Redirect_Tests.robot @@ -18,23 +18,25 @@ Proxy-Policy-redirect-00001 #删除对象 ${objectids} set Variable ${redirect_objectId} ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId44} + ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId48} + ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId49} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_redirect_policyId}]} ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${redirect_policyId}]} ${policyIds} Create List ${policyId1} ${policyId2} ${s} Convert to String ${redirect_policyId} - GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host quote.com + GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host tudou.com Proxy-Policy-redirect-00002 #删除对象 - #${objectids} set Variable ${redirect_objectId1} - ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId45} + ${objectids} set Variable ${redirect_objectId45} + ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId50} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_redirect_policyId1}]} ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${redirect_policyId1}]} ${policyIds} Create List ${policyId1} ${policyId2} ${s} Convert to String ${redirect_policyId1} - GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.capdagdefrance.co.uk + GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host glazok.kz Proxy-Policy-redirect-00003 #删除对象 @@ -55,6 +57,7 @@ Proxy-Policy-redirect-00004 ${objectids} set Variable ${redirect_objectId4} ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId5} ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId6} + ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId51} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_redirect_policyId3}]} ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${redirect_policyId3}]} @@ -84,7 +87,7 @@ Proxy-Policy-redirect-00006 ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${redirect_policyId5}]} ${policyIds} Create List ${policyId1} ${policyId2} ${s} Convert to String ${redirect_policyId5} - GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.uwcu.org + GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.dota2.com Proxy-Policy-redirect-00007 #删除对象 @@ -178,6 +181,8 @@ Proxy-Policy-redirect-00014 ${objectids} set Variable ${redirect_objectId33} ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId34} ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId47} + ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId53} + ${objectids} Catenate SEPARATOR=, ${objectids} ${redirect_objectId54} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_redirect_policyId13}]} ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${redirect_policyId13}]} diff --git a/05-Other/curl/command/ProxyPolicy_redirect_00002.bat b/05-Other/curl/command/ProxyPolicy_redirect_00002.bat index 056cac3..f4f92ee 100644 --- a/05-Other/curl/command/ProxyPolicy_redirect_00002.bat +++ b/05-Other/curl/command/ProxyPolicy_redirect_00002.bat @@ -1 +1 @@ -curl -kv https://www.cornetbier.be/ | iconv -f utf-8 -t gbk \ No newline at end of file +curl -kv https://glazok.kz/ | iconv -f utf-8 -t gbk \ No newline at end of file diff --git a/05-Other/curl/command/ProxyPolicy_redirect_00006.bat b/05-Other/curl/command/ProxyPolicy_redirect_00006.bat index d0dfbba..0502f5b 100644 --- a/05-Other/curl/command/ProxyPolicy_redirect_00006.bat +++ b/05-Other/curl/command/ProxyPolicy_redirect_00006.bat @@ -1 +1 @@ -curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.uwcu.org/about-us/become-a-member/ | iconv -f utf-8 -t gbk \ No newline at end of file +curl -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'https://www.baidu.com/' https://www.dota2.com.cn/index.htm | iconv -f utf-8 -t gbk \ No newline at end of file diff --git a/05-Other/curl/command/ProxyPolicy_redirect_00014.bat b/05-Other/curl/command/ProxyPolicy_redirect_00014.bat index 13782c4..f6cf65b 100644 --- a/05-Other/curl/command/ProxyPolicy_redirect_00014.bat +++ b/05-Other/curl/command/ProxyPolicy_redirect_00014.bat @@ -1 +1 @@ -curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=lksdf&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" -kv http://open.node.com/action | iconv -f utf-8 -t gbk \ No newline at end of file +curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=lksdf&setCookie=kjhsxbn&contentType=content-type&resBody=opijn" -kv http://open.node.com/go | iconv -f utf-8 -t gbk \ No newline at end of file diff --git a/05-Other/curl/command/ProxyPolicy_redirect_00015.bat b/05-Other/curl/command/ProxyPolicy_redirect_00015.bat index 789ce26..ae20bda 100644 --- a/05-Other/curl/command/ProxyPolicy_redirect_00015.bat +++ b/05-Other/curl/command/ProxyPolicy_redirect_00015.bat @@ -1 +1 @@ -curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=tyuiop&setCookie=asdf&contentType=content-type&resBody=adzx" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com/action | iconv -f utf-8 -t gbk \ No newline at end of file +curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=tyuiop&setCookie=asdf&contentType=content-type&resBody=adzx" -kv --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" --referer 'http://www.baidu.com/' http://open.node.com/go | iconv -f utf-8 -t gbk \ No newline at end of file