This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_adc/multi_step/b_Intercept_Http_Tests.robot

70 lines
5.6 KiB
Plaintext
Raw Normal View History

2020-07-06 10:31:24 +08:00
*** Settings ***
Force Tags tsg_adc_wp security_policy adc_verify
Library OperatingSystem
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
2020-07-06 10:31:24 +08:00
*** Test Cases ***
SecurityPolicy-Intercept-Http-00001
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00001.bat
... ELSE set variable curl http://www.yumi.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 玉米
... ELSE Create List 玉米
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 修改policy的source
${policyDict} Create Dictionary policyId=${intercept_http_policyId} policyName=SecurityPolicy-Intercept-Http-00001_1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${intercept_http_objectId1}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID} source=${intercept_http_objectId}|TSG_SECURITY_SOURCE_LOCATION
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00001.bat
... ELSE set variable curl http://www.yumi.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 玉米
... ELSE Create List 玉米
2020-07-06 10:31:24 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Intercept-Http-00002
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00002.bat
... ELSE set variable curl http://mbzponton.org/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Mercedes
... ELSE Create List Mercedes
${rescode} SystemCommands ${commandstr} ${stringlist}
SecurityPolicy-Intercept-Http-00003
Comment 防止安全策略互相影响,策略验证时候再打开
${policyDict} Create Dictionary policyId=${intercept_http_policyId2} policyName=SecurityPolicy-Intercept-Http-00003-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} destination=${intercept_http_objectId3}|TSG_SECURITY_DESTINATION_ADDR filterList=${intercept_http_objectId2}|TSG_FIELD_HTTP_HOST 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/SecurityPolicy_Intercept_HTTP_00003.bat
... ELSE set variable curl http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List POST
... ELSE Create List POST
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 为保证之后使用open.node.com的Monitor用例正常生效做完验证后失效该策略
${policyDict} Create Dictionary policyId=${intercept_http_policyId2} policyName=SecurityPolicy-Intercept-Http-00003-1 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} destination=${intercept_http_objectId3}|TSG_SECURITY_DESTINATION_ADDR filterList=${intercept_http_objectId2}|TSG_FIELD_HTTP_HOST isValid=${0} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} UpdatePolicies 1 ${policyDict} v2 update
SecurityPolicy-Intercept-Http-00004
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00004.bat
... ELSE set variable curl http://www.zongheng.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 纵横中文网
... ELSE Create List 纵横中文网
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 改变安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Http-00004-1 policyId=${intercept_http_policyId3} destination=164533|TSG_SECURITY_DESTINATION_ADDR policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${intercept_http_objectId5}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Intercept_HTTP_00004.bat
... ELSE set variable curl http://www.zongheng.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 纵横中文网
... ELSE Create List 纵横中文网
2020-07-06 10:31:24 +08:00
${rescode} SystemCommands ${commandstr} ${stringlist}