新增安全代理策略测试用例,修改创建策略关键字

This commit is contained in:
byb11
2021-03-10 18:27:18 +08:00
parent 8e4dcabecb
commit 32e5bf77e6
3 changed files with 333 additions and 58 deletions

View File

@@ -0,0 +1,205 @@
*** Settings ***
Force Tags tsg-ui Policies Proxy
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 ***
CreateProxyAllow
[Tags] Positive UI Proxy Policies Allow
CreatePage FQDN single ProxyFQDN keywordtext=*travelgam.com
CreatePage URL single ProxyURL keywordtext=*travelgam.com
CreatePage HTTPSignature single ProxyHTTPSignature reqrestype=req reqresheader=ck keywordtext=1234@#%
${ip_name1} create list Proxy_IP
${filter} create list Host URL Request Header Response Header
${Host} create list ProxyFQDN
${URL} create list ProxyURL
${Request Header} create list ProxyHTTPSignature
${Response Header} create list ProxyHTTPSignature
${filterInfo} Create Dictionary Filter=${filter} Hostname=${Host} URLname=${URL} Request Headername=${Request Header} Response Headername=${Response Header}
${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=Create Add=Address Name=Proxy_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=Proxy Policy PolicyName=${TEST NAME} PolicyAction=Allow ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
PoliciesDelete
CreateProxyDeny
[Tags] Positive UI Proxy Policies Deny
CreatePage Key single proxykey keywordtext=Poplar Systems
${httpsignature} set variable ProxyHTTPSignature
${Key} set variable proxykey
${ip_name1} create list Proxy_IP
${filter} create list Host URL Request Header Response Header Request Content Response Content
${Host} create list ProxyFQDN
${URL} create list ProxyURL
${Request Header} create list ${httpsignature}
${Response Header} create list ${httpsignature}
${Request Content} create list ${Key}
${Response Content} create list ${Key}
${filterInfo} Create Dictionary Filter=${filter} Hostname=${Host} URLname=${URL} Request Headername=${Request Header} Response Headername=${Response Header} Request Contentname=${Request Content} Response Contentname=${Response Content}
${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=Proxy Policy PolicyName=${TEST NAME} PolicyAction=Deny ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
${ProxyDenyadd} Create Dictionary DenyCode=403 Action=Deny ContentType=TEXT TextValue=Test
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} FilterInfo=${filterInfo} ProxyDenyadd=${ProxyDenyadd}
PoliciesDelete
CreateProxyMonitor
[Tags] Positive UI Proxy Policies Monitor
${httpsignature} set variable ProxyHTTPSignature
${Key} set variable proxykey
${ip_name1} create list Proxy_IP
${filter} create list Host URL Request Header Response Header Request Content Response Content
${Host} create list ProxyFQDN
${URL} create list ProxyURL
${Request Header} create list ${httpsignature}
${Response Header} create list ${httpsignature}
${Request Content} create list ${Key}
${Response Content} create list ${Key}
${filterInfo} Create Dictionary Filter=${filter} Hostname=${Host} URLname=${URL} Request Headername=${Request Header} Response Headername=${Response Header} Request Contentname=${Request Content} Response Contentname=${Response Content}
${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=Proxy Policy PolicyName=${TEST NAME} PolicyAction=Monitor ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} FilterInfo=${filterInfo}
PoliciesDelete
CreateProxyRedirect
[Tags] Positive UI Proxy Policies Redirect
${httpsignature} set variable ProxyHTTPSignature
${Key} set variable proxykey
${ip_name1} create list Proxy_IP
${filter} create list Host URL Request Header Response Header Request Content
${Host} create list ProxyFQDN
${URL} create list ProxyURL
${Request Header} create list ${httpsignature}
${Response Header} create list ${httpsignature}
${Request Content} create list ${Key}
${HTTPRedirectadd} Create Dictionary Response Code=301 Redirect URL=https://www.vip.com
${filterInfo} Create Dictionary Filter=${filter} Hostname=${Host} URLname=${URL} Request Headername=${Request Header} Response Headername=${Response Header} Request Contentname=${Request Content}
${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=Proxy Policy PolicyName=${TEST NAME} PolicyAction=Redirect ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} FilterInfo=${filterInfo} HTTPRedirectadd=${HTTPRedirectadd}
PoliciesDelete
CreateProxyReplace
[Tags] Positive UI Proxy Policies Replace
${httpsignature} set variable ProxyHTTPSignature
${ip_name1} create list Proxy_IP
${filter} create list Host URL Request Header Response Header
${Host} create list ProxyFQDN
${URL} create list ProxyURL
${Request Header} create list ${httpsignature}
${Response Header} create list ${httpsignature}
${filterInfo} Create Dictionary Filter=${filter} Hostname=${Host} URLname=${URL} Request Headername=${Request Header} Response Headername=${Response Header}
${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=Proxy Policy PolicyName=${TEST NAME} PolicyAction=Replace ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
${ParametersType} create list HTTP Request-URI
${ReplaceActionParameters} Create Dictionary ParametersType=${ParametersType} RequestURIFind=test RequestURIReplacewith=TEXT
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} FilterInfo=${filterInfo} ReplaceActionParameters=${ReplaceActionParameters}
PoliciesDelete
CreateProxyHijack
[Tags] Positive UI Proxy Policies Hijack
${httpsignature} set variable ProxyHTTPSignature
${ip_name1} create list Proxy_IP
${filter} create list Host URL Request Header Response Header
${Host} create list ProxyFQDN
${URL} create list ProxyURL
${Request Header} create list ${httpsignature}
${Response Header} create list ${httpsignature}
${filterInfo} Create Dictionary Filter=${filter} Hostname=${Host} URLname=${URL} Request Headername=${Request Header} Response Headername=${Response Header}
${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=Proxy Policy PolicyName=${TEST NAME} PolicyAction=Hijack ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
${HijackFileadd} Create Dictionary SearchorCreate=Search Hijackname=by自动化测试勿动
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} FilterInfo=${filterInfo} HijackFileadd=${HijackFileadd}
PoliciesDelete
CreateProxyInsert
[Tags] Positive UI Proxy Policies Insert
${httpsignature} set variable ProxyHTTPSignature
${ip_name1} create list Proxy_IP
${filter} create list Host URL Request Header Response Header
${Host} create list ProxyFQDN
${URL} create list ProxyURL
${Request Header} create list ${httpsignature}
${Response Header} create list ${httpsignature}
${filterInfo} Create Dictionary Filter=${filter} Hostname=${Host} URLname=${URL} Request Headername=${Request Header} Response Headername=${Response Header}
${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=Proxy Policy PolicyName=${TEST NAME} PolicyAction=Insert ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1
${InsertScript} Create Dictionary SearchorCreate=Search Insertname=自动化-勿动
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} FilterInfo=${filterInfo} InsertScript=${InsertScript}
PoliciesDelete

View File

@@ -1,4 +1,5 @@
*** Settings ***
Force Tags tsg-ui Policies Security
Library Selenium2Library
Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot
Resource ../../../02-Keyword/tsg_ui/objects/NewObject.robot
@@ -421,18 +422,3 @@ CreateSecurityIntercept
${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Intercept ApplicationSearch=SSL PolicyLogSession=1 PolicyEnabled=1
UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo}
PoliciesDelete