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
dongxiaoyan 3ca0cee707 修改UIPolicy.robot:
1、重复方法重命名,Profile-SearchorCreate_bak、Deny-Redirect_bak,@刘远方确认无用后删除;
2、修改获取list参数方法,消除错误;
目前镩子问题:
Test-UIAddPolicies用例跑不通。
2021-03-01 13:51:24 +08:00

79 lines
6.1 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 zdhfqdn keywordtext=*www.baidu.com
# #新建对象url
# Comment 新建对象url
# CreatePage URL single zdhurl keywordtext=*.com
# #新建Request Header
# Comment Request Header
# #新建cookie
# CreatePage HTTPSignature single zdhreqck reqrestype=req reqresheader=ck keywordtext=1234@#%
# #新建ua
# CreatePage HTTPSignature single zdhrequa reqrestype=req reqresheader=ua keywordtext=*скрипцияк
# #新建Response Header
# Comment Response Header
# #新建set cookie
# CreatePage HTTPSignature single zdhressck reqrestype=res reqresheader=sck keywordtext=1234@#%
# #新建ct
# CreatePage HTTPSignature single zdhresct reqrestype=res reqresheader=ct keywordtext=text*
# #新建Request Content
# Comment Request Content
# #新建Request Content
# CreatePage Key single zdhreqcontent keywordtext=*pppp
${hostname} create list zdhfqdn
${urlname} create list zdhurl
${RequestHeadername} create list zdhreqck zdhrequa
${ResponseHeadername} create list zdhressck zdhresct
${RequestContentname} create list zdhreqcontent
${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}
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}