This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_adc/multi_step/b_BAllow_Tests_Verify.robot

508 lines
48 KiB
Plaintext
Raw Normal View History

*** 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
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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "mp.pipix.com"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId39} ${allow_policyId} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.feishu.cn"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId1}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId1} ${allow_policyId1} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "csgo500.com"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "znakitaro.ru"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "astrou.ru"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "lunar.pw"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "csgo500.com"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "znakitaro.ru"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "astrou.ru"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "lunar.pw"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId2}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId2} ${allow_objectId3} ${allow_policyId2} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hao123.com"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsfsdafsafsafsfMozilla/5.0afsfsdafsafs","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId3}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId40} ${allow_objectId41} ${allow_policyId3} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "boutiquehotel.me"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "boutiquehotel.me/paris/"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0aaffwefweaf","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId4}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId7} ${allow_objectId8} ${allow_objectId9} ${allow_policyId4} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.choicehotels.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.choicehotels.com/quality-inn"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "AppleWebKit","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId5}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId10} ${allow_objectId11} ${allow_objectId12} ${allow_policyId5}
... ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.woodsnap.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.woodsnap.com/about-us/frames"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahahahsfeSafari/537.36","district": "User-Agent"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId6}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId13} ${allow_objectId14} ${allow_objectId15} ${allow_policyId6} ${object_imsi_id}
... ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.sse.com.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.sse.com.cn/market/overview/"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "666html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId7}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId16} ${allow_objectId17} ${allow_objectId18} ${allow_policyId7} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.szse.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.szse.cn/lawrules/index.html"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId8}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId19} ${allow_objectId20} ${allow_objectId21}
... ${allow_policyId8} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "13844870339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "hahauawei.org"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.gf.com.cn"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.gf.com.cn/about/intro"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId9}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId22} ${allow_objectId23} ${allow_objectId24} ${allow_policyId9} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1384487111111"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.chinastock.com.cn/newsite/cgs-services/investBank.html"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "text/html","district": "Content-Type"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId10}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId26} ${allow_objectId42} ${allow_policyId10} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.virtuoso.com"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hongxiu.com"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.readnovel.com"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "b.faloo.com"}
${url1} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.virtuoso.com/destinations"}
${url2} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.hongxiu.com/"}
${url3} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.readnovel.com/"}
${url4} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "b.faloo.com/"}
${req_hdr_ck1} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "fsfsfslQfQ_2132afaafa","district": "Cookie"}
${req_hdr_ck2} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afafs_csrfTokenafsfs","district": "Cookie"}
${req_hdr_ck3} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "curr_urlfafsfdfgh","district": "Cookie"}
${req_hdr_ck4} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsfs1406562325","district": "Cookie"}
${req_hdr_ck5} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "UM_fafs1234","district": "Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId11}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId28} ${allow_objectId29} ${allow_objectId30} ${allow_policyId11} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "17844877790"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn1} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "russia.payu.com"}
${fqdn2} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "tytbz.925mm.com"}
${fqdn3} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "dujia.qunar.com"}
${fqdn4} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.vitalsource.com"}
${res_hdr_sc1} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "frontLang=zh-cnaffwww","district": "Set-Cookie"}
${res_hdr_sc2} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "1111222Domain=qunar.com; Path=/","district": "Set-Cookie"}
${res_hdr_sc3} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "pll_language=rufsfdswkl123","district": "Set-Cookie"}
${res_hdr_sc4} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "_stargate_sessionfafaf31","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId12}
# 打印检查结果
${objectid_verify} Set Variable ${testClentIpId}
${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_objectId31} ${allow_objectId32} ${allow_policyId12} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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中的字典
${imsi_id} Create Dictionary attributeType=string attributeName=imsi appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "11235666666558"}
${phone_number_id} Create Dictionary attributeType=string attributeName=phone_number appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "239114220339"}
${apn_id} Create Dictionary attributeType=string attributeName=apn appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "huawei.com"}
2021-05-17 13:24:29 +06:00
${fqdn} Create Dictionary attributeType=string attributeName=host appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.orbitz.com"}
${url} Create Dictionary attributeType=string attributeName=url appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "www.orbitz.com/Flights"}
${res_hdr_ct} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "charset=text","district": "Content-Type"}
${req_hdr_ua} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "Mozilla/5.0fsfwhh","district": "User-Agent"}
${req_hdr_ck} Create Dictionary attributeType=signature attributeName=req_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "__stripe_sidafdsvxvx","district": "Cookie"}
${res_hdr_sc} Create Dictionary attributeType=signature attributeName=res_hdr appId=${HTTP_VID} appName=http protocol=http attributeValue={"string": "afsf123Domain=.orbitz.com","district": "Set-Cookie"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${HTTP_VID}"}
${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_hdr_ck}
... ${res_hdr_sc} ${imsi_id} ${phone_number_id} ${apn_id}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=pxy_manipulation verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList}
GetVerifyState ${resData} ${allow_policyId13}
# 打印检查结果
${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} ${object_imsi_id} ${obj_phoneNum_Id} ${obj_apn_Id}
# # 调用关键字 提取应答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