diff --git a/01-TestCase/tsg_adc/multi_step/a_Replace_Tests.robot b/01-TestCase/tsg_adc/multi_step/a_Replace_Tests.robot index 24c4b12..1312741 100644 --- a/01-TestCase/tsg_adc/multi_step/a_Replace_Tests.robot +++ b/01-TestCase/tsg_adc/multi_step/a_Replace_Tests.robot @@ -10,15 +10,23 @@ Resource ../../../03-Variable/ApplicationID.txt *** Test Cases *** Proxy-Policy-replace-00001 - [Tags] fqdn完整匹配 + [Tags] fqdn完整匹配 update policy:ip source ,fqdn, replace content:resp_body Comment 创建fqdn ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$destidotcom.wordpress.com ${rescode} ${objectId} AddObject2 ${1} ${objectDict} Comment 创建url ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=wordpress.com/contact/ ${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=*destidotcom.wordpress.com + ${rescode} ${objectId3} AddObject2 ${1} ${objectDict} Comment Comment 创建拦截策略 - ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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} + ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace01 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} ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2 ${policyId1} Get-Pids ${policyId1} @@ -31,19 +39,24 @@ Proxy-Policy-replace-00001 ${policyId2} Set Variable ${policyId2}[0] insert_policyId_to_file1 replace_objectId ${objectId} insert_policyId_to_file1 replace_objectId39 ${objectId1} + insert_policyId_to_file1 replace_objectId42 ${objectId2} + insert_policyId_to_file1 replace_objectId43 ${objectId3} insert_policyId_to_file1 intercept_replace_policyId ${policyId1} insert_policyId_to_file1 replace_policyId ${policyId2} Proxy-Policy-replace-00002 - [Tags] cat右匹配 + [Tags] cat右匹配 update policy:url, replace content:http_req_uri Comment 创建fqdn - # ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*trip.com - # ${rescode} ${objectId} AddObject2 ${1} ${objectDict} + ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*plishsplash.com + ${rescode} ${objectId} AddObject2 ${1} ${objectDict} Comment 创建url ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.splishsplash.com ${rescode} ${objectId1} AddObject2 ${1} ${objectDict} + Comment 创建url2 + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*shsplash.com + ${rescode} ${objectId2} AddObject2 ${1} ${objectDict} Comment Comment 创建拦截策略 - ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace 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-replace 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,${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} log ${policyDict} ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2 ${policyId1} Get-Pids ${policyId1} @@ -54,8 +67,9 @@ Proxy-Policy-replace-00002 ${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2 ${policyId2} Get-Pids ${policyId2} ${policyId2} Set Variable ${policyId2}[0] - #insert_policyId_to_file1 replace_objectId1 ${objectId} + insert_policyId_to_file1 replace_objectId1 ${objectId} insert_policyId_to_file1 replace_objectId40 ${objectId1} + insert_policyId_to_file1 replace_objectId44 ${objectId2} insert_policyId_to_file1 intercept_replace_policyId1 ${policyId1} insert_policyId_to_file1 replace_policyId1 ${policyId2} @@ -85,7 +99,7 @@ Proxy-Policy-replace-00003 insert_policyId_to_file1 replace_policyId2 ${policyId2} Proxy-Policy-replace-00004 - [Tags] 请求头左匹配 + [Tags] 请求头左匹配 update policy:请求头,replace content:http_resp_header Comment 创建fqdn ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*ino.com ${rescode} ${objectId} AddObject2 ${1} ${objectDict} @@ -95,6 +109,9 @@ Proxy-Policy-replace-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-replace 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-replace-00004 insert_policyId_to_file1 replace_objectId4 ${objectId} insert_policyId_to_file1 replace_objectId5 ${objectId1} insert_policyId_to_file1 replace_objectId6 ${objectId2} + insert_policyId_to_file1 replace_objectId45 ${objectId3} insert_policyId_to_file1 intercept_replace_policyId3 ${policyId1} insert_policyId_to_file1 replace_policyId3 ${policyId2} @@ -201,7 +219,7 @@ Proxy-Policy-replace-00007 insert_policyId_to_file1 replace_policyId6 ${policyId2} Proxy-Policy-replace-00008 - [Tags] 应答头右匹配 + [Tags] 应答头右匹配 update policy:应答头,replace content:http_resp_header Comment 创建fqdn ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*www.ghzq.com.cn ${rescode} ${objectId} AddObject2 ${1} ${objectDict} @@ -211,8 +229,11 @@ Proxy-Policy-replace-00008 Comment 创建请求头 ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type ${rescode} ${objectId2} AddObject2 ${1} ${objectDict} + Comment 创建请求头2 + ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type + ${rescode} ${objectId3} AddObject2 ${1} ${objectDict} Comment Comment 创建拦截策略 - ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} + ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace08 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} log ${policyDict} ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2 ${policyId1} Get-Pids ${policyId1} @@ -226,22 +247,23 @@ Proxy-Policy-replace-00008 insert_policyId_to_file1 replace_objectId16 ${objectId} insert_policyId_to_file1 replace_objectId17 ${objectId1} insert_policyId_to_file1 replace_objectId18 ${objectId2} + insert_policyId_to_file1 replace_objectId46 ${objectId3} insert_policyId_to_file1 intercept_replace_policyId7 ${policyId1} insert_policyId_to_file1 replace_policyId7 ${policyId2} Proxy-Policy-replace-00009 [Tags] 应答头完整匹配 Comment 创建fqdn - ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*zts.com.cn + ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*zcool.com.cn ${rescode} ${objectId} AddObject2 ${1} ${objectDict} Comment 创建url - ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=consult/consult.aspx + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.zcool.com.cn ${rescode} ${objectId1} AddObject2 ${1} ${objectDict} - Comment 创建请求头 + Comment 创建应答头 ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type ${rescode} ${objectId2} AddObject2 ${1} ${objectDict} Comment Comment 创建拦截策略 - ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} + ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace-09 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} ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2 ${policyId1} Get-Pids ${policyId1} @@ -259,27 +281,31 @@ Proxy-Policy-replace-00009 insert_policyId_to_file1 replace_policyId8 ${policyId2} Proxy-Policy-replace-00010 - [Tags] fqdn右匹配 + [Tags] fqdn右匹配 update policy:replace content:http_resp_body Comment 创建fqdn ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com ${rescode} ${objectId} AddObject2 ${1} ${objectDict} Comment 创建url - ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=action + ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node ${rescode} ${objectId1} AddObject2 ${1} ${objectDict} + Comment 创建请求头 + ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=testpolicyreplace_0010|Content-Type + ${rescode} ${objectId2} AddObject2 ${1} ${objectDict} Comment Comment 创建拦截策略 - ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} + ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-replace-10 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} log ${policyDict} ${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2 ${policyId1} Get-Pids ${policyId1} ${policyId1} Set Variable ${policyId1}[0] Comment 创建replace策略 - ${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00010 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"hello","replace_with":"111111"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} + ${policyDict} Create Dictionary policyName=Proxy-Policy-replace-00010 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"hello","replace_with":"111111"}],"protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} log ${policyDict} ${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2 ${policyId2} Get-Pids ${policyId2} ${policyId2} Set Variable ${policyId2}[0] insert_policyId_to_file1 replace_objectId22 ${objectId} insert_policyId_to_file1 replace_objectId23 ${objectId1} + insert_policyId_to_file1 replace_objectId47 ${objectId2} insert_policyId_to_file1 intercept_replace_policyId9 ${policyId1} insert_policyId_to_file1 replace_policyId9 ${policyId2} diff --git a/01-TestCase/tsg_adc/multi_step/b_Replace_Tests.robot b/01-TestCase/tsg_adc/multi_step/b_Replace_Tests.robot index 5b58168..b51ceb0 100644 --- a/01-TestCase/tsg_adc/multi_step/b_Replace_Tests.robot +++ b/01-TestCase/tsg_adc/multi_step/b_Replace_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-replace-00001 @@ -14,13 +17,39 @@ Proxy-Policy-replace-00001 ${stringlist} run keyword if '${systemType}'=='Windows' Create List 明天你好 Tango Secure Gateway CA ... ELSE Create List 明天你好 Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} - + Comment 改变拦截策略 + ${policyDict} Create Dictionary policyId=${intercept_replace_policyId} source=${replace_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Intercept-replace-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${replace_objectId43}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + Comment 改变Replace策略 + ${policyDict} Create Dictionary policyId=${replace_policyId} source=${replace_objectId42}|TSG_SECURITY_SOURCE_LOCATION policyName=Proxy-Policy-replace-00001-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"Artificial","replace_with":"后天你好吗"}],"protocol":"HTTP"} filterList=${replace_objectId43}|TSG_FIELD_HTTP_HOST,${replace_objectId39}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + sleep 3 + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00001.bat + ... ELSE set variable r + ${stringlist} run keyword if '${systemType}'=='Windows' Create List 后天你好吗 Tango Secure Gateway CA + ... ELSE Create List 后天你好吗 Tango Secure Gateway CA + ${rescode} SystemCommands ${commandstr} ${stringlist} + Proxy-Policy-replace-00002 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00002.bat ... ELSE set variable curl -kv https://www.splishsplash.com/ - ${stringlist} run keyword if '${systemType}'=='Windows' Create List splishsplash Tango Secure Gateway CA - ... ELSE Create List splishsplash Tango Secure Gateway CA + ${stringlist} run keyword if '${systemType}'=='Windows' Create List facebook Tango Secure Gateway CA + ... ELSE Create List facebook Tango Secure Gateway CA + ${rescode} SystemCommands ${commandstr} ${stringlist} + Comment 改变Replace策略 + ${policyDict} Create Dictionary policyId=${replace_policyId1} policyName=Proxy-Policy-replace-00002-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_req_uri","find":"splishsplash","replace_with":"halashaotestreplace0002"}],"protocol":"HTTP"} filterList=109|TSG_FIELD_HTTP_HOST,${replace_objectId44}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + sleep 3 + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00002.bat + ... ELSE set variable curl -kv https://www.splishsplash.com/ + ${stringlist} run keyword if '${systemType}'=='Windows' Create List halashaotestreplace0002 Tango Secure Gateway CA + ... ELSE Create List halashaotestreplace0002 Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} Proxy-Policy-replace-00003 @@ -56,6 +85,17 @@ Proxy-Policy-replace-00004 ${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json Tango Secure Gateway CA ... ELSE Create List text/json Tango Secure Gateway CA ${rescode} SystemCommands ${commandstr} ${stringlist} + Comment 改变Replace策略 + ${policyDict} Create Dictionary policyId=${replace_policyId3} policyName=Proxy-Policy-replace-00004-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"hahaha"}],"protocol":"HTTP"} filterList=${replace_objectId5}|TSG_FIELD_HTTP_URL,${replace_objectId45}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + sleep 3 + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_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.ino.com/news/headlines/ + ${stringlist} run keyword if '${systemType}'=='Windows' Create List text/hahaha Tango Secure Gateway CA + ... ELSE Create List text/hahaha Tango Secure Gateway CA + ${rescode} SystemCommands ${commandstr} ${stringlist} Proxy-Policy-replace-00005 Comment 功能端验证HTTP验证 @@ -88,11 +128,22 @@ Proxy-Policy-replace-00008 ${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json ... ELSE Create List text/json ${rescode} SystemCommands ${commandstr} ${stringlist} + Comment 改变Replace策略 + ${policyDict} Create Dictionary policyId=${replace_policyId7} policyName=Proxy-Policy-replace-00008-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"guheihei"}],"protocol":"HTTP"} filterList=${replace_objectId17}|TSG_FIELD_HTTP_URL,${replace_objectId46}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + sleep 3 + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00008.bat + ... ELSE set variable curl -kv http://www.ghzq.com.cn/ghzq/index.html + ${stringlist} run keyword if '${systemType}'=='Windows' Create List text/guheihei + ... ELSE Create List text/guheihei + ${rescode} SystemCommands ${commandstr} ${stringlist} Proxy-Policy-replace-00009 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00009.bat - ... ELSE set variable curl -kv http://www.zts.com.cn/consult/consult.aspx + ... ELSE set variable curl -kv https://www.zcool.com.cn/ ${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json ... ELSE Create List text/json ${rescode} SystemCommands ${commandstr} ${stringlist} @@ -100,9 +151,20 @@ Proxy-Policy-replace-00009 Proxy-Policy-replace-00010 Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00010.bat - ... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=hello&setCookie=hjbnm&contentType=text/html&resBody=05691" -kv \ http://open.node.com/action - ${stringlist} run keyword if '${systemType}'=='Windows' Create List Not Found - ... ELSE Create List Not Found + ... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{"requestbody":"testpolicyreplace_0010","setcook":"12345678","contenttype": "content-type","responsebody": "helloreplace0010"}" -kv http://open.node.com/go + ${stringlist} run keyword if '${systemType}'=='Windows' Create List 111111 + ... ELSE Create List 111111 + ${rescode} SystemCommands ${commandstr} ${stringlist} + Comment 改变Replace策略 + ${policyDict} Create Dictionary policyId=${replace_policyId9} policyName=Proxy-Policy-replace-00010-1 policyType=pxy_manipulation policyDesc=autotest action=manipulation userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"helloreplace0010","replace_with":"chifan"}],"protocol":"HTTP"} filterList=${replace_objectId23}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID} + log ${policyDict} + ${rescode} UpdatePolicies 1 ${policyDict} v2 update + sleep 3 + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_replace_00010.bat + ... ELSE set variable curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{\"requestbody\":\"testpolicyreplace_0010\",\"setcook\":\"12345678\",\"contenttype\": \"content-type\",\"responsebody\": \"aluohareplace0015\"}" -kv http://open.node.com/go + ${stringlist} run keyword if '${systemType}'=='Windows' Create List chifan + ... ELSE Create List chifan ${rescode} SystemCommands ${commandstr} ${stringlist} Proxy-Policy-replace-00011 diff --git a/01-TestCase/tsg_adc/multi_step/c_Replace_Tests.robot b/01-TestCase/tsg_adc/multi_step/c_Replace_Tests.robot index 62d3aad..976d323 100644 --- a/01-TestCase/tsg_adc/multi_step/c_Replace_Tests.robot +++ b/01-TestCase/tsg_adc/multi_step/c_Replace_Tests.robot @@ -18,6 +18,8 @@ Proxy-Policy-replace-00001 #删除对象 ${objectids} set Variable ${replace_objectId} ${objectids} Catenate SEPARATOR=, ${objectids} ${replace_objectId39} + ${objectids} Catenate SEPARATOR=, ${objectids} ${replace_objectId42} + ${objectids} Catenate SEPARATOR=, ${objectids} ${replace_objectId43} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_replace_policyId}]} ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${replace_policyId}]} @@ -27,7 +29,7 @@ Proxy-Policy-replace-00001 Proxy-Policy-replace-00002 #删除对象 - #${objectids} set Variable ${replace_objectId1} + ${objectids} set Variable ${replace_objectId1} ${objectids} set Variable ${replace_objectId40} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_replace_policyId1}]} @@ -120,7 +122,7 @@ Proxy-Policy-replace-00009 ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${replace_policyId8}]} ${policyIds} Create List ${policyId1} ${policyId2} ${s} Convert to String ${replace_policyId8} - GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.zts.com.cn + GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.zcool.com.cn Proxy-Policy-replace-00010 #删除对象 diff --git a/05-Other/curl/command/ProxyPolicy_replace_00009.bat b/05-Other/curl/command/ProxyPolicy_replace_00009.bat index d57491d..8990c7f 100644 --- a/05-Other/curl/command/ProxyPolicy_replace_00009.bat +++ b/05-Other/curl/command/ProxyPolicy_replace_00009.bat @@ -1 +1 @@ -curl -kv http://www.zts.com.cn/consult/consult.aspx| iconv -f utf-8 -t gbk \ No newline at end of file +curl -kv https://www.zcool.com.cn/ | iconv -f utf-8 -t gbk \ No newline at end of file diff --git a/05-Other/curl/command/ProxyPolicy_replace_00010.bat b/05-Other/curl/command/ProxyPolicy_replace_00010.bat index 989ad4e..47d6b43 100644 --- a/05-Other/curl/command/ProxyPolicy_replace_00010.bat +++ b/05-Other/curl/command/ProxyPolicy_replace_00010.bat @@ -1 +1,4 @@ -curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=hello&setCookie=hjbnm&contentType=text/html&resBody=05691" -kv http://open.node.com/action | iconv -f utf-8 -t gbk \ No newline at end of file +curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{\"requestbody\":\"testpolicyreplace_0010\",\"setcook\":\"12345678\",\"contenttype\": \"content-type\",\"responsebody\": \"helloreplace0010\"}" -kv http://open.node.com/go | iconv -f utf-8 -t gbk + + + diff --git a/05-Other/curl/command/ProxyPolicy_replace_00010_1.bat b/05-Other/curl/command/ProxyPolicy_replace_00010_1.bat new file mode 100644 index 0000000..111b654 --- /dev/null +++ b/05-Other/curl/command/ProxyPolicy_replace_00010_1.bat @@ -0,0 +1 @@ +curl -H "Content-Type:application/json;charset=UTF-8" -X POST -d "{\"requestbody\":\"testpolicyreplace_0010\",\"setcook\":\"12345678\",\"contenttype\": \"content-type\",\"responsebody\": \"aluohareplace0015\"}" -kv http://open.node.com/go | iconv -f utf-8 -t gbk \ No newline at end of file