From 554f47d5958a113573093d045b64c984343fe0e7 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Fri, 24 Apr 2020 11:17:09 +0800 Subject: [PATCH] =?UTF-8?q?Denyssl=EF=BC=9A=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E5=BC=95=E7=94=A8ip=20Interface=EF=BC=9A=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=80=82=E5=BA=94cli=E8=B0=83=E6=95=B4=20PolicyObject?= =?UTF-8?q?default=E8=B0=83=E6=95=B4=E9=80=82=E5=BA=94subid=E5=92=8Clocali?= =?UTF-8?q?p=E4=B8=8D=E5=90=8C=E6=97=B6=E9=BB=98=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01-TestCase/tsg_adc/api_proxy/DenySSLTests.robot | 6 +++--- 02-Keyword/tsg_cli/Interface.robot | 13 +++++++------ 03-Variable/PolicyObjectDefault.txt | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/01-TestCase/tsg_adc/api_proxy/DenySSLTests.robot b/01-TestCase/tsg_adc/api_proxy/DenySSLTests.robot index 928a472..3e2c4da 100644 --- a/01-TestCase/tsg_adc/api_proxy/DenySSLTests.robot +++ b/01-TestCase/tsg_adc/api_proxy/DenySSLTests.robot @@ -140,7 +140,7 @@ ProxyPolicy-deny-ssl-00005 #创建管控策略 #${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-deny-Https-00005", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"deny", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "block", "html_profile": ${profiledId}, "code": 404,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] } - ${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-deny-Https-00005", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"deny", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "block", "html_profile": ${profiledId}, "code": 404,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] } + ${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-deny-Https-00005", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"deny", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "block", "html_profile": ${profiledId}, "code": 404,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] } ... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-deny-Https-00005", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"deny", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "block", "html_profile": ${profiledId}, "code": 404,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] } ${rescode} ${policyId3} AddPolicy ${addPolicyStr} log ${policyId3} @@ -301,11 +301,11 @@ ProxyPolicy-deny-ssl-00010 ${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]} #删除所有策略 ${policyIds} Create List ${policyId1} ${policyId2} - #功能端验证 + #功能端验证证书问题 #${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00010.bat ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00010.bat ... ELSE set variable curl -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 'https://www.baidu.com/' https://www.twitch.tv/directory - ${stringlist} Create List Tango Secure Gateway CA 404 X-TG-Construct-By: tfe 404 sorry! The page you visited does not exist + ${stringlist} Create List Tango Secure Gateway CA 404 X-TG-Construct-By: tfe The page you visited does not exist ${starttime} Get Time Sleep ${policyVerificationSleepSeconds}s ${rescode} SystemCommands ${commandstr} ${stringlist} diff --git a/02-Keyword/tsg_cli/Interface.robot b/02-Keyword/tsg_cli/Interface.robot index ba4c4bc..c9aabd2 100644 --- a/02-Keyword/tsg_cli/Interface.robot +++ b/02-Keyword/tsg_cli/Interface.robot @@ -18,7 +18,8 @@ ${Tsg_Passwd} tsg_passwd # tsg_help指令返回值对比文件路径 ${Tsg_Help_file_Path} cli_files/tsg_help.txt # tsg_show指令查询时附加sql条件 -${Tsg_Show_Added_Sql} "order by time desc limit 20 " --querey +${Tsg_Show_Added_Sql} "order by time desc limit 20 " +${Tsg_Show_Added_Sql_Query} --query # tsg_show指令返回数据flowType和sled参数值 ${Tsg_Show_FlowType_Values} inline|intercomm|mirror ${Tsg_Show_Sled_Values} mcn0|mcn1|mcn2|mcn3 @@ -273,7 +274,7 @@ Tsg_Show_Interface ... 描述:执行'tsg_show --interface'指令,并验证返回值 ... 参数:无 ... 返回:无 - ${str} Set Variable ${Tsg_Show} --interface -- ${Tsg_Show_Added_Sql} + ${str} Set Variable ${Tsg_Show} --interface -- ${Tsg_Show_Added_Sql} ${Tsg_Show_Added_Sql_Query} ${stime} Get Time @{list} Run5 ${str} ${etime} Get Time @@ -288,7 +289,7 @@ Tsg_Show_APP ... 描述:执行'tsg_show --app'指令,并验证返回值 ... 参数:无 ... 返回:无 - ${str} Set Variable ${Tsg_Show} --app -- ${Tsg_Show_Added_Sql} + ${str} Set Variable ${Tsg_Show} --app -- ${Tsg_Show_Added_Sql} ${Tsg_Show_Added_Sql_Query} ${stime} Get Time @{list} Run5 ${str} ${etime} Get Time @@ -303,7 +304,7 @@ Tsg_Show_Protocol ... 描述:执行'tsg_show --protocol'指令,并验证返回值 ... 参数:无 ... 返回:无 - ${str} Set Variable ${Tsg_Show} --protocol -- ${Tsg_Show_Added_Sql} + ${str} Set Variable ${Tsg_Show} --protocol -- ${Tsg_Show_Added_Sql} ${Tsg_Show_Added_Sql_Query} ${stime} Get Time @{list} Run5 ${str} ${etime} Get Time @@ -318,7 +319,7 @@ Tsg_Show_Stream ... 描述:执行'tsg_show --stream'指令,并验证返回值 ... 参数:无 ... 返回:无 - ${str} Set Variable ${Tsg_Show} --stream -- ${Tsg_Show_Added_Sql} + ${str} Set Variable ${Tsg_Show} --stream -- ${Tsg_Show_Added_Sql} ${Tsg_Show_Added_Sql_Query} ${stime} Get Time @{list} Run5 ${str} ${etime} Get Time @@ -333,7 +334,7 @@ Tsg_Show_Intercept ... 描述:执行'tsg_show --intercept'指令,并验证返回值 ... 参数:无 ... 返回:无 - ${str} Set Variable ${Tsg_Show} --intercept -- ${Tsg_Show_Added_Sql} + ${str} Set Variable ${Tsg_Show} --intercept -- ${Tsg_Show_Added_Sql} ${Tsg_Show_Added_Sql_Query} ${stime} Get Time @{list} Run5 ${str} ${etime} Get Time diff --git a/03-Variable/PolicyObjectDefault.txt b/03-Variable/PolicyObjectDefault.txt index c49dbdc..0e83bb2 100644 --- a/03-Variable/PolicyObjectDefault.txt +++ b/03-Variable/PolicyObjectDefault.txt @@ -17,7 +17,7 @@ ${Default_ScheduleId} 7 # 对象 ${Default_ObjectType} ip -${Default_ObjectSubType} endpoint +${Default_ObjectSubType} ${EMPTY} ${Default_IsInitialize} ${0} ${Default_IsExclusion} ${0} ${Default_ObjectName} autotestobj