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_adc/multi_step/a_Deny_Ssl_Tests.robot
2020-07-06 19:11:52 +08:00

59 lines
3.7 KiB
Plaintext

*** Settings ***
Force Tags tsg_adc_wp adc_api security_policy
Library OperatingSystem
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
*** Test Cases ***
SecurityPolicy-Deny-Ssl-00001
[Tags] sni fqdn
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.cxwl.com,*freestockimages.ru
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"rst"} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=3
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 deny_ssl_objectId ${objectId}
insert_policyId_to_file1 deny_ssl_policyId ${policyId}
SecurityPolicy-Deny-Ssl-00002
[Tags] cn cat
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*vip.com,*berkeleygroup.co.uk
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"rst"} filterList=${objectId}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=3
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 deny_ssl_objectId1 ${objectId}
insert_policyId_to_file1 deny_ssl_policyId1 ${policyId}
SecurityPolicy-Deny-Ssl-00003
[Tags] san cat
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*pulitzer.org,*nastol.com.ua
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId}|TSG_FIELD_SSL_SAN isValid=${1} appIdObjects=3
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 deny_ssl_objectId2 ${objectId}
insert_policyId_to_file1 deny_ssl_policyId2 ${policyId}
SecurityPolicy-Deny-Ssl-00004
[Tags] 最大组合
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*prlib.ru
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Ssl-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"SSL","method":"drop"} filterList=${objectId}|TSG_FIELD_SSL_SAN,${objectId}|TSG_FIELD_SSL_SNI,${objectId}|TSG_FIELD_SSL_CN isValid=${1} appIdObjects=3
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 deny_ssl_objectId3 ${objectId}
insert_policyId_to_file1 deny_ssl_policyId3 ${policyId}