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_ui/ui_security/Security_Voip.robot
2021-03-03 10:22:00 +08:00

295 lines
17 KiB
Plaintext

*** Settings ***
Library Selenium2Library
Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot
Resource ../../../02-Keyword/tsg_ui/objects/NewObject.robot
Resource ../../../02-Keyword/tsg_ui/Menu.robot
Resource ../../../03-Variable/PolicyObjectDefault.txt
Resource ../../../02-Keyword/tsg_ui/policy/UIPolicy.robot
*** Test Cases ***
#######################################Allow###################################################
SecuritySIPAllow
[Tags] Positive UI Security Policies SIP Allow
Comment 新建对象fqdn
log ${TEST NAME}
CreatePage Account single SecurityVoip_Accounts keywordtext=*travelgam.com
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${filter} create list From To
${fromname} create list SecurityVoip_Accounts
${toname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Fromname=${fromname} Toname=${toname}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Address Name=SecurityVoip_IP Ipclienttext1=192.168.40.11-192.168.40.110 Port=1-65535
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Allow ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
PoliciesDelete
SecurityRTPAllow
[Tags] Positive UI Security Policies RTP Allow
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Allow ApplicationSearch=RTP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo}
PoliciesDelete
SecuritySIPAndRTPAllow
[Tags] Positive UI Security Policies SIPAndRTP Allow
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Allow ApplicationSearch=RTP,SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo}
PoliciesDelete
SecuritySIPAllowFilter-From
[Tags] Positive UI Security Policies SIP Allow
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${filter} create list From
${fromname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Fromname=${fromname}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Allow ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
PoliciesDelete
SecuritySIPAllowFilter-To
[Tags] Positive UI Security Policies SIP Allow
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${filter} create list To
${toname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Toname=${toname}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Allow ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
PoliciesDelete
###############################Deny#########################################
SecuritySIPDeny
[Tags] Positive UI Security Policies SIP Deny
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo}
PoliciesDelete
SecurityRTPDeny
[Tags] Positive UI Security Policies RTP Deny
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny ApplicationSearch=RTP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo}
PoliciesDelete
SecuritySIPAndRTPDeny
[Tags] Positive UI Security Policies SIPAndRTP Deny
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny ApplicationSearch=SIP,RTP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo}
PoliciesDelete
SecuritySIPDenyFilter-FromAndTo
[Tags] Positive UI Security Policies SIP Deny
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${filter} create list From To
${toname} create list SecurityVoip_Accounts
${fromname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Fromname=${fromname} Toname=${toname}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
PoliciesDelete
SecuritySIPDenyFilter-From
[Tags] Positive UI Security Policies SIP Deny
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${filter} create list From
${toname} create list SecurityVoip_Accounts
${fromname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Fromname=${fromname}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
PoliciesDelete
SecuritySIPDenyFilter-To
[Tags] Positive UI Security Policies SIP Deny
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${filter} create list To
${toname} create list SecurityVoip_Accounts
${fromname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Toname=${fromname}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
PoliciesDelete
SecuritySIPDenyBlock-480
[Tags] Positive UI Security Policies SIP Deny
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${filter} create list From To
${toname} create list SecurityVoip_Accounts
${fromname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Fromname=${fromname} Toname=${toname}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny PolicySubAction=Block ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
${subactionadd} Create Dictionary Code=480
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo} Subactionadd=${subactionadd}
PoliciesDelete
SecuritySIPDenyBlock-500
[Tags] Positive UI Security Policies SIP Deny
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${filter} create list From To
${toname} create list SecurityVoip_Accounts
${fromname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Fromname=${fromname} Toname=${toname}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny PolicySubAction=Block ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
${subactionadd} Create Dictionary Code=500
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo} Subactionadd=${subactionadd}
PoliciesDelete
################################# Monitor######################################
SecuritySIPMonitor
[Tags] Positive UI Security Policies SIP Monitor
${ip_name1} create list SecurityVoip_IP
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
${sip} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${sourceAddIpList} Create List ${sip}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Monitor ApplicationSearch=SIP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo}
PoliciesDelete
test
Menu policys Security Policy
Security-Source Name SecuritySIPAllow
PoliciesDelete
# 删除object
Menu objects Account
ui-object-search-name ${TEST NAME}_Accounts
objects-delete
${filter} create list From To
${toname} create list SecurityVoip_Accounts
${fromname} create list SecurityVoip_Accounts
${filterInfo} Create Dictionary Filter=${filter} Fromname=${fromname} Toname=${toname}