This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_adc/multi_step/a_Deny_Mail_Tests.robot
2021-05-17 13:24:29 +06:00

409 lines
31 KiB
Plaintext

*** Settings ***
Force Tags tsg_adc_wp adc_api 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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
# Resource ../../../03-Variable/ApplicationID.txt
*** Test Cases ***
SecurityPolicy-Deny-Mail-00001
[Tags] content字串匹配 update:ip geo,Content
Comment 创建Content1
${addItemList1} Create Dictionary keywordArray=стопо isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Content_Id} AddObjects ${1} ${objectDict}
Comment 创建ip geo
${addItemList1} Create Dictionary keywordArray=XXG地区.*
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=ip objectSubType=geo_location isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId} AddObjects ${1} ${objectDict}
Comment 创建Content2
${addItemList1} Create Dictionary keywordArray=$Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Content_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"drop"} filterList=${object_Content_Id}|TSG_FIELD_MAIL_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
#userRegion={"protocol":"MAIL","method":"block","code":550}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId ${object_Content_Id}
insert_policyId_to_file1 deny_mail_objectId32 ${objectId}
insert_policyId_to_file1 deny_mail_objectId33 ${object_Content_Id1}
insert_policyId_to_file1 deny_mail_policyId ${policyId}
SecurityPolicy-Deny-Mail-00002
[Tags] att_cont字串匹配 update:att_cont
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=BigTitle isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建ATT_CONT1
${addItemList1} Create Dictionary keywordArray=Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ATT_CONT_Id} AddObjects ${1} ${objectDict}
Comment 创建ATT_CONT2
${addItemList1} Create Dictionary keywordArray=$姬巍川测试文件内容Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ATT_CONT_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"drop"} filterList=${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId39 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId34 ${object_ATT_CONT_Id1}
insert_policyId_to_file1 deny_mail_objectId1 ${object_ATT_CONT_Id}
insert_policyId_to_file1 deny_mail_policyId1 ${policyId}
SecurityPolicy-Deny-Mail-00003
[Tags] from右匹配 subject右匹配 update: from,subject
Comment 创建Subject1
${addItemList1} Create Dictionary keywordArray=*ОВИДЕО isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From1
${addItemList1} Create Dictionary keywordArray=*163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建Subject2
${addItemList1} Create Dictionary keywordArray=ОВИДЕО isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id1} AddObjects ${1} ${objectDict}
Comment 创建From2
${addItemList1} Create Dictionary keywordArray=163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id1} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId2 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId3 ${object_From_Id}
insert_policyId_to_file1 deny_mail_objectId35 ${object_Subject_Id1}
insert_policyId_to_file1 deny_mail_objectId36 ${object_From_Id1}
insert_policyId_to_file1 deny_mail_policyId2 ${policyId}
SecurityPolicy-Deny-Mail-00004
[Tags] from完整匹配 subject完整匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$明天周末 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=$hebingning2021@163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId4 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId5 ${object_From_Id}
insert_policyId_to_file1 deny_mail_policyId3 ${policyId}
SecurityPolicy-Deny-Mail-00005
[Tags] subject字串匹配 from字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=12345678 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=hebingning isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00005 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId6 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId7 ${object_From_Id}
insert_policyId_to_file1 deny_mail_policyId4 ${policyId}
SecurityPolicy-Deny-Mail-00006
[Tags] subject左匹配 from左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=afte* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=hebing* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00006 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId8 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId9 ${object_From_Id}
insert_policyId_to_file1 deny_mail_policyId5 ${policyId}
SecurityPolicy-Deny-Mail-00007
[Tags] to右匹配 subject左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=*ыонлай isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=*ks.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00007 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId10 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId11 ${object_To_Id}
insert_policyId_to_file1 deny_mail_policyId6 ${policyId}
SecurityPolicy-Deny-Mail-00008
[Tags] to完整匹配 subject完整匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$zxcvbnm isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=$hebingning@geedgenetworks.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00008 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId12 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId13 ${object_To_Id}
insert_policyId_to_file1 deny_mail_policyId7 ${policyId}
SecurityPolicy-Deny-Mail-00009
[Tags] to字串匹配 subject字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=新的一天 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=hebingning isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00009 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId14 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId15 ${object_To_Id}
insert_policyId_to_file1 deny_mail_policyId8 ${policyId}
SecurityPolicy-Deny-Mail-00010
[Tags] subject左匹配 to左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=tomor* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=hebing* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00010 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_To_Id}|TSG_FIELD_MAIL_TO,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId16 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId17 ${object_To_Id}
insert_policyId_to_file1 deny_mail_policyId9 ${policyId}
SecurityPolicy-Deny-Mail-00011
[Tags] subject右匹配 account右匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=*发送失败 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=*2021@163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00011 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId18 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId19 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId10 ${policyId}
SecurityPolicy-Deny-Mail-00012
[Tags] subject完整匹配 account完整匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$Онлайнфильмывхоро isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=$hebingning2021@163.com isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00012 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId20 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId21 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId11 ${policyId}
SecurityPolicy-Deny-Mail-00013
[Tags] subject字串匹配 account字串匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=asdfg isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=hebingning2021@ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00013 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId22 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId23 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId12 ${policyId}
SecurityPolicy-Deny-Mail-00014
[Tags] subject左匹配 account左匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=马上就要* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=hebingning* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00014 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId24 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId25 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId13 ${policyId}
SecurityPolicy-Deny-Mail-00015
[Tags] 最大组合
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=$人生路远及时行乐 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=hebingning* isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建Content
${addItemList1} Create Dictionary keywordArray=good isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Content_Id} AddObjects ${1} ${objectDict}
Comment 创建ATT_CONT
${addItemList1} Create Dictionary keywordArray=Простопорно isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_ATT_CONT_Id} AddObjects ${1} ${objectDict}
Comment 创建From
${addItemList1} Create Dictionary keywordArray=hebing isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_From_Id} AddObjects ${1} ${objectDict}
Comment 创建To
${addItemList1} Create Dictionary keywordArray=geedge isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_To_Id} AddObjects ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00015 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${object_Content_Id}|TSG_FIELD_MAIL_CONTENT,${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT,${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_To_Id}|TSG_FIELD_MAIL_TO isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId26 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId27 ${object_Content_Id}
insert_policyId_to_file1 deny_mail_objectId28 ${object_ATT_CONT_Id}
insert_policyId_to_file1 deny_mail_objectId29 ${object_From_Id}
insert_policyId_to_file1 deny_mail_objectId30 ${object_To_Id}
insert_policyId_to_file1 deny_mail_objectId31 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId14 ${policyId}
SecurityPolicy-Deny-Mail-00016
[Tags] the minimum match
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00016 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} isValid=${0} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_policyId15 ${policyId}
SecurityPolicy-Deny-Mail-00017
[Tags] content右匹配
Comment 创建Subject
${addItemList1} Create Dictionary keywordArray=denymail017 isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Subject_Id} AddObjects ${1} ${objectDict}
Comment 创建Account
${addItemList1} Create Dictionary keywordArray=hebingning2021@ isHexbin=${0}
${addItemLists} Create list ${addItemList1}
${objectDict} Create Dictionary objectType=account objectSubType=account isValid=${1} addItemList=${addItemLists}
${rescode} ${object_Account_Id} AddObjects ${1} ${objectDict}
Comment 创建Content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Deny17*
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00017 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"MAIL","method":"rst"} filterList=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${object_Content_Id}|TSG_FIELD_MAIL_CONTENT isValid=${1} appIdObjects=${MAIL_ID}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
${policyId} Get-Pids ${policyId}
${policyId} Set Variable ${policyId}[0]
insert_policyId_to_file1 deny_mail_objectId37 ${object_Subject_Id}
insert_policyId_to_file1 deny_mail_objectId38 ${object_Account_Id}
insert_policyId_to_file1 deny_mail_policyId16 ${policyId}