提交代理deny动作的8个子串及其16进制的用例
This commit is contained in:
@@ -45,7 +45,7 @@ SecurityPolicy-Deny-Ftp-00001
|
||||
insert_policyId_to_file1 deny_ftp_objectId2 ${object_content_Id}
|
||||
insert_policyId_to_file1 deny_ftp_objectId12 ${objectId1}
|
||||
insert_policyId_to_file1 deny_ftp_objectId13 ${object_Account_Id}
|
||||
insert_policyId_to_file1 deny_ftp_objectId14 ${object_url_Id}
|
||||
insert_policyId_to_file1 deny_ftp_objectId14 ${object_url_Id1}
|
||||
insert_policyId_to_file1 deny_ftp_objectId15 ${object_content_Id}
|
||||
insert_policyId_to_file1 deny_ftp_policyId ${policyId}
|
||||
|
||||
|
||||
@@ -304,3 +304,23 @@ SecurityPolicy-Deny-Mail-00016
|
||||
${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
|
||||
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=denymail017
|
||||
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建Account
|
||||
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=hebingning2021@
|
||||
${rescode} ${object_Account_Id} AddObject2 ${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}
|
||||
|
||||
@@ -574,5 +574,45 @@ Proxy-Policy-deny-00018
|
||||
insert_policyId_to_file1 intercept_deny_policyId14 ${policyId1}
|
||||
insert_policyId_to_file1 deny_policyId16 ${policyId2}
|
||||
|
||||
Proxy-Policy-deny-00018
|
||||
Proxy-Policy-deny-00019
|
||||
[Tags] substring
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.cndns.com
|
||||
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=www.cndns.com/cn/sms/index.aspx
|
||||
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
|
||||
Comment keyword8个子串,创建应答体
|
||||
${addItemList1} Create Dictionary keywordArray=美橙短信,短信群发,到达率更强,企业营销类,短信验证,群发服务,正规106网关,联通全面 isHexbin=${0}
|
||||
${addItemLists} Create list ${addItemList1}
|
||||
${objectDict} Create Dictionary objectType=keywords objectSubType=keywords isValid=${1} addItemList=${addItemLists}
|
||||
${rescode} ${object_res_cont_Id} AddObjects ${1} ${objectDict}
|
||||
Comment user-agent8个子串,创建请求头
|
||||
${addItemList1} Create Dictionary keywordArray=4d6f7a696c6c612f352e30,57696e646f7773,57696e3634,783634,4170706c65,65624b6974,4b48544d4c,6c696b65 isHexbin=${1} district=User-Agent
|
||||
${addItemLists} Create list ${addItemList1}
|
||||
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
|
||||
${rescode} ${object_ua_Id} AddObjects ${1} ${objectDict}
|
||||
Comment cont-Type8个子串,创建应答头
|
||||
${addItemList1} Create Dictionary keywordArray=7465,78742f,6874,6d6c,68746d6c,63686172,736574,63686172736574 isHexbin=${1} district=Content-Type
|
||||
${addItemLists} Create list ${addItemList1}
|
||||
${objectDict} Create Dictionary objectType=http_signature objectSubType=http_signature isValid=${1} addItemList=${addItemLists}
|
||||
${rescode} ${object_ct_Id} AddObjects ${1} ${objectDict}
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-deny-0019 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} filterList=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appIdObjects=${SSL_ID}
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId1} AddPolicies 1 ${policyDict} v2
|
||||
${policyId1} Get-Pids ${policyId1}
|
||||
${policyId1} Set Variable ${policyId1}[0]
|
||||
Comment 创建deny策略
|
||||
${policyDict} Create Dictionary policyName=Proxy-Policy-deny-00019 policyType=pxy_manipulation policyDesc=autotest action=deny userRegion={"method":"block","message":"涨涨涨涨","code":404,"protocol":"HTTP"} filterList=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_ua_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_res_cont_Id}|TSG_FIELD_HTTP_RES_CONTENT,${object_ct_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appIdObjects=${HTTP_ID}
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
|
||||
${policyId2} Get-Pids ${policyId2}
|
||||
${policyId2} Set Variable ${policyId2}[0]
|
||||
insert_policyId_to_file1 deny_objectId60 ${object_fqdn_Id}
|
||||
insert_policyId_to_file1 deny_objectId61 ${object_url_Id}
|
||||
insert_policyId_to_file1 deny_objectId62 ${object_res_cont_Id}
|
||||
insert_policyId_to_file1 deny_objectId63 ${object_ua_Id}
|
||||
insert_policyId_to_file1 deny_objectId64 ${object_ct_Id}
|
||||
insert_policyId_to_file1 intercept_deny_policyId18 ${policyId1}
|
||||
insert_policyId_to_file1 deny_policyId18 ${policyId2}
|
||||
|
||||
@@ -298,3 +298,23 @@ SecurityPolicy-Monitor-Mail-00015
|
||||
insert_policyId_to_file1 monitor_mail_objectId30 ${object_To_Id}
|
||||
insert_policyId_to_file1 monitor_mail_objectId31 ${object_Account_Id}
|
||||
insert_policyId_to_file1 monitor_mail_policyId14 ${policyId}
|
||||
|
||||
SecurityPolicy-Monitor-Mail-00016
|
||||
[Tags] content右匹配
|
||||
Comment 创建Subject
|
||||
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=monitorMail16
|
||||
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建Account
|
||||
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=hebingning
|
||||
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建Content
|
||||
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Monitor16*
|
||||
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00016 policyType=tsg_security policyDesc=autotest action=monitor userRegion={"protocol":"MAIL"} 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 monitor_mail_objectId38 ${object_Subject_Id}
|
||||
insert_policyId_to_file1 monitor_mail_objectId39 ${object_Account_Id}
|
||||
insert_policyId_to_file1 monitor_mail_policyId15 ${policyId}
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -15,7 +15,7 @@ SecurityPolicy-Deny-Http-00001
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00001.bat
|
||||
... ELSE set variable curl -m 10 -kv http://www.lkong.net/forum.php
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection was reset
|
||||
... ELSE Create List timed out
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Comment 改变阻断策略
|
||||
${policyDict} Create Dictionary policyId=${deny_http_policyId} source=${deny_http_objectId35}|TSG_SECURITY_SOURCE_LOCATION policyName=SecurityPolicy-Deny-Http-00001-1 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${deny_http_objectId36}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=${HTTP_ID}
|
||||
@@ -92,7 +92,7 @@ SecurityPolicy-Deny-Http-00005
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00005.bat
|
||||
... ELSE set variable curl -m 10 -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \http://www.abchina.com/cn/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection was reset
|
||||
... ELSE Create List timed out
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
|
||||
SecurityPolicy-Deny-Http-00006
|
||||
@@ -148,7 +148,7 @@ SecurityPolicy-Deny-Http-00010
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00010.bat
|
||||
... ELSE set variable curl -m 10 -kv http://www.avaxsearch.com/tangkas/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
|
||||
... ELSE Create List Connection reset by peer
|
||||
... ELSE Create List timed out
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Comment 改变阻断策略
|
||||
${policyDict} Create Dictionary policyId=${deny_http_policyId9} policyName=SecurityPolicy-Deny-Http-00010_1 destination=24849|TSG_SECURITY_DESTINATION_ADDR policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} filterList=${deny_http_objectId16}|TSG_FIELD_HTTP_RES_HDR,${deny_http_objectId15}|TSG_FIELD_HTTP_URL isValid=${1} appIdObjects=${HTTP_ID}
|
||||
@@ -158,7 +158,7 @@ SecurityPolicy-Deny-Http-00010
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00010.bat
|
||||
... ELSE set variable curl -m 10 -kv http://www.avaxsearch.com/tangkas/
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
|
||||
... ELSE Create List Connection reset by peer
|
||||
... ELSE Create List timed out
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
|
||||
SecurityPolicy-Deny-Http-00011
|
||||
@@ -166,7 +166,7 @@ SecurityPolicy-Deny-Http-00011
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00011.bat
|
||||
... ELSE set variable curl -m 10 -kv http://www.finestquotes.com/quotesbyauthors.php
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List timed out
|
||||
... ELSE Create List Connection reset by peer
|
||||
... ELSE Create List timed out
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
|
||||
SecurityPolicy-Deny-Http-00012
|
||||
|
||||
@@ -372,4 +372,20 @@ SecurityPolicy-Deny-Mail-00016
|
||||
${rescode} UpdatePolicies 1 ${policyDict} v2 update
|
||||
sleep ${policyModifySleepSeconds}
|
||||
|
||||
|
||||
SecurityPolicy-Deny-Mail-00017
|
||||
Comment 功能端验证
|
||||
${Smtp服务器} Set Variable Smtp.163.com
|
||||
${Smtp服务器端口} Set Variable 25
|
||||
${邮箱账号} Set Variable ${mailAccount}
|
||||
${邮箱密码} Set Variable ${mailPasswd}
|
||||
${邮件主题} Set Variable denymail017
|
||||
${发送者} Set Variable ${mailAccount}
|
||||
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
|
||||
${接收者} Set Variable ["${mailAccountGeedge}"]
|
||||
${抄送者} Set Variable ["${mailAccountGeedge}"]
|
||||
${密送者} Set Variable ["${mailAccountGeedge}"]
|
||||
${邮件正文} Set Variable Deny17右匹配测试邮件正文
|
||||
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
|
||||
Log ${发送邮件返回结果}
|
||||
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_fail
|
||||
... ELSE should contain ${发送邮件返回结果} fail
|
||||
|
||||
@@ -294,3 +294,14 @@ Proxy-Policy-deny-00018
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA
|
||||
... ELSE Create List Tango Secure Gateway CA
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
|
||||
Proxy-Policy-deny-00019
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/ProxyPolicy_Deny_00019.bat
|
||||
... ELSE set variable curl -kv https://www.cndns.com/cn/sms/index.aspx --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Tango Secure Gateway CA Empty reply from server
|
||||
... ELSE Create List Tango Secure Gateway CA
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -375,3 +375,22 @@ SecurityPolicy-Momitor-Mail-00015
|
||||
Log ${发送邮件返回结果}
|
||||
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_success
|
||||
... ELSE should contain ${发送邮件返回结果} success
|
||||
|
||||
SecurityPolicy-Momitor-Mail-00016
|
||||
Comment 功能端验证
|
||||
${Smtp服务器} Set Variable smtp.qq.com
|
||||
${Smtp服务器端口} Set Variable 25
|
||||
${邮箱账号} Set Variable ${mailqqAccount}
|
||||
${邮箱密码} Set Variable ${mailqqPasswd}
|
||||
${邮件主题} Set Variable monitorMail16
|
||||
${发送者} Set Variable ${mailqqAccount}
|
||||
${附件} Set Variable ["${mailpath}/何冰凝测试文件.txt"]
|
||||
${接收者} Set Variable ["${mailAccountGeedge}"]
|
||||
${抄送者} Set Variable ["${mailAccountGeedge}"]
|
||||
${密送者} Set Variable ["${mailAccountGeedge}"]
|
||||
${邮件正文} Set Variable Monitor16右匹配测试邮件正文
|
||||
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
|
||||
Log ${发送邮件返回结果}
|
||||
run keyword if '${systemType}'=='Windows' should contain ${发送邮件返回结果} mail_success
|
||||
... ELSE should contain ${发送邮件返回结果} success
|
||||
|
||||
123
01-TestCase/tsg_adc/multi_step/b_NMonitor_Ftp_Tests.robot
Normal file
123
01-TestCase/tsg_adc/multi_step/b_NMonitor_Ftp_Tests.robot
Normal file
@@ -0,0 +1,123 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_adc_wp tsg_bf_api Trusted_Certificate_Authorities
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
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
|
||||
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Monitor-Ftp-00001
|
||||
# # 新增策略验证
|
||||
# 创建attributes中的字典
|
||||
${url} Create Dictionary attributeType=string attributeName=url appId=104 appName=ftp protocol=ftp attributeValue={"string": "ftp://192.168.40.158/123zxcvbnm.txt"}
|
||||
${Content} Create Dictionary attributeType=string attributeName=content appId=104 appName=ftp protocol=http attributeValue={"string": "crfvtgbyhnuj"}
|
||||
${Account} Create Dictionary attributeType=string attributeName=account appId=104 appName=ftp protocol=http attributeValue={"string": "ftpuser"}
|
||||
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "104"}
|
||||
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
|
||||
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
|
||||
# 合成attributes字典集
|
||||
${attributes} Create List ${url} ${Content} ${Account} ${app_id} ${ipsource} ${ipdestination}
|
||||
${verifySession} Create Dictionary attributes=${attributes}
|
||||
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||
# 打印检查结果
|
||||
# 将 策略id 加入对象 id
|
||||
${objectid_verify} set variable ${testClentIpId}
|
||||
${objectid_verify} Catenate SEPARATOR=, ${monitor_ftp_objectId13} ${monitor_ftp_objectId14} ${monitor_ftp_objectId15} ${monitor_ftp_policyId}
|
||||
# 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||
# # ${ok} VerifyProxy ${objectids} ${resData}
|
||||
Should Be Equal As Strings ${ok} true
|
||||
|
||||
SecurityPolicy-Monitor-Ftp-00002
|
||||
# # 新增策略验证
|
||||
# 创建attributes中的字典
|
||||
${url} Create Dictionary attributeType=string attributeName=url appId=104 appName=ftp protocol=ftp attributeValue={"string": "ftp://192.168.40.158/stamp.txt"}
|
||||
${Content} Create Dictionary attributeType=string attributeName=content appId=104 appName=ftp protocol=http attributeValue={"string": "Shandong Province"}
|
||||
${Account} Create Dictionary attributeType=string attributeName=account appId=104 appName=ftp protocol=http attributeValue={"string": "ftpuser"}
|
||||
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "104"}
|
||||
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
|
||||
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
|
||||
# 合成attributes字典集
|
||||
${attributes} Create List ${url} ${Content} ${Account} ${app_id} ${ipsource} ${ipdestination}
|
||||
${verifySession} Create Dictionary attributes=${attributes}
|
||||
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||
# 打印检查结果
|
||||
# 将 策略id 加入对象 id
|
||||
${objectid_verify} set variable ${testClentIpId}
|
||||
${objectid_verify} Catenate SEPARATOR=, ${monitor_ftp_objectId3} ${monitor_ftp_objectId4} ${monitor_ftp_objectId5} ${monitor_ftp_policyId1}
|
||||
# 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||
# # ${ok} VerifyProxy ${objectids} ${resData}
|
||||
Should Be Equal As Strings ${ok} true
|
||||
|
||||
|
||||
SecurityPolicy-Monitor-Ftp-00003
|
||||
# # 新增策略验证
|
||||
# 创建attributes中的字典
|
||||
${url} Create Dictionary attributeType=string attributeName=url appId=104 appName=ftp protocol=ftp attributeValue={"string": "ftp://192.168.40.158/qwert.txt"}
|
||||
${Content} Create Dictionary attributeType=string attributeName=content appId=104 appName=ftp protocol=http attributeValue={"string": "花好听的名字"}
|
||||
${Account} Create Dictionary attributeType=string attributeName=account appId=104 appName=ftp protocol=http attributeValue={"string": "ftpuser"}
|
||||
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "104"}
|
||||
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
|
||||
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
|
||||
# 合成attributes字典集
|
||||
${attributes} Create List ${url} ${Content} ${Account} ${app_id} ${ipsource} ${ipdestination}
|
||||
${verifySession} Create Dictionary attributes=${attributes}
|
||||
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||
# 打印检查结果
|
||||
# 将 策略id 加入对象 id
|
||||
${objectid_verify} set variable ${testClentIpId}
|
||||
${objectid_verify} Catenate SEPARATOR=, ${monitor_ftp_objectId6} ${monitor_ftp_objectId7} ${monitor_ftp_objectId8} ${monitor_ftp_policyId2}
|
||||
# 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||
# # ${ok} VerifyProxy ${objectids} ${resData}
|
||||
Should Be Equal As Strings ${ok} true
|
||||
|
||||
SecurityPolicy-Monitor-Ftp-00004
|
||||
# # 新增策略验证
|
||||
# 创建attributes中的字典
|
||||
${url} Create Dictionary attributeType=string attributeName=url appId=104 appName=ftp protocol=ftp attributeValue={"string": "ftp://192.168.40.158/asdfg.txt"}
|
||||
${Content} Create Dictionary attributeType=string attributeName=content appId=104 appName=ftp protocol=http attributeValue={"string": "уютных апартаментов"}
|
||||
${Account} Create Dictionary attributeType=string attributeName=account appId=104 appName=ftp protocol=http attributeValue={"string": "ftpuser"}
|
||||
${app_id} Create Dictionary attributeType=string attributeName=app_id attributeValue={"string": "104"}
|
||||
${ipsource} Create Dictionary attributeType=ip attributeName=source attributeValue={"ip": "${testClentIP}","port": "80","tableName": "TSG_SECURITY_SOURCE_ADDR","addrType": 4,"protocol": "6"}
|
||||
${ipdestination} Create Dictionary attributeType=ip attributeName=destination attributeValue={"ip": "192.168.40.158","port": "80","tableName": "TSG_SECURITY_DESTINATION_ADDR","addrType": 4,"protocol": "6"}
|
||||
# 合成attributes字典集
|
||||
${attributes} Create List ${url} ${Content} ${Account} ${app_id} ${ipsource} ${ipdestination}
|
||||
${verifySession} Create Dictionary attributes=${attributes}
|
||||
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||
# 打印检查结果
|
||||
# 将 策略id 加入对象 id
|
||||
${objectid_verify} set variable ${testClentIpId}
|
||||
${objectid_verify} Catenate SEPARATOR=, ${monitor_ftp_objectId9} ${monitor_ftp_objectId10} ${monitor_ftp_objectId11} ${monitor_ftp_policyId3}
|
||||
# 调用关键字 提取应答json获取其中所有的id值,并判断新下发的id值是否在应答json的id中
|
||||
${ok} VerifyProxy ${resData} ${objectid_verify}
|
||||
# # ${ok} VerifyProxy ${objectids} ${resData}
|
||||
Should Be Equal As Strings ${ok} true
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -21,7 +21,6 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Library json
|
||||
Library DateTime
|
||||
Library demjson
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/ProcessPolicyBody.robot
|
||||
Library ../../../04-CustomLibrary/Library/VerifyPolicy.py
|
||||
Resource ../../../05-Other/AllFlowCaseVariable.txt
|
||||
|
||||
@@ -162,3 +162,12 @@ SecurityPolicy-Deny-Mail-00016
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_mail_policyId15}]}
|
||||
${s} Convert to String ${deny_mail_policyId15}
|
||||
|
||||
SecurityPolicy-Deny-Mail-00017
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_mail_objectId37}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_mail_objectId38}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${deny_mail_policyId16}]}
|
||||
${s} Convert to String ${deny_mail_policyId16}
|
||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account ${mailAccount}
|
||||
|
||||
|
||||
@@ -254,3 +254,17 @@ Proxy-Policy-deny-00018
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
${s} Convert to String ${deny_policyId16}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.umusicpub.com
|
||||
|
||||
Proxy-Policy-deny-00019
|
||||
#删除对象
|
||||
${objectids} set Variable ${deny_objectId60}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId61}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId62}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId63}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${deny_objectId64}
|
||||
#删除策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${intercept_deny_policyId18}]}
|
||||
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${deny_policyId18}]}
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
${s} Convert to String ${deny_policyId18}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.cndns.com
|
||||
|
||||
@@ -156,3 +156,12 @@ SecurityPolicy-Monitor-Mail-00015
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${monitor_mail_policyId14}]}
|
||||
${s} Convert to String ${monitor_mail_policyId14}
|
||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account ${mailqqAccount}
|
||||
|
||||
SecurityPolicy-Monitor-Mail-00016
|
||||
#删除对象
|
||||
${objectids} set Variable ${monitor_mail_objectId38}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${monitor_mail_objectId39}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${monitor_mail_policyId15}]}
|
||||
${s} Convert to String ${monitor_mail_policyId15}
|
||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account ${mailqqAccount}
|
||||
|
||||
Reference in New Issue
Block a user