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_Intercept_Ssl_Tests.robot

70 lines
4.8 KiB
Plaintext
Raw Normal View History

2020-07-01 17:29:16 +08:00
*** 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
Resource ../../../03-Variable/ApplicationID.txt
2020-07-01 17:29:16 +08:00
2020-07-06 10:31:24 +08:00
*** Variables ***
2020-07-01 17:29:16 +08:00
*** Test Cases ***
2020-07-06 10:31:24 +08:00
SecurityPolicy-Intercept-Ssl-00001
[Tags] fqdn完整匹配 update policy:source geo
2020-07-01 17:29:16 +08:00
Comment 创建fqdn
2020-07-06 10:31:24 +08:00
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.reviewpro.com
2020-07-01 17:29:16 +08:00
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
2020-07-01 17:29:16 +08:00
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Ssl-00001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
2020-07-01 17:29:16 +08:00
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
2020-07-06 10:31:24 +08:00
insert_policyId_to_file1 intercept_ssl_objectId ${objectId}
insert_policyId_to_file1 intercept_ssl_objectId2 ${objectId1}
2020-07-06 10:31:24 +08:00
insert_policyId_to_file1 intercept_ssl_policyId ${policyId}
2020-07-01 17:29:16 +08:00
2020-07-06 10:31:24 +08:00
SecurityPolicy-Intercept-Ssl-00002
[Tags] category
# ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*momondo.ru
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
2020-07-01 17:29:16 +08:00
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Ssl-00002 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=166|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
2020-07-01 17:29:16 +08:00
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
# insert_policyId_to_file1 intercept_ssl_objectId1 ${objectId}
2020-07-06 10:31:24 +08:00
insert_policyId_to_file1 intercept_ssl_policyId1 ${policyId}
SecurityPolicy-Intercept-Ssl-00003
[Tags] fqdn other Certificate update policy:fqdn
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.xs8.cn
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建fqdn2
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*xs8.cn
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Ssl-00003 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1727,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${objectId}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 intercept_ssl_objectId1 ${objectId}
insert_policyId_to_file1 intercept_ssl_objectId3 ${objectId1}
insert_policyId_to_file1 intercept_ssl_policyId2 ${policyId}
SecurityPolicy-Intercept-Ssl-00004
[Tags] category Other Certificate to replace
# ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*momondo.ru
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-Ssl-00004 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1727,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=167|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
# insert_policyId_to_file1 intercept_ssl_objectId1 ${objectId}
insert_policyId_to_file1 intercept_ssl_policyId3 ${policyId}