代理策略Replace动作补充用例和命令
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user