From 0f25501a4d2d40a9767a96583b8f2b8f803f7601 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:50 +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=9Cftp=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Api_Security/Allow_Ftp_Tests.robot | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 01-TestCase/tsg_adc/selfserver/Api_Security/Allow_Ftp_Tests.robot diff --git a/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_Ftp_Tests.robot b/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_Ftp_Tests.robot new file mode 100644 index 0000000..f275600 --- /dev/null +++ b/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_Ftp_Tests.robot @@ -0,0 +1,32 @@ +*** 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-Ftp-00001 + [Tags] selfserver monitor ftp + Comment 创建安全策略 + ${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-FTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"FTP"} isValid=${1} appObjectIdArray=6 + ${rescode} ${policyId} AddPolicy2 ${1} ${policyDict} + #删除策略 + ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]} + Comment 功能端验证 + ${starttime} Get Time + Sleep ${policyVerificationSleepSeconds}s + ${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test + should contain ${FTP} ftp_success + Sleep ${policyLogVerificationSleepSeconds}s + ${endtime} Get Time + #日志验证 + ${s} Convert to String ${policyId} + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_server_ip 192.168.100.5