422 lines
30 KiB
Plaintext
422 lines
30 KiB
Plaintext
*** Settings ***
|
|
Force Tags tsg_adc_wp adc_api proxy_policy
|
|
Library OperatingSystem
|
|
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
|
|
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
|
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
|
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
|
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
|
Resource ../../../03-Variable/ApplicationID.txt
|
|
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
|
|
|
*** Test Cases ***
|
|
Proxy-Policy-allow-00001
|
|
[Tags] fqdn完整匹配 修改fqdn
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$mp.pipix.com
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建fqdn2
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*games.sina.com.cn
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00001 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId ${objectId}
|
|
insert_policyId_to_file1 allow_objectId39 ${objectId1}
|
|
insert_policyId_to_file1 intercept_allow_policyId ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId ${policyId2}
|
|
|
|
Proxy-Policy-allow-00002
|
|
[Tags] cat匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*feishu.cn
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00002 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId1 ${objectId}
|
|
insert_policyId_to_file1 intercept_allow_policyId1 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId1 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00003
|
|
[Tags] url4种匹配
|
|
Comment 创建fqdn
|
|
# ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*smzdm.com,*bilibili.com,*cheapair.com,*surfline.com
|
|
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=csgo500,$znakitaro.ru/,*trou.ru/,lun*
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=114|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00003 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
#insert_policyId_to_file1 allow_objectId2 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId3 ${objectId1}
|
|
insert_policyId_to_file1 intercept_allow_policyId2 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId2 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00004
|
|
[Tags] 请求头左匹配 修改policy中url,请求头
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*123.com
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.hao123.com
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url2
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*hao123.com
|
|
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头2
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0|User-Agent
|
|
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
|
|
Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00004 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId4 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId5 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId6 ${objectId2}
|
|
insert_policyId_to_file1 allow_objectId40 ${objectId3}
|
|
insert_policyId_to_file1 allow_objectId41 ${objectId4}
|
|
insert_policyId_to_file1 intercept_allow_policyId3 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId3 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00005
|
|
[Tags] 请求头左匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$boutiquehotel.me
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=paris/
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00005 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId7 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId8 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId9 ${objectId2}
|
|
insert_policyId_to_file1 intercept_allow_policyId4 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId4 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00006
|
|
[Tags] 请求头字串匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.choicehotels.com
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=quality-inn
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=AppleWebKit|User-Agent
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00006 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId10 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId11 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId12 ${objectId2}
|
|
insert_policyId_to_file1 intercept_allow_policyId5 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId5 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00007
|
|
[Tags] 请求头右匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.woodsnap.com
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=woodsnap
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00007 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId13 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId14 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId15 ${objectId2}
|
|
insert_policyId_to_file1 intercept_allow_policyId6 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId6 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00008
|
|
[Tags] 应答头右匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*sse.com.cn
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=market/overview/
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00008 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId16 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId17 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId18 ${objectId2}
|
|
insert_policyId_to_file1 intercept_allow_policyId7 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId7 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00009
|
|
[Tags] 应答头完整匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*szse.cn
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=lawrules
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00009 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId19 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId20 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId21 ${objectId2}
|
|
insert_policyId_to_file1 intercept_allow_policyId8 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId8 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00010
|
|
[Tags] 应答头子串匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*gf.com.cn
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=about/intro
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html|Content-Type
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00010 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId22 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId23 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId24 ${objectId2}
|
|
insert_policyId_to_file1 intercept_allow_policyId9 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId9 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00011
|
|
[Tags] 应答头左匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*chinastock.com.cn
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=yhwz/investbank
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建应答头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment 创建应答头2
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
|
|
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
|
Comment Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00011 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId25 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId26 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId27 ${objectId2}
|
|
insert_policyId_to_file1 allow_objectId42 ${objectId3}
|
|
insert_policyId_to_file1 intercept_allow_policyId10 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId10 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00012
|
|
[Tags] cookie四种匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.virtuoso.com,$b.faloo.com,*readnovel.com,*hongxiu.com
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=virtuoso.com,faloo,readnovel,hongxiu.com
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建cookie
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=lQfQ_2132|Cookie,_csrfToken|Cookie,curr_url*|Cookie,*1406562325|Cookie,UM_*|Cookie
|
|
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
|
Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00012 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_URL,${objectId2}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId28 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId29 ${objectId1}
|
|
insert_policyId_to_file1 allow_objectId30 ${objectId2}
|
|
insert_policyId_to_file1 intercept_allow_policyId11 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId11 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00013
|
|
[Tags] set-cookie4种匹配
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$russia.payu.com,*925mm.com,*qunar.com,$www.vitalsource.com
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
Comment 创建set-cookie
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=pll_language=ru*|Set-Cookie,*Domain=qunar.com; Path=/|Set-Cookie,frontLang=zh-cn|Set-Cookie,_stargate_session*|Set-Cookie
|
|
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
|
Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00013 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${objectId1}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId31 ${objectId}
|
|
insert_policyId_to_file1 allow_objectId32 ${objectId1}
|
|
insert_policyId_to_file1 intercept_allow_policyId12 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId12 ${policyId2}
|
|
|
|
Proxy-Policy-allow-00014
|
|
[Tags] 最大组合
|
|
Comment 创建fqdn
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.orbitz.com
|
|
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
|
|
Comment 创建url
|
|
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*Flights
|
|
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
|
|
Comment 创建请求头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
|
|
${rescode} ${object_qq_Id} AddObject2 ${1} ${objectDict}
|
|
Comment 创建应答头
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
|
|
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
|
|
Comment 创建cookie
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=__stripe_sid|Cookie
|
|
${rescode} ${object_ck_Id} AddObject2 ${1} ${objectDict}
|
|
Comment 创建set-cookie
|
|
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Domain=.orbitz.com|Set-Cookie
|
|
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
|
|
Comment 创建拦截策略
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-allow policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
|
${policyId1} Get-Pids ${policyId1}
|
|
${policyId1} Set Variable ${policyId1}[0]
|
|
Comment 创建allow策略
|
|
${policyDict} Create Dictionary policyName=Proxy-Policy-allow-00014 policyType=pxy_manipulation policyDesc=autotest action=allow userRegion={"method":"allow","protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_qq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_sk_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
|
log ${policyDict}
|
|
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
|
${policyId2} Get-Pids ${policyId2}
|
|
${policyId2} Set Variable ${policyId2}[0]
|
|
insert_policyId_to_file1 allow_objectId33 ${object_fqdn_Id}
|
|
insert_policyId_to_file1 allow_objectId34 ${object_url_Id}
|
|
insert_policyId_to_file1 allow_objectId35 ${object_qq_Id}
|
|
insert_policyId_to_file1 allow_objectId36 ${object_yd_Id}
|
|
insert_policyId_to_file1 allow_objectId37 ${object_ck_Id}
|
|
insert_policyId_to_file1 allow_objectId38 ${object_sk_Id}
|
|
insert_policyId_to_file1 intercept_allow_policyId13 ${policyId1}
|
|
insert_policyId_to_file1 allow_policyId13 ${policyId2}
|