From 1f787fded05be4d789742e2c04ed199a424fd48f Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Tue, 18 Aug 2020 15:06:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A0=E4=B8=BA=EF=BC=8Ccl=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E5=92=8C=E4=BF=A1=E6=81=AF=E6=B8=AF=E7=BD=91=E7=BB=9C=E7=9B=B8?= =?UTF-8?q?=E9=80=9A=EF=BC=8C=E4=BF=A1=E6=81=AF=E6=B8=AF=E4=BD=9C=E4=B8=BA?= =?UTF-8?q?cl=E5=A4=96=E7=BD=91=E6=9C=8D=E5=8A=A1=EF=BC=8C=E6=89=80?= =?UTF-8?q?=E4=BB=A5120UIAPI=E5=9C=B0=E5=9D=80=E4=BD=9C=E4=B8=BA=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E6=94=BE=E8=A1=8C=E9=81=BF=E5=85=8D=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E7=AD=96=E7=95=A5=E4=B8=8B=E5=8F=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multi_step/a_Allow_Allow_120UIAPI.robot | 27 +++++++++++++++++++ .../multi_step/a_Allow_Http_Tests.robot | 22 +++++++-------- 2 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 01-TestCase/tsg_adc/multi_step/a_Allow_Allow_120UIAPI.robot diff --git a/01-TestCase/tsg_adc/multi_step/a_Allow_Allow_120UIAPI.robot b/01-TestCase/tsg_adc/multi_step/a_Allow_Allow_120UIAPI.robot new file mode 100644 index 0000000..9621aed --- /dev/null +++ b/01-TestCase/tsg_adc/multi_step/a_Allow_Allow_120UIAPI.robot @@ -0,0 +1,27 @@ +*** 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 + +*** Test Cases *** +SecurityPolicy-Allow-UIAPI + [Tags] uiallow + ${addItemList1} Create Dictionary isSession=endpoint ip=192.168.40.120/32 port=0-0 direction=0 protocol=0 isInitialize=0 + #可以添加多个 + ${addItemLists} Create list ${addItemList1} + #objectList对象 + ${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=${addItemLists} + ${rescode} ${objectId} AddObjects ${1} ${objectDict} + Comment 创建安全策略 + ${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-120 policyType=tsg_security policyDesc=autotest action=allow destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR userRegion=${EMPTY} isValid=${1} appIdObjects=2,3 + log ${policyDict} + ${rescode} ${policyId} AddPolicies 1 ${policyDict} v2 + insert_policyId_to_file1 SecurityPolicy-Allow ${objectId} + insert_policyId_to_file1 SecurityPolicy-Allow ${policyId} + + + diff --git a/01-TestCase/tsg_adc/multi_step/a_Allow_Http_Tests.robot b/01-TestCase/tsg_adc/multi_step/a_Allow_Http_Tests.robot index 55c2b0d..1bed08c 100644 --- a/01-TestCase/tsg_adc/multi_step/a_Allow_Http_Tests.robot +++ b/01-TestCase/tsg_adc/multi_step/a_Allow_Http_Tests.robot @@ -32,14 +32,14 @@ SecurityPolicy-Allow-Http-00002 insert_policyId_to_file1 allow_http_objectId1 ${objectId} insert_policyId_to_file1 allow_http_policyId1 ${policyId} -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 创建安全策略 - ${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=2 - log ${policyDict} - ${rescode} ${policyId} AddPolicies 1 ${policyDict} v2 - insert_policyId_to_file1 allow_http_objectId2 ${objectId} - insert_policyId_to_file1 allow_http_policyId2 ${policyId} +#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 创建安全策略 +# ${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=2 +# log ${policyDict} +# ${rescode} ${policyId} AddPolicies 1 ${policyDict} v2 +# insert_policyId_to_file1 allow_http_objectId2 ${objectId} +# insert_policyId_to_file1 allow_http_policyId2 ${policyId}