Upload New File

This commit is contained in:
姬巍川
2020-06-24 18:51:46 +08:00
parent 10d595650e
commit e955b3f86c

View File

@@ -0,0 +1,85 @@
*** 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
*** Test Cases ***
SecurityPolicy-Deny-Ftp-00001
[Tags] 子串匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=123456.txt
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=пациен
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
insert_policyId_to_file1 deny_ftp_objectId ${object_Account_Id}
insert_policyId_to_file1 deny_ftp_objectId1 ${object_url_Id}
insert_policyId_to_file1 deny_ftp_objectId2 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_policyId ${policyId}
SecurityPolicy-Deny-Ftp-00002
[Tags] 右匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*est.txt
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*st.txt
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00002 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
insert_policyId_to_file1 deny_ftp_objectId3 ${object_Account_Id}
insert_policyId_to_file1 deny_ftp_objectId4 ${object_url_Id}
insert_policyId_to_file1 deny_ftp_objectId5 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_policyId1 ${policyId}
SecurityPolicy-Deny-Ftp-00003
[Tags] 完整匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$ftp://192.168.100.5/wlcsy.txt
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=$中文文件内容
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00003 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"rst"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
insert_policyId_to_file1 deny_ftp_objectId6 ${object_Account_Id}
insert_policyId_to_file1 deny_ftp_objectId7 ${object_url_Id}
insert_policyId_to_file1 deny_ftp_objectId8 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_policyId2 ${policyId}
SecurityPolicy-Deny-Ftp-00004
[Tags] 左匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_u*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=ftp://192.168.100*
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=409 пациентов*
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00004 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"FTP","method":"rst"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT,${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
insert_policyId_to_file1 deny_ftp_objectId9 ${object_Account_Id}
insert_policyId_to_file1 deny_ftp_objectId10 ${object_url_Id}
insert_policyId_to_file1 deny_ftp_objectId11 ${object_content_Id}
insert_policyId_to_file1 deny_ftp_policyId3 ${policyId}