*** Settings *** Test Teardown run keywords Delete-Proxy-estimate ${PolicyName} ... AND Delete-object-estimate ${ObjName} Force Tags tsg-ui objects security Resource ../../../02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot Resource ../../../02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot Library OperatingSystem Resource ../../../02-Keyword/tsg_ui/Menu.robot Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot Resource ../../../02-Keyword/tsg_ui/objects/NewObject.robot Resource ../../../03-Variable/bifangapivariable.txt *** Test Cases *** ProxyPolicy-Deny-HTTP-MaxCombination-Drop-403 #新建对象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 #新建策略 Comment 新建策略 Menu policys Proxy Policy ProxyPolicy.CreateButton ProxyPolicy.Create-name ProxyPolicy-Deny-HTTP-MaxCombination ProxyPolicy.Create-action deny ProxyPolicy.Create-Source-Button SourceAndDestination.Create-Source policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 ProxyPolicy.Create-Destination-Button SourceAndDestination.Create-Destination policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 ${ipname} create list zdhip001 zdhip001 ${hostname} create list zdhfqdn ${urlname} create list zdhurl ${RequestHeadername} create list zdhreqck zdhrequa ${ResponseHeadername} create list zdhressck zdhresct ${RequestContentname} create list zdhreqcontent ${ObjName} create dictionary FQDN=${hostname} URL=${urlname} HTTPSignature=${RequestHeadername} HTTPSignature=${ResponseHeadername} Key=${RequestContentname} #IP=${ipname} IP=${ipname} ${PolicyName} set variable SecurityPolicy-Deny-HTTP-MaxCombination ${filter} create list Host URL Request Header Response Header Request Content ProxyPolicy.Create-Filter Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername} ... Request Contentname=${RequestContentname} Deny-subaction action=deny denycode=403 Deny-content contenttype=File SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html LogSession 1 LogOptions 1 Enabled open Proxy-Policies-OK sleep ${sleep} #修改策略,修改策略相当于再进行一遍新增 Comment 修改策略 Proxy-Source Name ProxyPolicy-Deny-HTTP-MaxCombination EditButton Initialize-Policie Deny #新建策略 ProxyPolicy.Create-name ProxyPolicy-Deny-MaxCombination-403 ProxyPolicy.Create-action deny ProxyPolicy.Create-Source-Button SourceAndDestination.Create-Source policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.2 post=1 ProxyPolicy.Create-Destination-Button SourceAndDestination.Create-Destination policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.3 post=1 ${filter} create list Host URL Request Header Response Header Request Content ProxyPolicy.Create-Filter Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername} ... Request Contentname=${RequestContentname} Deny-subaction action=deny denycode=404 Deny-content contenttype=File SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html LogSession 1 LogOptions 1 Enabled open Proxy-Policies-OK Proxy-Source Name ProxyPolicy-Deny-MaxCombination-403 ${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p Should Be Equal As Strings ${text} ProxyPolicy-Deny-MaxCombination-403 ${PolicyName} set variable ProxyPolicy-Deny-MaxCombination-403