使用封装的对象和策略关键字添加对象和策略;
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeleteAllAfterAdc ${policyIds} ${objectids}
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags tsg_adc tsg_security all_protol
|
||||
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/SystemCommand.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Library Custometest
|
||||
Library json
|
||||
|
||||
@@ -28,9 +28,9 @@ SecurityPolicy-Deny-AllProtol-00001
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=ip
|
||||
... isValid=${1}
|
||||
... addItemList=range|192.168.100.5|192.168.100.5|0/65535
|
||||
... addItemList=CIDR|192.168.100.5|32|0/0
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
${objectids} set Variable ${objectId}
|
||||
|
||||
Comment 创建安全策略,针对所有协议,相当于BlackIP
|
||||
${policyDict} Create Dictionary
|
||||
@@ -42,18 +42,18 @@ SecurityPolicy-Deny-AllProtol-00001
|
||||
... effectiveRange=Nursurtan|Transtelecom&Astel,|Astel&Transtelecom
|
||||
... userRegion=method:rst
|
||||
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR
|
||||
... isValid=${0}
|
||||
... isValid=${1}
|
||||
... appObjectIdArray=2,3,4,5,6
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyId} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
|
||||
${s} Convert to String ${policyId}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable curl -kv http://open.node.com/ | iconv -f utf-8 -t gbk
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-AllProtol-00001_HTTP.bat
|
||||
... ELSE set variable curl -kv http://open.node.com/
|
||||
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Recv failure: Connection was reset
|
||||
... ELSE Create List Recv failure: Connection reset by peer
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
@@ -64,11 +64,11 @@ SecurityPolicy-Deny-AllProtol-00001
|
||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
|
||||
Comment 功能端验证SSL验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable curl -kv https://open.node.com/ | iconv -f utf-8 -t gbk
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-AllProtol-00001_SSL.bat
|
||||
... ELSE set variable curl -kv https://open.node.com/
|
||||
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... #OpenSSL SSL_connect: Connection was reset in connection to
|
||||
#OpenSSL SSL_connect: Connection was reset in connection to
|
||||
#Send failure: Connection was reset
|
||||
... ELSE Create List OpenSSL SSL_connect: Connection reset by peer in connection to
|
||||
|
||||
|
||||
Reference in New Issue
Block a user