提交安全策略和代理策略全流程用例

This commit is contained in:
lyf
2021-05-14 15:57:06 +08:00
parent 52e72067ff
commit 0d828fcd7a
46 changed files with 11647 additions and 6232 deletions

View File

@@ -13,11 +13,13 @@ Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Application.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-MAIL-00001
[Tags] Allow IP MAIL
Comment 创建IP
@@ -40,12 +42,11 @@ SecurityPolicy-Allow-MAIL-00001
Comment 策略验证
#新增策略验证
#创建attributes中的字典
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "110"}
${subscriberid} Create Dictionary attributeType=string attributeName=subscriberid attributeValue={"string": "test56"}
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "8004"}
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip":"${testClentIP}","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_SOURCE_ADDR"}
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip":"254.253.252.251","port":"1","addrType":4,"protocol":"6","tableName":"TSG_SECURITY_DESTINATION_ADDR"}
# 合成attributes字典集
${attributes} Create List ${app_id} ${subscriberid} ${ipsource} ${ipdestination}
${attributes} Create List ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
@@ -76,12 +77,12 @@ SecurityPolicy-Allow-MAIL-00001
${邮件正文} Set Variable Простопорно
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
... ELSE should contain ${发送邮件返回结果} fail
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} success
... ELSE should contain ${发送邮件返回结果} success
Comment 日志验证
#日志验证
${s} Convert to String ${policyIds}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account ${mailAccount163Dxy}
${returnvalue} GetLogList_new security_event_log ${starttime} ${testClentIP} ${s} mail_account mail_from_cmd
Should Be Equal As Strings ${returnvalue} true