From 32013269b2c6f803dbb4003bebb39a2bc17470fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=AC=E5=B7=8D=E5=B7=9D?= Date: Wed, 20 May 2020 19:07:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=89=E5=85=A8=E7=AD=96?= =?UTF-8?q?=E7=95=A5allow=E5=8A=A8=E4=BD=9Cdns=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Api_Security/Allow_DNS_Tests.robot | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 01-TestCase/tsg_adc/selfserver/Api_Security/Allow_DNS_Tests.robot diff --git a/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_DNS_Tests.robot b/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_DNS_Tests.robot new file mode 100644 index 0000000..d1d1f23 --- /dev/null +++ b/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_DNS_Tests.robot @@ -0,0 +1,35 @@ +*** Settings *** +Test Teardown DeletePolicyAndObject ${policyIds} ${objectids} +Force Tags tsg_adc 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_bfapi/ApiRequest.robot +Library Custometest + +*** Variables *** +${policyIds} ${EMPTY} +${objectids} ${EMPTY} + +*** Test Cases *** +SecurityPolicy-Allow-DNS-00001 + [Tags] selfserver monitor dns + Comment 创建安全策略 + ${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "DNS"} isValid=${1} appObjectIdArray=4 + ${rescode} ${policyId} AddPolicy2 ${1} ${policyDict} + #删除策略 + ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]} + Comment 功能端验证HTTP验证 + ${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.yhd.com + ... ELSE set variable nslookup -d www.yhd.com + ${stringlist} run keyword if '${systemType}'=='Windows' Create List canonical name = www.yhd.com + ... ELSE Create List canonical name = www.yhd.com + ${starttime} Get Time + Sleep ${policyVerificationSleepSeconds}s + ${rescode} SystemCommands ${commandstr} ${stringlist} + Sleep ${policyLogVerificationSleepSeconds}s + ${endtime} Get Time + #日志验证 + ${s} Convert to String ${policyId} + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_sled_ip 192.168.40.161