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/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot

86 lines
6.8 KiB
Plaintext

*** Settings ***
Library Selenium2Library
Resource ../objects/NewObjectPages.robot
Resource ../objects/NewObject.robot
Resource ../Menu.robot
Resource ../../../03-Variable/PolicyObjectDefault.txt
Resource ../../../02-Keyword/tsg_ui/policy/UIPolicy.robot
*** Test Cases ***
Test-UIAddPolicies
# #新建对象fqdn
# Comment 新建对象fqdn
# CreatePage FQDN single ${TEST NAME}_FQDN keywordtext=*www.baidu.com
# #新建对象url
# Comment 新建对象url
# CreatePage URL single ${TEST NAME}_URL keywordtext=*.com
# #新建Request Header
# Comment Request Header
# #新建cookie
# CreatePage HTTPSignature single ${TEST NAME}_REQCK reqrestype=req reqresheader=ck keywordtext=1234@#%
# #新建ua
# CreatePage HTTPSignature single ${TEST NAME}_REQUA reqrestype=req reqresheader=ua keywordtext=*скрипцияк
# #新建Response Header
# Comment Response Header
# #新建set cookie
# CreatePage HTTPSignature single ${TEST NAME}_RESSCK reqrestype=res reqresheader=sck keywordtext=1234@#%
# #新建ct
# CreatePage HTTPSignature single ${TEST NAME}_RESCT reqrestype=res reqresheader=ct keywordtext=text*
# #新建Request Content
# Comment Request Content
# #新建Request Content
# CreatePage Key single ${TEST NAME}_REQCONT keywordtext=*pppp
${hostname} create list ${TEST NAME}_FQDN
# ${urlname} create list ${TEST NAME}_URL
# ${RequestHeadername} create list ${TEST NAME}_REQCK ${TEST NAME}_REQUA
# ${ResponseHeadername} create list ${TEST NAME}_RESSCK ${TEST NAME}_RESCT
# ${RequestContentname} create list ${TEST NAME}_REQCONT
# ${filter} create list Host URL Request Header Response Header Request Content
# ${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny PolicySubAction=RST ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
# ${sip1} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Address Name=${TEST NAME}_IP1 Ipclienttext1=192.168.40.11-192.168.40.110 Port=1-65535
# ${ip_name} create list ${TEST NAME}_IP1
# ${sip2} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Group Name=${TEST NAME}_IPGroup1 ObjectName=${ip_name}
# ${Country} create list Botswana
# ${City} create list Dekar
# ${sgeo1} Create Dictionary Sordtype=Source Type1=Geography CreateOrSearch=Create Add=Address Name=${TEST NAME}_Geo1 Country=${Country} City=${City}
# ${sgeo_name} create list ${TEST NAME}_Geo1
# ${sgeo2} Create Dictionary Sordtype=Source Type1=Geography CreateOrSearch=Create Add=Group Name=${TEST NAME}_GeoGroup1 ObjectName=${sgeo_name}
# ${slearn1} Create Dictionary Sordtype=Source Type1=IPLearning CreateOrSearch=Create Add=Address Name=${TEST NAME}_Learn1 Fqdn=*www.baidu.com Protocols1=HTTP Degree=2Degrees Limits=10000 Numbers=1 Times=10000
# ${slearn2} Create Dictionary Sordtype=Source Type1=IPLearning CreateOrSearch=Create Add=Address Name=${TEST NAME}_Learn2 Fqdn=*www.baidu.com Protocols1=HTTPSSL Degree=1Degrees Limits=10000 Numbers=1 Times=72
# ${ssub1} Create Dictionary Sordtype=Source Type1=SUBID CreateOrSearch=Create Add=Address Name=${TEST NAME}_Subid1 Keywordtext=$test25
# ${sub_name} create list ${TEST NAME}_Subid1
# ${ssub2} Create Dictionary Sordtype=Source Type1=SUBID CreateOrSearch=Create Add=Group Name=${TEST NAME}_Subid2 ObjectName=${sub_name}
# ${sourceAddIpList} Create List ${sip1} ${sip2} ${slearn1} ${slearn2} ${ssub1} ${ssub2} ${sgeo1} ${sgeo2}
# ${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
# ${ip_name1} create list ${TEST NAME}_IP1 ${TEST NAME}_IPGroup1
# ${sgeo_name1} create list ${TEST NAME}_Geo1 ${TEST NAME}_GeoGroup1
# ${slearn_name1} create list ${TEST NAME}_Learn1 ${TEST NAME}_Learn2
# ${sub_name1} create list ${TEST NAME}_Subid1 ${TEST NAME}_Subid2
# ${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
# ${dsgeo} Create Dictionary Sordtype=Destination Type1=Geography CreateOrSearch=Search ObjectName=${sgeo_name1}
# ${dslearn} Create Dictionary Sordtype=Destination Type1=IPLearning CreateOrSearch=Search ObjectName=${slearn_name1}
# ${destinationAddIpList} Create List ${dip1} ${dsgeo} ${dslearn}
# ${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList}
# ${filterInfo} Create Dictionary Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername}
# ... Request Contentname=${RequestContentname}
# UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
${editpolicyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyEditName=${TEST NAME}_Edit PolicyAction=Deny PolicySubAction=Drop ApplicationSearch=HTTP,SSL ApplicationFilter=SSL PolicyLogSession=1 PolicyEnabled=open
${editfilrer} create list SNI
${editfilterInfo} Create Dictionary Filter=${editfilrer} SSLSNIname=${hostname}
UIUpdataPolicies ${editpolicyInfo} EditFilterInfo=${editfilterInfo}
PoliciesDelete
Test-UIAddPolicies-Block
# #新建对象fqdn
Comment 新建对象fqdn
log ${TEST NAME}
CreatePage FQDN single ${TEST NAME}_FQDN keywordtext=*travelgam.com
${hostname} create list ${TEST NAME}_FQDN
${filter} create list Host
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny PolicySubAction=Block ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
${filterInfo} Create Dictionary Filter=${filter} Hostname=${hostname}
${subactionadd} Create Dictionary Code=403 Content=TEXT BlockText=${TEST NAME}_403
#${subactionadd} Create Dictionary code=403 Content=Profile SearchorCreate=Search ProfileName=${TEST NAME}_ProfileName file=
UIAddPolicies ${policyInfo} FilterInfo=${filterInfo} Subactionadd=${subactionadd}