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
|
2021-01-26 19:12:50 +08:00
|
|
|
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
|
2021-01-26 19:12:50 +08:00
|
|
|
... 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
|
2021-01-26 20:54:31 +08:00
|
|
|
${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
|
2021-01-26 19:12:50 +08:00
|
|
|
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
|
2021-01-26 19:12:50 +08:00
|
|
|
... 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 功能端验证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}
|
|
|
|
|
|
|
|
|
|
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}
|