diff --git a/01-TestCase/tsg_adc/selfserver/DenyAllTests.robot b/01-TestCase/tsg_adc/selfserver/DenyAllTests.robot index 87e1149..7d654a0 100644 --- a/01-TestCase/tsg_adc/selfserver/DenyAllTests.robot +++ b/01-TestCase/tsg_adc/selfserver/DenyAllTests.robot @@ -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 diff --git a/01-TestCase/tsg_bfapi/policy_file_interface/ResponsePagesPolicy.robot b/01-TestCase/tsg_bfapi/policy_file_interface/ResponsePagesPolicy.robot index 95b5267..83fe1b6 100644 --- a/01-TestCase/tsg_bfapi/policy_file_interface/ResponsePagesPolicy.robot +++ b/01-TestCase/tsg_bfapi/policy_file_interface/ResponsePagesPolicy.robot @@ -6,7 +6,7 @@ Library OperatingSystem Library Selenium2Library Library Collections Resource ../../../02-Keyword/tsg_bfapi/common.robot -Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot +Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot Resource ../../../03-Variable/bifangapivariable.txt *** Variables *** diff --git a/02-Keyword/tsg_bfapi/PolicyObject.robot b/02-Keyword/tsg_bfapi/PolicyObject.robot index 4db7c13..874dac0 100644 --- a/02-Keyword/tsg_bfapi/PolicyObject.robot +++ b/02-Keyword/tsg_bfapi/PolicyObject.robot @@ -2,6 +2,7 @@ Resource ../../03-Variable/BifangApiVariable.txt Resource ../tsg_common/ManagePolicyBody.robot Resource ../tsg_common/ManageObjectBody.robot +Resource ../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot Library REST http://${host}:${port} Library Collections Library RequestsLibrary @@ -11,14 +12,30 @@ Resource Common.robot AddLocalIPObject #创建对象IP log to_AddLocalIPObject - ${localIP} set variable {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","objectSubType":"endpoint","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"autotestLocalIPObject_${testClentIP}","objectDesc":"LocalIPObject_${testClentIP}自动化测试机IP","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"isSession":"endpoint","clientIp1":"${testClentIP}","clientIp2":"${testClentIP}","clientIpFormat":"range","clientPortFormat":"range","clientPort1":0,"clientPort2":0,"serverIpFormat":"range","serverIp1":"","serverIp2":"","serverPortFormat":"range","serverPort1":0,"serverPort2":0}],"updateItemList":[],"deleteItemIds":[]}} - ${rescodeip} ${objidip} AddObject ${localIP} + #${localIP} set variable {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","objectSubType":"endpoint","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"autotestLocalIPObject_${testClentIP}","objectDesc":"LocalIPObject_${testClentIP}自动化测试机IP","subObjectIds":[],"addItemList":[{"addrType":4,"protocol":0,"direction":0,"isSession":"endpoint","clientIp1":"${testClentIP}","clientIp2":"${testClentIP}","clientIpFormat":"range","clientPortFormat":"range","clientPort1":0,"clientPort2":0,"serverIpFormat":"range","serverIp1":"","serverIp2":"","serverPortFormat":"range","serverPort1":0,"serverPort2":0}],"updateItemList":[],"deleteItemIds":[]}} + #${rescodeip} ${objidip} AddObject ${localIP} + #${localSubIP} set variable {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","objectSubType":"","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"test57","objectDesc":"${testSubscriberID}","subObjectIds":[],"addItemList":[{"keywordArray":["${testSubscriberID}"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}} + #${rescodesub} ${subiid} AddObject ${localSubIP} + # 创建对象-IP + Create Dictionary + + ${objectDict} Create Dictionary + ... objectType=ip + ... objectName=autotest_localIP_${testClentIP} + ... isValid=${1} + ... addItemList=range|${testClentIP}|${testClentIP}|0/0 + ${rescode} ${objectId} AddObject2 ${1} ${objectDict} #log ${rescodeip} - log LocalIP:${objidip} - SET GLOBAL VARIABLE ${testClentID} ${objidip} + log LocalIP:${objectId} + SET GLOBAL VARIABLE ${testClentID} ${objectId} + log to_AddLocalSubidObject - ${localSubIP} set variable {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","objectSubType":"","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"test57","objectDesc":"${testSubscriberID}","subObjectIds":[],"addItemList":[{"keywordArray":["${testSubscriberID}"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[]}} - ${rescodesub} ${subiid} AddObject ${localSubIP} + ${objectDict} Create Dictionary + ... objectType=subscriberid + ... objectName=autotest_localSubId_${testSubscriberID} + ... isValid=${1} + ... addItemList=${testSubscriberID} + ${rescode} ${subiid} AddObject2 ${1} ${objectDict} #log ${subiid} log LocalSubIP:${subiid} SET GLOBAL VARIABLE ${testClentSubID} ${subiid} @@ -139,3 +156,5 @@ DeletePolicyAndObject #删除对象 log todeleteobj_DeletePolicyAndObject DeleteObject ${objectids} + + diff --git a/02-Keyword/tsg_common/ManagePolicyBody.robot b/02-Keyword/tsg_common/ManagePolicyBody.robot index 0c3bce4..c3b19b6 100644 --- a/02-Keyword/tsg_common/ManagePolicyBody.robot +++ b/02-Keyword/tsg_common/ManagePolicyBody.robot @@ -199,7 +199,7 @@ ManageReferenceObject ManageClientObject # 增加引用测试终端IP策略对象 - ${emptyList} Create List + ${emptyList} Create List TSG_SECURITY_SOURCE_ADDR ${obj} Create Dictionary objectId=${testClentID} protocolFields=${emptyList} [Return] ${obj} diff --git a/05-Other/curl/AllFlowHTTPSIntercept-001_dos.bat b/05-Other/curl/AllFlowHTTPSIntercept-001_dos.bat deleted file mode 100644 index a688f70..0000000 --- a/05-Other/curl/AllFlowHTTPSIntercept-001_dos.bat +++ /dev/null @@ -1 +0,0 @@ -curl -kv https://www.baidu.com | iconv -f utf-8 -t gbk \ No newline at end of file diff --git a/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001.bat b/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001.bat new file mode 100644 index 0000000..88a624d --- /dev/null +++ b/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001.bat @@ -0,0 +1 @@ +curl -kv https://open.node.com/ | iconv -f utf-8 -t gbk \ No newline at end of file diff --git a/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001_HTTP.bat b/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001_HTTP.bat new file mode 100644 index 0000000..d90714b --- /dev/null +++ b/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001_HTTP.bat @@ -0,0 +1 @@ +curl -kv http://open.node.com/ | iconv -f utf-8 -t gbk \ No newline at end of file diff --git a/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001_SSL.bat b/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001_SSL.bat new file mode 100644 index 0000000..88a624d --- /dev/null +++ b/05-Other/curl/selfserver/SecurityPolicy-Deny-AllProtol-00001_SSL.bat @@ -0,0 +1 @@ +curl -kv https://open.node.com/ | iconv -f utf-8 -t gbk \ No newline at end of file diff --git a/05-Other/docker.txt b/05-Other/docker.txt index 19a36f6..00de6bb 100644 --- a/05-Other/docker.txt +++ b/05-Other/docker.txt @@ -2,6 +2,7 @@ docker images 2、进入docker镜像 docker run -it auto-rf-library:1.0 /bin/bash +docker run --name autotest.open.node.com --add-host=open.node.com:192.168.100.5 -it auto-rf-library:2.0 3、执行自动化项目 docker run -it -v /home/autoTest_tsg/:/usr/src/python -w /usr/src/python auto-rf-lib:latest[docker最新镜像] -d /newrepot/ robot tsg_autotest0406[project path] 执行添加hosts文件:使用自建服务器作为网页访问: