b步骤中增加策略验证Deny动作,Allow动作,Hijack代理策略策略校验代码
This commit is contained in:
@@ -22,7 +22,7 @@ SecurityPolicy-Allow-Rtp-00001
|
|||||||
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
|
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists}
|
||||||
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
|
${rescode} ${object_Ip_Id1} AddObjects ${1} ${objectDict}
|
||||||
Comment 创建安全策略
|
Comment 创建安全策略
|
||||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00001 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} source=${objectId}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appIdObjects=${RTP_ID}
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Rtp-00001 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"RTP"} source=${object_Ip_Id}|TSG_SECURITY_SOURCE_ADDR destination=${object_Ip_Id1}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appIdObjects=${RTP_ID}
|
||||||
log ${policyDict}
|
log ${policyDict}
|
||||||
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
||||||
${policyId} Get-Pids ${policyId}
|
${policyId} Get-Pids ${policyId}
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ Proxy-Policy-deny-00011
|
|||||||
Comment 创建url
|
Comment 创建url
|
||||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=sketch-to
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=sketch-to
|
||||||
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
||||||
Comment 创建请求头
|
Comment 创建应答头
|
||||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
|
||||||
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
||||||
Comment #创建引用文件
|
Comment #创建引用文件
|
||||||
|
|||||||
@@ -257,10 +257,10 @@ Proxy-Policy-hijack-00008
|
|||||||
Comment 创建url
|
Comment 创建url
|
||||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=wo.cn/mdd/
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=wo.cn/mdd/
|
||||||
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
||||||
Comment 创建请求头
|
Comment 创建应答头
|
||||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
|
||||||
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
||||||
Comment 创建请求头2
|
Comment 创建应答头2
|
||||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=utf-8|Content-Type
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=utf-8|Content-Type
|
||||||
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
||||||
Comment 创建hijack文件
|
Comment 创建hijack文件
|
||||||
@@ -294,7 +294,7 @@ Proxy-Policy-hijack-00009
|
|||||||
Comment 创建url
|
Comment 创建url
|
||||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=default.htm
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=default.htm
|
||||||
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
||||||
Comment 创建请求头
|
Comment 创建应答头
|
||||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
|
||||||
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
||||||
Comment 创建hijack文件
|
Comment 创建hijack文件
|
||||||
@@ -360,7 +360,7 @@ Proxy-Policy-hijack-00011
|
|||||||
Comment 创建url
|
Comment 创建url
|
||||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=/eng/start/
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=/eng/start/
|
||||||
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
||||||
Comment 创建请求头
|
Comment 创建应答
|
||||||
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
|
||||||
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
||||||
Comment 创建hijack文件
|
Comment 创建hijack文件
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ SecurityPolicy-Monitor-Rtp-00001
|
|||||||
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
||||||
${policyId} Get-Pids ${policyId}
|
${policyId} Get-Pids ${policyId}
|
||||||
${policyId} Set Variable ${policyId}[0]
|
${policyId} Set Variable ${policyId}[0]
|
||||||
insert_policyId_to_file1 monitor_rtp_objectId8 ${objectId}
|
insert_policyId_to_file1 monitor_rtp_objectId8 ${object_Ip_Id}
|
||||||
insert_policyId_to_file1 monitor_rtp_objectId9 ${objectId}
|
insert_policyId_to_file1 monitor_rtp_objectId9 ${object_Ip_Id1}
|
||||||
insert_policyId_to_file1 monitor_rtp_policyId ${policyId}
|
insert_policyId_to_file1 monitor_rtp_policyId ${policyId}
|
||||||
|
|
||||||
SecurityPolicy-Monitor-Rtp-00002
|
SecurityPolicy-Monitor-Rtp-00002
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ Proxy-Policy-allow-00003
|
|||||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||||
Comment 功能端验证HTTP验证
|
Comment 功能端验证HTTP验证
|
||||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_2.bat
|
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_allow_00003_2.bat
|
||||||
... ELSE set variable curl -kv \ https://https://astrou.ru/
|
... ELSE set variable curl -kv \ https://astrou.ru/
|
||||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List каждые Tango Secure Gateway CA
|
${stringlist} run keyword if '${systemType}'=='Windows' Create List каждые Tango Secure Gateway CA
|
||||||
... ELSE Create List каждые Tango Secure Gateway CA
|
... ELSE Create List каждые Tango Secure Gateway CA
|
||||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
|
||||||
|
Library String
|
||||||
|
Library OperatingSystem
|
||||||
|
Library Selenium2Library
|
||||||
|
Library Collections
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||||
|
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||||
|
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
|
||||||
|
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Library json
|
||||||
|
Library DateTime
|
||||||
|
Library demjson
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||||
|
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||||
|
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${policyIds} ${EMPTY}
|
||||||
|
${objectids} ${EMPTY}
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
SecurityPolicy-Allow-Http-00001
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.66rpg.com"}
|
||||||
|
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.66rpg.com"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${qname_fqdn_id}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${allow_http_objectId4}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_http_objectId5} ${allow_http_policyId}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
SecurityPolicy-Allow-Http-00002
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.xiang5.com"}
|
||||||
|
${qname_fqdn_id} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.xiang5.com"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${qname_fqdn_id}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${allow_http_objectId7}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_http_objectId8} ${allow_http_policyId1}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||||
|
Force Tags tsg_adc_wp adc_log security_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 ../../../05-Other/AllFlowCaseVariable.txt
|
||||||
|
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
|
||||||
|
Resource ../../../05-Other/AllFlowCaseVariable1.txt
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${policyIds} ${EMPTY}
|
||||||
|
${objectids} ${EMPTY}
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
SecurityPolicy-Allow-Http-00001
|
||||||
|
#删除对象
|
||||||
|
${objectids} set Variable ${allow_http_objectId}
|
||||||
|
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId2}
|
||||||
|
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId3}
|
||||||
|
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId4}
|
||||||
|
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId5}
|
||||||
|
#删除策略
|
||||||
|
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${allow_http_policyId}]}
|
||||||
|
${s} Convert to String ${allow_http_policyId}
|
||||||
|
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host clintonairport.com
|
||||||
|
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.66rpg.com
|
||||||
|
|
||||||
|
SecurityPolicy-Allow-Http-00002
|
||||||
|
#删除对象
|
||||||
|
${objectids} set Variable ${allow_http_objectId1}
|
||||||
|
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId6}
|
||||||
|
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId7}
|
||||||
|
${objectids} Catenate SEPARATOR=, ${objectids} ${allow_http_objectId8}
|
||||||
|
#删除策略
|
||||||
|
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${allow_http_policyId1}]}
|
||||||
|
${s} Convert to String ${allow_http_policyId1}
|
||||||
|
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host scoutbahamas
|
||||||
|
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.xiang5.com
|
||||||
|
|
||||||
|
|
||||||
|
SecurityPolicy-Allow-Http-00003
|
||||||
|
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${allow_http_policyId2}]}
|
||||||
|
${s} Convert to String ${allow_http_policyId2}
|
||||||
|
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host scoutbahamas
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
|
||||||
|
Library String
|
||||||
|
Library OperatingSystem
|
||||||
|
Library Selenium2Library
|
||||||
|
Library Collections
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||||
|
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||||
|
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
|
||||||
|
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Library json
|
||||||
|
Library DateTime
|
||||||
|
Library demjson
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||||
|
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||||
|
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${policyIds} ${EMPTY}
|
||||||
|
${objectids} ${EMPTY}
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
SecurityPolicy-Allow-Ssl-00001
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${sni} Create Dictionary attributeType=string attributeName=sni appId=126 appName=ssl protocol=ssl attributeValue={"string": "homebank.kz"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_ssl_objectId} ${allow_ssl_policyId}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
SecurityPolicy-Allow-Ssl-00002
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${sni} Create Dictionary attributeType=string attributeName=sni appId=126 appName=ssl protocol=ssl attributeValue={"string": "homebank.kz"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${sni}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_ssl_objectId3} ${allow_ssl_policyId1}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
446
01-TestCase/tsg_adc/multi_step/b_BAllow_Tests_Verify.robot
Normal file
446
01-TestCase/tsg_adc/multi_step/b_BAllow_Tests_Verify.robot
Normal file
@@ -0,0 +1,446 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
|
||||||
|
Library String
|
||||||
|
Library OperatingSystem
|
||||||
|
Library Selenium2Library
|
||||||
|
Library Collections
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||||
|
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||||
|
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
|
||||||
|
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Library json
|
||||||
|
Library DateTime
|
||||||
|
Library demjson
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||||
|
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||||
|
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${policyIds} ${EMPTY}
|
||||||
|
${objectids} ${EMPTY}
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
Proxy-Policy-allow-00001
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "mp.pipix.com"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId39} ${allow_policyId}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00002
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.feishu.cn"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId1} ${allow_policyId1}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00003
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "csgo500.com"}
|
||||||
|
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "znakitaro.ru"}
|
||||||
|
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "astrou.ru"}
|
||||||
|
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "lunar.pw"}
|
||||||
|
${url1} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "csgo500.com"}
|
||||||
|
${url2} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "znakitaro.ru"}
|
||||||
|
${url3} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "astrou.ru"}
|
||||||
|
${url4} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "lunar.pw"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId2} ${allow_objectId3} ${allow_policyId2}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00004
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.hao123.com"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "afsfsdafsafsafsfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId40} ${allow_objectId41} ${allow_policyId3}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00005
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "boutiquehotel.me"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "boutiquehotel.me/paris/"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "Mozilla/5.0aaffwefweaf","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId7} ${allow_objectId8} ${allow_objectId9} ${allow_policyId4}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00006
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.choicehotels.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.choicehotels.com/quality-inn"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "Mozilla/5.0aaffwefweaf","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId10} ${allow_objectId11} ${allow_objectId12} ${allow_policyId5}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00007
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.woodsnap.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.woodsnap.com/about-us/frames"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId13} ${allow_objectId14} ${allow_objectId15} ${allow_policyId6}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00008
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.sse.com.cn"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.sse.com.cn/market/overview/"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "html/text","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId16} ${allow_objectId17} ${allow_objectId18} ${allow_policyId7}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00009
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.szse.cn"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.szse.cn/lawrules/index.html"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId19} ${allow_objectId20} ${allow_objectId21} ${allow_policyId8}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-000010
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.gf.com.cn"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.gf.com.cn/about/intro"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId22} ${allow_objectId23} ${allow_objectId24} ${allow_policyId9}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-000011
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.chinastock.com.cn"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.chinastock.com.cn/yhwz/investbank/index.shtml"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId25} ${allow_objectId26} ${allow_objectId42} ${allow_policyId10}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-000012
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.virtuoso.com"}
|
||||||
|
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.hongxiu.com"}
|
||||||
|
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.readnovel.com"}
|
||||||
|
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "b.faloo.com"}
|
||||||
|
${url1} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.virtuoso.com/destinations"}
|
||||||
|
${url2} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.hongxiu.com/"}
|
||||||
|
${url3} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.readnovel.com/"}
|
||||||
|
${url4} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "b.faloo.com/"}
|
||||||
|
${req_hdr_ck1} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "fsfsfslQfQ_2132afaafa","district": "Cookie"}
|
||||||
|
${req_hdr_ck2} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "afafs_csrfTokenafsfs","district": "Cookie"}
|
||||||
|
${req_hdr_ck3} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "curr_urlfafsfdfgh","district": "Cookie"}
|
||||||
|
${req_hdr_ck4} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "afsfs1406562325","district": "Cookie"}
|
||||||
|
${req_hdr_ck5} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "UM_fafs1234","district": "Cookie"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4} ${req_hdr_ck1} ${req_hdr_ck2} ${req_hdr_ck3} ${req_hdr_ck4} ${req_hdr_ck5}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId28} ${allow_objectId29} ${allow_objectId30} ${allow_policyId11}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-000013
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "russia.payu.com"}
|
||||||
|
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "tytbz.925mm.com"}
|
||||||
|
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "dujia.qunar.com"}
|
||||||
|
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.vitalsource.com"}
|
||||||
|
${res_hdr_sc1} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "frontLang=zh-cnaffwww","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc2} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "1111222Domain=qunar.com; Path=/","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc3} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "pll_language=rufsfdswkl123","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc4} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "_stargate_sessionfafaf31","district": "Set-Cookie"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${res_hdr_sc1} ${res_hdr_sc2} ${res_hdr_sc3} ${res_hdr_sc4}
|
||||||
|
... ${res_hdr_sc1} ${res_hdr_sc2} ${res_hdr_sc3} ${res_hdr_sc4}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId31} ${allow_objectId32} ${allow_policyId12}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-000014
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.orbitz.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.orbitz.com/Flights"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
|
||||||
|
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
|
||||||
|
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "afsf123Domain=.orbitz.com","district": "Set-Cookie"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId33} ${allow_objectId34} ${allow_objectId35} ${allow_objectId36} ${allow_objectId37} ${allow_objectId38} ${allow_policyId13}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
523
01-TestCase/tsg_adc/multi_step/b_EDeny_Tests_Verify.robot
Normal file
523
01-TestCase/tsg_adc/multi_step/b_EDeny_Tests_Verify.robot
Normal file
@@ -0,0 +1,523 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
|
||||||
|
Library String
|
||||||
|
Library OperatingSystem
|
||||||
|
Library Selenium2Library
|
||||||
|
Library Collections
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||||
|
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||||
|
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
|
||||||
|
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Library json
|
||||||
|
Library DateTime
|
||||||
|
Library demjson
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||||
|
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||||
|
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${policyIds} ${EMPTY}
|
||||||
|
${objectids} ${EMPTY}
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
Proxy-Policy-deny-00002
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "kingidentity.com"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId1} ${deny_policyId1}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-00003
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.wimdu.de"}
|
||||||
|
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "creativetravelgroup.com"}
|
||||||
|
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.hinabian.com"}
|
||||||
|
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.smithsonianjourneys.org"}
|
||||||
|
${url1} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.wimdu.de/"}
|
||||||
|
${url2} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "creativetravelgroup.com/"}
|
||||||
|
${url3} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.hinabian.com/"}
|
||||||
|
${url4} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.smithsonianjourneys.org/"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId2} ${deny_objectId3} ${deny_policyId2}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-allow-00004
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "bbs.nga.cn"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "bbs.nga.cn/"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "afsfssfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua} ${fqdn}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId48} ${deny_objectId49} ${deny_objectId50} ${deny_policyId3}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-00005
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "americantesol.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "americantesol.com/tesol-register.html"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId7} ${deny_objectId8} ${deny_objectId9} ${deny_policyId4}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-00006
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.playgroundsessions.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.choicehotels.com/quality-inn"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "Mozilla/5.0aaffwefweaf","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId10} ${deny_objectId11} ${deny_objectId12} ${deny_policyId5}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-00007
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "peoplestalkradio.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "peoplestalkradio.com/forums/register.php"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId13} ${deny_objectId14} ${deny_objectId15} ${deny_policyId6}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-00008
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "bbs.tianya.cn"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "bbs.tianya.cn/list-16-1.shtml"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId51} ${deny_objectId52} ${deny_objectId53} ${deny_policyId7}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-00009
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.cuctv.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.cuctv.com/"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html; charset=utf-8","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId19} ${deny_objectId20} ${deny_objectId21} ${deny_policyId8}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000010
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.duckduckmoose.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.duckduckmoose.com/"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId22} ${deny_objectId23} ${deny_objectId24} ${deny_policyId9}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000011
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "tutcandy.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "tutcandy.com/2009/04/ai-sketch-to-vector-tutorial"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId25} ${deny_objectId26} ${deny_objectId27} ${deny_policyId10}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000012
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.youqulu.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.youqulu.com/category/zixun"}
|
||||||
|
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "saltkeyfafghlh","district": "Cookie"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId28} ${deny_objectId29} ${deny_objectId30} ${deny_policyId11}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000013
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.nypl.org"}
|
||||||
|
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.thailand.com.co"}
|
||||||
|
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "bj.zu.ke.com"}
|
||||||
|
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "nationalbank.kz"}
|
||||||
|
${url1} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.nypl.org/books-music-movies"}
|
||||||
|
${url2} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.thailand.com.co/category-207-b0.html"}
|
||||||
|
${url3} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "bj.zu.ke.com/zufang"}
|
||||||
|
${url4} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "nationalbank.kz/?switch=kazakh"}
|
||||||
|
${res_hdr_sc1} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "incap_sesafss23456","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc2} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "1111ssssMax-Age=604800","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc3} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "domain=.ke.com","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc4} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "irkzadmin_sessionfsf22345","district": "Set-Cookie"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4}
|
||||||
|
... ${res_hdr_sc1} ${res_hdr_sc2} ${res_hdr_sc3} ${res_hdr_sc4}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId31} ${deny_objectId32} ${deny_objectId46}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000014
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "open.node.com"}
|
||||||
|
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=106 appName=http protocol=http attributeValue={"string": "ProxydenyTest001402"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${req_body}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId34} ${deny_objectId54} ${deny_policyId13}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000015
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=106 appName=http protocol=http attributeValue={"string": "Proxydeny001502"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${res_body}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId55} ${deny_policyId14}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000016
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "mt.meipai.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "mt.meipai.com"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId58} ${deny_objectId47} ${deny_policyId17}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000017
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.orbitz.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.orbitz.com/Flights"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
|
||||||
|
${req_body} Create Dictionary attributeType=string attributeName=req_body appId=106 appName=http protocol=http attributeValue={"string": "ProxydenyTest001402"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct} ${req_hdr_ua} ${req_body}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId36} ${deny_objectId37} ${deny_objectId38} ${deny_objectId39} ${deny_objectId40} ${deny_policyId15}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-deny-000018
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.orbitz.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.orbitz.com/Flights"}
|
||||||
|
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
|
||||||
|
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "afsf123Domain=.orbitz.com","district": "Set-Cookie"}
|
||||||
|
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=106 appName=http protocol=http attributeValue={"string": "Proxydeny001502"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${res_hdr_sc} ${res_body}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId41} ${deny_objectId42} ${deny_objectId43} ${deny_objectId44} ${deny_objectId45} ${deny_policyId16}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
|
||||||
389
01-TestCase/tsg_adc/multi_step/b_IHijack_Tests_Verify.robot
Normal file
389
01-TestCase/tsg_adc/multi_step/b_IHijack_Tests_Verify.robot
Normal file
@@ -0,0 +1,389 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
|
||||||
|
Library String
|
||||||
|
Library OperatingSystem
|
||||||
|
Library Selenium2Library
|
||||||
|
Library Collections
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||||
|
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||||
|
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
|
||||||
|
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||||
|
Library json
|
||||||
|
Library DateTime
|
||||||
|
Library demjson
|
||||||
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||||
|
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||||
|
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${policyIds} ${EMPTY}
|
||||||
|
${objectids} ${EMPTY}
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-00002
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.uqur.cn"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.uqur.cn/index_0.shtml"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId1} ${hijack_objectId40} ${hijack_policyId1}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-00003
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.lexus.ru"}
|
||||||
|
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "oktrucking.org"}
|
||||||
|
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.federalsignal.com"}
|
||||||
|
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "peasedev.org"}
|
||||||
|
${url1} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.lexus.ru/"}
|
||||||
|
${url2} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "oktrucking.org/"}
|
||||||
|
${url3} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.federalsignal.com/"}
|
||||||
|
${url4} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "peasedev.org/"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId2} ${hijack_objectId3} ${hijack_policyId2}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-00004
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.huoshan.com/greenlive/union_hall/"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "afsfssfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId44} ${hijack_objectId45} ${hijack_policyId3}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-00005
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.ixigua.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.ixigua.com/channel/dianying/"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId7} ${hijack_objectId8} ${hijack_objectId9} ${hijack_policyId4}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-00006
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.dcdapp.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.dcdapp.com/?zt=dongchediapp"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId10} ${hijack_objectId11} ${hijack_objectId12} ${hijack_policyId5}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-00007
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.gogokid.com.cn"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.gogokid.com.cn/teacher"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ua}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId13} ${hijack_objectId14} ${hijack_objectId15} ${hijack_policyId6}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-00008
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.mafengwo.cn/mdd/"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "utf-8aabnna","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId17} ${hijack_objectId46} ${hijack_policyId7}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-00009
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "quote.hexun.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "quote.hexun.com/default.htm#forex"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html; charset=utf-8","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId19} ${hijack_objectId20} ${hijack_objectId21} ${hijack_policyId8}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-000010
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "chaxun.1616.net"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "chaxun.1616.net/jiemeng.htm"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${res_hdr_ct}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId22} ${hijack_objectId23} ${hijack_objectId24} ${hijack_policyId9}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-000012
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.reval.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.reval.com/corporates/"}
|
||||||
|
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "saltkeyfafghlh","district": "Cookie"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId28} ${hijack_objectId29} ${hijack_objectId30} ${hijack_policyId11}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-000013
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "nsscreencast.com"}
|
||||||
|
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.edreams.net"}
|
||||||
|
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "boutiquehotel.me"}
|
||||||
|
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.united.com"}
|
||||||
|
${url1} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "nsscreencast.com/episodes"}
|
||||||
|
${url2} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.edreams.net/merch/trends/"}
|
||||||
|
${url3} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "boutiquehotel.me/paris/"}
|
||||||
|
${url4} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.united.com/zh-hans/cn"}
|
||||||
|
${res_hdr_sc1} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "_nsscreencast_session_afswrew3321","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc2} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "123131afsfSecure; SameSite=None","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc3} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "232456Domain=.boutiquehotel.meafsfsf","district": "Set-Cookie"}
|
||||||
|
${res_hdr_sc4} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "HOME1JSESSIONIDafsfsg","district": "Set-Cookie"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn1} ${fqdn2} ${fqdn3} ${fqdn4} ${url1} ${url2} ${url3} ${url4}
|
||||||
|
... ${res_hdr_sc1} ${res_hdr_sc2} ${res_hdr_sc3} ${res_hdr_sc4}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${hijack_objectId31} ${hijack_objectId32} ${hijack_objectId41} ${hijack_policyId12}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
|
||||||
|
Proxy-Policy-hijack-000014
|
||||||
|
#新增策略验证
|
||||||
|
#创建attributes中的字典
|
||||||
|
${fqdn} Create Dictionary attributeType=string attributeName=host appId=106 appName=http protocol=http attributeValue={"string": "www.travelzoo.com"}
|
||||||
|
${url} Create Dictionary attributeType=string attributeName=url appId=106 appName=http protocol=http attributeValue={"string": "www.travelzoo.com/cn/collections/hotels/ihg-group-meta/"}
|
||||||
|
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
|
||||||
|
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
|
||||||
|
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=106 appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
|
||||||
|
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=106 appName=http protocol=http attributeValue={"string": "afsf123Domain=.orbitz.com","district": "Set-Cookie"}
|
||||||
|
${res_body} Create Dictionary attributeType=string attributeName=res_body appId=106 appName=http protocol=http attributeValue={"string": "Proxydeny001502"}
|
||||||
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "106"}
|
||||||
|
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
|
||||||
|
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
|
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
|
# 合成attributes字典集
|
||||||
|
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${fqdn} ${url} ${req_hdr_ck} ${res_hdr_sc} ${res_body}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
|
||||||
|
log ${verifyList}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
# 打印检查结果
|
||||||
|
${objectid_verify} Set Variable ${testClentIpId}
|
||||||
|
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_objectId41} ${deny_objectId42} ${deny_objectId43} ${deny_objectId44} ${deny_objectId45} ${deny_policyId16}
|
||||||
|
# # 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||||
|
log ${objectid_verify}
|
||||||
|
${testType} Evaluate type($objectid_verify)
|
||||||
|
${testType} Evaluate type($resData)
|
||||||
|
log ${resData}
|
||||||
|
sleep 5
|
||||||
|
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||||
|
Should Be Equal As Strings ${ok} true
|
||||||
|
|
||||||
|
|
||||||
@@ -24,6 +24,7 @@ SecurityPolicy-Allow-Http-00001
|
|||||||
#删除策略
|
#删除策略
|
||||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${allow_http_policyId}]}
|
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${allow_http_policyId}]}
|
||||||
${s} Convert to String ${allow_http_policyId}
|
${s} Convert to String ${allow_http_policyId}
|
||||||
|
log ${endtime}
|
||||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host clintonairport.com
|
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host clintonairport.com
|
||||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.66rpg.com
|
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.66rpg.com
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ Proxy-Policy-deny-00015
|
|||||||
|
|
||||||
Proxy-Policy-deny-00016
|
Proxy-Policy-deny-00016
|
||||||
#删除文件
|
#删除文件
|
||||||
${profiledId} set Variable ${deny_profileId5}
|
${profiledId} set Variable ${deny_profileId6}
|
||||||
#删除对象
|
#删除对象
|
||||||
${objectids} set Variable ${deny_objectId47}
|
${objectids} set Variable ${deny_objectId47}
|
||||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId58}
|
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId58}
|
||||||
@@ -236,7 +236,6 @@ Proxy-Policy-deny-00017
|
|||||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId38}
|
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId38}
|
||||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId39}
|
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId39}
|
||||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId40}
|
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId40}
|
||||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId48}
|
|
||||||
#删除策略
|
#删除策略
|
||||||
${policyIds} Create List {"policyType":"pxy_manipulation","policyIds":[${deny_policyId15}]}
|
${policyIds} Create List {"policyType":"pxy_manipulation","policyIds":[${deny_policyId15}]}
|
||||||
${s} Convert to String ${deny_policyId15}
|
${s} Convert to String ${deny_policyId15}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ SecurityPolicy-monitor-Rtp-00009
|
|||||||
SecurityPolicy-monitor-Rtp-000010
|
SecurityPolicy-monitor-Rtp-000010
|
||||||
#删除对象
|
#删除对象
|
||||||
${objectids} set Variable ${monitor_rtp_objectId7}
|
${objectids} set Variable ${monitor_rtp_objectId7}
|
||||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${monitor_rtp_policyId8}]}
|
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${monitor_rtp_policyId9}]}
|
||||||
${s} Convert to String ${monitor_rtp_policyId9}
|
${s} Convert to String ${monitor_rtp_policyId9}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user