*** Settings *** Test Teardown DeletePolicyAndObject ${policyIds} ${objectids} Force Tags tsg_adc proxy_policy 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_bfapi/ApiRequest.robot Resource ../../../03-Variable/AllFlowCaseVariable.txt Library String Library Custometest *** Variables *** ${policyIds} ${EMPTY} ${objectids} ${EMPTY} ${url} /v1/policy/profile/responsepages ${profiledId} ${EMPTY} *** Test Cases *** create_PacketCapture_Select_Location # 创建捕包策略 log 创建捕包策略 ${PacketCapture} Create Dictionary policyId= policyName=zmmtest addrType=4 protocol=6 clientIp=192.168.50.60 clientPort=8080 serverIp=0.0.0.0 serverPort=0 maxPacket=1000 captureDuration=1 ${location} Create List Almaty Nursurtan # ${location} Create List # ${isp} Create List transtel tnsplus ktel-mask ktel-bng ktel-mxpe ${isp} Create List log ${PacketCapture} ${PacketCaptureresponse} Add&Edit_PacketCapture ${PacketCapture} ${location} ${isp} LOG WEQEWEQWEWEWERWERWQERWEQRWERWEQRWQEQWERWEQR #创建策略 Comment 创建应答头 ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type ${rescode} ${objectId} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${objectId} Comment 创建安全策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2 ${rescode} ${policyId} AddPolicy2 ${1} ${policyDict} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]} ${policyIds} Create List ${policyId1} ${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages ${profiledId} Get From Dictionary ${response} profileId Comment 创建管控策略 ${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00014 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","html_profile":${profiledId},"code":403,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR ${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict} #删除策略 ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]} ${policyIds} Create List ${policyId1} ${policyId2} Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat ... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html ${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 ... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s ${rescode} SystemCommands ${commandstr} ${stringlist} Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId3} GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com LOG 捕包进度查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress policyId=${policyId3} v1 LOG 捕包任务详情查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/detail taskId=${PacketCaptureresponse} v1 LOG 捕包设备执行情况查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress/detail taskId=${PacketCaptureresponse} v1 create_PacketCapture_Select_ISP # 创建捕包策略 log 创建捕包策略 ${PacketCapture} Create Dictionary policyId= policyName=zmmtest addrType=4 protocol=6 clientIp=192.168.50.60 clientPort=8080 serverIp=0.0.0.0 serverPort=0 maxPacket=1000 captureDuration=1 # ${location} Create List Almaty Nursurtan ${location} Create List ${isp} Create List transtel tnsplus ktel-mask ktel-bng ktel-mxpe # ${isp} Create List log ${PacketCapture} ${PacketCaptureresponse} Add&Edit_PacketCapture ${PacketCapture} ${location} ${isp} #创建策略 Comment 创建应答头 ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type ${rescode} ${objectId} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${objectId} Comment 创建安全策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2 ${rescode} ${policyId} AddPolicy2 ${1} ${policyDict} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]} ${policyIds} Create List ${policyId1} ${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages ${profiledId} Get From Dictionary ${response} profileId Comment 创建管控策略 ${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00014 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","html_profile":${profiledId},"code":403,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR ${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict} #删除策略 ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]} ${policyIds} Create List ${policyId1} ${policyId2} Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat ... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html ${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 ... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s ${rescode} SystemCommands ${commandstr} ${stringlist} Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId3} GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com LOG 捕包进度查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress policyId=${policyId3} v1 LOG 捕包任务详情查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/detail taskId=${PacketCaptureresponse} v1 LOG 捕包设备执行情况查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress/detail taskId=${PacketCaptureresponse} v1 create_PacketCapture_Select_ISP # 创建捕包策略 log 创建捕包策略 ${PacketCapture} Create Dictionary policyId= policyName=zmmtest addrType=4 protocol=6 clientIp=192.168.50.60 clientPort=8080 serverIp=0.0.0.0 serverPort=0 maxPacket=1000 captureDuration=1 ${location} Create List Almaty Nursurtan # ${location} Create List ${isp} Create List transtel tnsplus ktel-mask ktel-bng ktel-mxpe # ${isp} Create List log ${PacketCapture} ${PacketCaptureresponse} Add&Edit_PacketCapture ${PacketCapture} ${location} ${isp} #创建策略 Comment 创建应答头 ${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type ${rescode} ${objectId} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${objectId} Comment 创建安全策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2 ${rescode} ${policyId} AddPolicy2 ${1} ${policyDict} #删除策略 ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]} ${policyIds} Create List ${policyId1} ${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages ${profiledId} Get From Dictionary ${response} profileId Comment 创建管控策略 ${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00014 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","html_profile":${profiledId},"code":403,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR ${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict} #删除策略 ${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]} ${policyIds} Create List ${policyId1} ${policyId2} Comment 功能端验证HTTP验证 ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat ... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html ${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 ... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用 ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s ${rescode} SystemCommands ${commandstr} ${stringlist} Sleep ${policyLogVerificationSleepSeconds}s ${endtime} Get Time #日志验证 ${s} Convert to String ${policyId3} GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com LOG 捕包进度查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress policyId=${policyId3} v1 LOG 捕包任务详情查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/detail taskId=${PacketCaptureresponse} v1 LOG 捕包设备执行情况查询 ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress/detail taskId=${PacketCaptureresponse} v1