添加安全策略allow动作mail用例
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user