捕包策略用例修改

This commit is contained in:
hebingning
2021-03-10 19:31:05 +08:00
parent 40d86c39d3
commit a8f5f95b08

View File

@@ -17,60 +17,52 @@ ${url} /v1/policy/profile/responsepages
${profiledId} ${EMPTY}
*** Test Cases ***
create_PacketCapture_Select_Location
create_PacketCapture_Select_DataCenter
# 创建捕包策略
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
${PacketCapture} Create Dictionary policyId= policyName=${TEST NAME} addrType=4 protocol=6 clientIp=${testClentIP} clientPort=0-65535 serverIp=0.0.0.0 serverPort=0-65535 maxPacket=10 captureDuration=1
# ${location} Create List Almaty
${DataCenter} Create List Almaty
# ${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
${response_policy_id} ${response_task_id} Add&Edit_PacketCapture ${PacketCapture} ${DataCenter}
LOG WEQEWEQWEWEWERWERWQERWEQRWERWEQRWQEQWERWEQR
LOG 捕包进度查询
${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress policyId=${policyId3} v1
${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress policyId=${response_policy_id} v1
${response_task_id} Set Variable ${progress_response['data']['list'][0]['taskId']}
LOG 捕包任务详情查询
${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/detail taskId=${PacketCaptureresponse} v1
${progress_response_task} BaseGetRequestForV2 troubleshooting/packetcapture/log/detail taskId=${response_task_id} v1
LOG 捕包设备执行情况查询
${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress/detail taskId=${PacketCaptureresponse} v1
${progress_response_detail} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress/detail taskId=${response_task_id} v1
log 删除task
# ${delete_task_res} BaseGetRequestForV2 troubleshooting/packetcapture/policy taskId=${response_task_id} v1
${policyid1} Set Variable {"policyIds":[${response_policy_id}]}
log ${policyid1}
log 删除policy
${delete_policy_res} BaseDeleteRequest troubleshooting/packetcapture/policy policyId=${policyid1} v1
create_PacketCapture_Select_maxPacket
# 创建捕包策略
log 创建捕包策略
${PacketCapture} Create Dictionary policyId= policyName=${TEST NAME} addrType=4 protocol=6 clientIp=${testClentIP} clientPort=0-65535 serverIp=0.0.0.0 serverPort=0-65535 maxPacket=100000 captureDuration=2
# ${location} Create List Almaty
${DataCenter} Create List Almaty
# ${isp} Create List transtel tnsplus ktel-mask ktel-bng ktel-mxpe
log ${PacketCapture}
${response_policy_id} ${response_task_id} Add&Edit_PacketCapture ${PacketCapture} ${DataCenter}
LOG WEQEWEQWEWEWERWERWQERWEQRWERWEQRWQEQWERWEQR
LOG 捕包进度查询
${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress policyId=${response_policy_id} v1
# LOG 捕包任务详情查询
# ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/detail taskId=${response_task_id} v1
# LOG 捕包设备执行情况查询
# ${progress_response} BaseGetRequestForV2 troubleshooting/packetcapture/log/progress/detail taskId=${response_task_id} v1
# sleep 12
Comment 修改捕包策略
${PacketCapture} Create Dictionary policyId=${response_policy_id} policyName=${TEST NAME} addrType=4 protocol=6 clientIp=${testClentIP} clientPort=0-65535 serverIp=0.0.0.0 serverPort=0-65535 maxPacket=100 captureDuration=3
${DataCenter} Create List Aktau
log ${PacketCapture}
${response_policy_id} ${response_task_id} Add&Edit_PacketCapture ${PacketCapture} ${DataCenter}
create_PacketCapture_Select_ISP
# 创建捕包策略
log 创建捕包策略
@@ -81,41 +73,6 @@ create_PacketCapture_Select_ISP
# ${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 捕包任务详情查询
@@ -132,46 +89,16 @@ create_PacketCapture_Select_ISP
${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
${PacketCaptureresponse} Add&Edit_PacketCapture ${PacketCapture} ${location} ${isp}
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