*** 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 *** ${url} /v1/policy/profile/trustedcacertobj ${certId} ${EMPTY} ${policyIds} ${EMPTY} ${objectids} ${EMPTY} *** Test Cases *** VerifySecurity--Allow-SIP-000013 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "zdjzyq12voip"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "wx7051406391"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${testClentIP2}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${allow_sip_objectId10} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_sip_objectId11} ${allow_sip_objectId12} ${allow_sip_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 sleep 5 VerifySecurity--Allow-SIP-00001 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "test1"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "testabc"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${voipCallIp}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${testClentIP2}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${allow_sip_objectId} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_sip_objectId1} ${allow_sip_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 sleep 5 VerifySecurity--Allow-SIP-00001-1 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "test102"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "testddd"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${voipCallIp}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${voipListenIp}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${allow_sip_objectId30} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_sip_objectId38} ${allow_sip_objectId31} ${allow_sip_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 sleep 5 VerifySecurity--Allow-SIP-00001-1 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "test33"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "test6"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${voipCallIp}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${voipListenIp}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${allow_sip_policyId17} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_sip_objectId32} ${allow_sip_objectId39} ${allow_sip_objectId33} # # 调用关键字 提取应答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 sleep 5 VerifySecurity--Allow-SIP-000014 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "zdjzyq12voip"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "51406kkkk"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP2}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${testClentIP3}","port":"7777","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${allow_sip_objectId10} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${allow_sip_objectId13} ${allow_sip_objectId14} ${allow_sip_objectId15} ${allow_sip_objectId16} ${allow_sip_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 sleep 5 VerifySecurity--Deny-SIP-00001-4 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "test116"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "test6"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${voipCallIp}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${voipListenIp}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${deny_sip_objectId48} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_sip_objectId49} ${deny_sip_objectId50} ${deny_sip_policyId27} # # 调用关键字 提取应答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 sleep 5 VerifySecurity--Deny-SIP-00001-5 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "test33"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "test20"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${voipCallIp}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${voipListenIp}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${deny_sip_objectId51} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_sip_objectId52} ${deny_sip_objectId53} ${deny_sip_policyId28} # # 调用关键字 提取应答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 sleep 5 VerifySecurity--Deny-SIP-00005 #新增策略验证 #创建attributes中的字典 ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP2}","port":"40000","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} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${deny_sip_objectId2} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_sip_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} # # ${ok} VerifyProxy ${objectids} ${resData} Should Be Equal As Strings ${ok} true sleep 5 Comment 删除对象 ${objectids} Create List [${deny_sip_objectId2}] Comment 删除策略 ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_sip_policyId4}]} # VerifySecurity--Deny-SIP-00006 # #新增策略验证3 # #创建attributes中的字典 # ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} # ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} # ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP2}","port":"20000","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} # ${verifySession} Create Dictionary attributes=${attributes} # ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} # log ${verifyList} # ${rescode} ${resData} VerifyPolicies ${verifyList} # # 打印检查结果 # ${objectid_verify} Set Variable ${deny_sip_objectId3} # ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_sip_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} # # # ${ok} VerifyProxy ${objectids} ${resData} # Should Be Equal As Strings ${ok} true # sleep 5 # Comment 删除对象 # ${objectids} Create List [${deny_sip_objectId3}] # Comment 删除策略 # ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_sip_policyId5}]} VerifySecurity--Deny-SIP-000014 #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "hbntest3d14"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "hbntest3d1401"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"6666","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} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${deny_sip_objectId11} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_sip_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 sleep 5 VerifySecurity--Deny-SIP-000017 #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "hbntest3d17"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "51406kkkk"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${testClentIP2}","port":"20000","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${deny_sip_objectId14} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${deny_sip_objectId15} ${deny_sip_objectId1501} ${deny_sip_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 sleep 5 VerifySecurity--Deny-SIP-000024 #新增策略验证1 #创建attributes中的字典 ${from1} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "zdjzyq12voip"} ${to1} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "zdjzy77777"} ${from2} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "aaayq12v5553"} ${to2} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "qqqq312voip"} ${from3} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "zdjzyq12voi"} ${to3} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "sie133ll12voi"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${testClentIP3}","port":"7777","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${from1} ${from2} ${from3} ${to1} ${to2} ${to3} ${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} ${deny_sip_objectId32} ${deny_sip_objectId33} ${deny_sip_objectId34} ${deny_sip_objectId35} ... ${deny_sip_objectId36} ${deny_sip_objectId37} ${deny_sip_policyId23} # # 调用关键字 提取应答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 sleep 5 Comment 删除对象 ${objectids} Create List [${deny_sip_objectId32}] [${deny_sip_objectId33}] [${deny_sip_objectId34}] [${deny_sip_objectId35}] [${deny_sip_objectId36}] [${deny_sip_objectId37}] Comment 删除策略 ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_sip_policyId23}]} VerifySecurity--Monitor-SIP-00001-2 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "test108"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "test20"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${voipCallIp}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${voipListenIp}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${monitor_sip_objectId27} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${monitor_sip_objectId28} ${monitor_sip_objectId29} ${monitor_sip_policyId18} # # 调用关键字 提取应答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 sleep 5 VerifySecurity--Monitor-SIP-00001-3 [Tags] Verify #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "test33"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "test12"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${voipCallIp}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${voipListenIp}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${monitor_sip_objectId30} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${monitor_sip_objectId31} ${monitor_sip_objectId32} ${monitor_sip_policyId19} # # 调用关键字 提取应答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 sleep 5 VerifySecurity--Monitor-SIP-000012 #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "hbntest4m12"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "hbntest3m12"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"6666","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} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${monitor_sip_objectId9} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${monitor_sip_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 sleep 5 VerifySecurity--Monitor-SIP-000013 #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "hbntest3m13"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "51406kkkk"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"1.1.1.1","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${monitor_sip_objectId10} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${monitor_sip_objectId11} ${monitor_sip_objectId12} ${monitor_sip_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 sleep 5 VerifySecurity--Monitor-SIP-000014 #新增策略验证1 #创建attributes中的字典 ${from} Create Dictionary attributeType=string attributeName=originator appId=120 appName=SIP protocol=SIP attributeValue={"string": "hbntest3m14"} ${to} Create Dictionary attributeType=string attributeName=responder appId=120 appName=SIP protocol=SIP attributeValue={"string": "51406kkkk"} ${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "120"} ${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"} ${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP2}","port":"6666","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"} ${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"${testClentIP3}","port":"7777","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"} # 合成attributes字典集 ${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${to} ${from} ${verifySession} Create Dictionary attributes=${attributes} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} log ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList} # 打印检查结果 ${objectid_verify} Set Variable ${monitor_sip_objectId13} ${objectid_verify} Catenate SEPARATOR=, ${objectid_verify} ${monitor_sip_objectId14} ${monitor_sip_objectId15} ${monitor_sip_objectId16} ${monitor_sip_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 sleep 5