2021-04-08 20:09:19 +08:00
|
|
|
|
*** 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
|
|
|
|
|
|
|
|
|
|
|
|
*** Test Cases ***
|
|
|
|
|
|
|
|
|
|
|
|
SecurityPolicy-Intercept-Ssl-00002
|
|
|
|
|
|
#新增策略验证
|
|
|
|
|
|
#创建attributes中的字典
|
2021-05-17 13:24:29 +06:00
|
|
|
|
${sni} Create Dictionary attributeType=string attributeName=sni appId=${SSL_VID} appName=ssl protocol=ssl attributeValue={"string": "fenopy.se"}
|
|
|
|
|
|
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "${SSL_VID}"}
|
2021-04-08 20:09:19 +08:00
|
|
|
|
${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} ${intercept_ssl_objectId2} ${intercept_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
|
|
|
|
|
|
|
2021-04-12 14:51:02 +08:00
|
|
|
|
|
2021-04-08 20:09:19 +08:00
|
|
|
|
|