From da2527526a1f0fb92f472ea1aebf058e68a7dd43 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:08:16 +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=9Cmail=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Api_Security/Allow_Mail_Tests.robot | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 01-TestCase/tsg_adc/selfserver/Api_Security/Allow_Mail_Tests.robot diff --git a/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_Mail_Tests.robot b/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_Mail_Tests.robot new file mode 100644 index 0000000..c4535c7 --- /dev/null +++ b/01-TestCase/tsg_adc/selfserver/Api_Security/Allow_Mail_Tests.robot @@ -0,0 +1,45 @@ +*** 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 +Resource ../../../../03-Variable/AllFlowCaseVariable.txt +Library Custometest +Resource ../../../../02-Keyword/tsg_common/StmpHandle.robot + +*** Variables *** +${policyIds} ${EMPTY} +${objectids} ${EMPTY} + +*** Test Cases *** +SecurityPolicy-Allow-Mail-00001 + Comment 创建安全策略 + ${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Mail-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"MAIL"} isValid=${1} appObjectIdArray=5 + ${rescode} ${policyId} AddPolicy2 ${1} ${policyDict} + #删除策略 + ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]} + Comment 功能端验证 + ${starttime} Get Time + Sleep ${policyVerificationSleepSeconds}s + ${Smtp服务器} Set Variable 192.168.100.5 + ${Smtp服务器端口} Set Variable 25 + ${邮箱账号} Set Variable jwctest@mail.tsgmail.com + ${邮箱密码} Set Variable jwctest + ${邮件主题} Set Variable 123test + ${发送者} Set Variable jwctest@mail.tsgmail.com + ${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"] + ${接收者} Set Variable ["zmmtest@mail.tsgmail.com"] + ${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"] + ${密送者} Set Variable ["zmmtest@mail.tsgmail.com"] + ${邮件正文} Set Variable 朱明明content + ${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件} + Log ${发送邮件返回结果} + should contain ${发送邮件返回结果} mail_success + Sleep ${policyLogVerificationSleepSeconds}s + ${endtime} Get Time + #日志验证 + ${s} Convert to String ${policyId} + GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com