2020-07-30 19:10:03 +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_bfapi/policy_object/Policy.robot
|
2020-09-07 19:23:55 +08:00
|
|
|
Resource ../../../03-Variable/ApplicationID.txt
|
2020-07-30 19:10:03 +08:00
|
|
|
|
|
|
|
|
*** Test Cases ***
|
|
|
|
|
SecurityPolicy-Allow-Http-00001
|
2020-08-10 19:07:01 +08:00
|
|
|
[Tags] fqdn右匹配
|
2020-07-30 19:10:03 +08:00
|
|
|
Comment 创建fqdn
|
|
|
|
|
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*clintonairport.com
|
|
|
|
|
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
Comment 创建安全策略
|
2020-09-07 19:23:55 +08:00
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00001 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-30 19:10:03 +08:00
|
|
|
log ${policyDict}
|
|
|
|
|
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
${policyId} Get-Pids ${policyId}
|
|
|
|
|
${policyId} Set Variable ${policyId}[0]
|
2020-07-30 19:10:03 +08:00
|
|
|
insert_policyId_to_file1 allow_http_objectId ${objectId}
|
|
|
|
|
insert_policyId_to_file1 allow_http_policyId ${policyId}
|
|
|
|
|
|
|
|
|
|
SecurityPolicy-Allow-Http-00002
|
2021-02-01 19:16:09 +08:00
|
|
|
[Tags] cat
|
2020-07-30 19:10:03 +08:00
|
|
|
Comment 创建fqdn
|
2021-02-01 19:16:09 +08:00
|
|
|
# ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.airpano.com
|
|
|
|
|
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
2020-07-30 19:10:03 +08:00
|
|
|
Comment 创建安全策略
|
2021-02-01 19:16:09 +08:00
|
|
|
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00002 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=109|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
2020-07-30 19:10:03 +08:00
|
|
|
log ${policyDict}
|
|
|
|
|
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
2021-02-01 19:16:09 +08:00
|
|
|
${policyId} Get-Pids ${policyId}
|
|
|
|
|
${policyId} Set Variable ${policyId}[0]
|
|
|
|
|
#insert_policyId_to_file1 allow_http_objectId1 ${objectId}
|
2020-08-18 09:32:49 +08:00
|
|
|
insert_policyId_to_file1 allow_http_policyId1 ${policyId}
|
|
|
|
|
|
2021-02-01 19:16:09 +08:00
|
|
|
|
2020-08-18 15:06:05 +08:00
|
|
|
#SecurityPolicy-Allow-Http-00003
|
|
|
|
|
# [Tags] cat完整匹配
|
|
|
|
|
# Comment 创建fqdn
|
|
|
|
|
# ${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$192.168.40.120
|
|
|
|
|
# ${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
|
|
|
|
# Comment 创建安全策略
|
2020-09-07 19:23:55 +08:00
|
|
|
# ${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Http-00003 policyType=tsg_security policyDesc=autotest action=allow userRegion={"protocol":"HTTP"} filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${SSL_ID}
|
2020-08-18 15:06:05 +08:00
|
|
|
# log ${policyDict}
|
|
|
|
|
# ${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
|
|
|
|
# insert_policyId_to_file1 allow_http_objectId2 ${objectId}
|
|
|
|
|
# insert_policyId_to_file1 allow_http_policyId2 ${policyId}
|