diff --git a/01-TestCase/tsg_adc/selfserver/Api_Proxy/Allow_Http_Tests.robot b/01-TestCase/tsg_adc/selfserver/Api_Proxy/Allow_Http_Tests.robot index d552785..ab6d242 100644 --- a/01-TestCase/tsg_adc/selfserver/Api_Proxy/Allow_Http_Tests.robot +++ b/01-TestCase/tsg_adc/selfserver/Api_Proxy/Allow_Http_Tests.robot @@ -18,7 +18,7 @@ ProxyPolicy-Allow-Http-00001 [Tags] selfserver ip Comment 创建url ${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html - ${rescode} ${objectId} AddObject2 ${1} ${objectDict} ${objectDic1t} ${objectDic1t} + ${rescode} ${objectId} AddObject2 ${1} ${objectDict} ${objectids} set Variable ${objectId} Comment 创建安全策略 ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol": "HTTP"} filterList= isValid=${1} appIdObjects=2 diff --git a/02-Keyword/tsg_bfapi/LoginLogout.robot b/02-Keyword/tsg_bfapi/LoginLogout.robot index 9aa8921..3369431 100644 --- a/02-Keyword/tsg_bfapi/LoginLogout.robot +++ b/02-Keyword/tsg_bfapi/LoginLogout.robot @@ -75,14 +75,16 @@ ApiLogoutAndDelLocalIP [Tags] tsg_adc tsg_bf_api log ApiLogoutAndDelLocalIP log to_LogoutAndDelLocalIP_LogoutAndDelLocalIP + #删除tsgUIAPI 先删除白名单,是因为此策略也引用了本机IP + Run Keyword If ${addTsgUIAPIFlag}==1 SecurityPolicy-Allow-TSGUIAPI-DEL + Run Keyword If ${addTestClentIPFlag}==1 DelLocalIPObject + + #ApiDeleteAutoTagsCase loginlogout.Logout #[Return] ${rescode} - #添加tsgUIAPI - Run Keyword If ${addTsgUIAPIFlag}==1 SecurityPolicy-Allow-TSGUIAPI-DEL - CliLogin [Tags] tsg_cli cli_login Open Connection ${cliHost} @@ -112,5 +114,7 @@ SecurityPolicy-Allow-TSGUIAPI-Add SecurityPolicy-Allow-TSGUIAPI-DEL [Tags] uiallow log toDelTSGUIAPI - DeletePolicyAndObject ${testBifangPolicy} ${testBifangIP} + ${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${testBifangPolicy}]} + ${policyIds} Create List ${policyId1} + DeletePolicyAndObject ${policyIds} ${testBifangIP} log delTSGUIAPISucess \ No newline at end of file diff --git a/02-Keyword/tsg_bfapi/PolicyObject.robot b/02-Keyword/tsg_bfapi/PolicyObject.robot index 20487b0..39d7658 100644 --- a/02-Keyword/tsg_bfapi/PolicyObject.robot +++ b/02-Keyword/tsg_bfapi/PolicyObject.robot @@ -63,12 +63,19 @@ AddLocalIPObject DelLocalIPObject log to_DelLocalIPObject - ${response} BaseDeleteRequest /${version}/policy/object {"objectIds":[${testClentID}]} + + ${emptyList} Create List + ${objectId1} Create List [${testClentID},${testClentSubID}] + DeletePolicyAndGroupObject ${emptyList} ${objectId1} + SET GLOBAL VARIABLE ${testClentID} ${EMPTY} + SET GLOBAL VARIABLE ${testClentSubID} ${EMPTY} + + #${response} BaseDeleteRequest /${version}/policy/object {"objectIds":[${testClentID}]} #${response_code} Get From Dictionary ${response} code #Should Be Equal As Strings ${response} {'code': 200, 'msg': 'Success', 'success': True} - SET GLOBAL VARIABLE ${testClentID} ${EMPTY} - ${response} BaseDeleteRequest /${version}/policy/object {"objectIds":[${testClentSubID}]} - SET GLOBAL VARIABLE ${testClentSubID} ${EMPTY} + #SET GLOBAL VARIABLE ${testClentID} ${EMPTY} + #${response} BaseDeleteRequest /${version}/policy/object {"objectIds":[${testClentSubID}]} + #SET GLOBAL VARIABLE ${testClentSubID} ${EMPTY} AddObject [Arguments] ${body} @@ -303,19 +310,23 @@ DeleteProfiles DeletePolicyAndObject [Arguments] ${policyids} ${objectids} #删除和对象 + #2020-09-01修改,引用DeletePolicyAndGroupObject,避免分别维护并兼容之前用例 + ${objectId1} Create List [${objectids}] + DeletePolicyAndGroupObject ${policyIds} ${objectId1} + #删除策略 - log toDeletePolicy_DeletePolicyAndObject - ${listlenth}= Get Length ${policyids} - FOR ${var} IN RANGE ${listlenth} + #log toDeletePolicy_DeletePolicyAndObject + #${listlenth}= Get Length ${policyids} + #FOR ${var} IN RANGE ${listlenth} #log dxytest111111 - log ${var} - DeletePolicy ${policyids}[${var}] + #log ${var} + #DeletePolicy ${policyids}[${var}] #Should Contain ${commandreturn} ${ca} - END + #END #删除对象 - log todeleteobj_DeletePolicyAndObject - Run Keyword If "${objectids}"=="${EMPTY}" log no obj to del - ... ELSE DeleteObject ${objectids} + #log todeleteobj_DeletePolicyAndObject + #Run Keyword If "${objectids}"=="${EMPTY}" log no obj to del + # ... ELSE DeleteObject ${objectids} DeletePolicyAndGroupObject [Arguments] ${policyids} ${objectids} diff --git a/02-Keyword/tsg_common/ManageObjectBody.robot b/02-Keyword/tsg_common/ManageObjectBody.robot index ac07a93..8214272 100644 --- a/02-Keyword/tsg_common/ManageObjectBody.robot +++ b/02-Keyword/tsg_common/ManageObjectBody.robot @@ -92,7 +92,7 @@ ManageStrItemList END [Return] ${returnList} IpItemType11 - [Arguments] ${str} + [Arguments] ${str} ${obj} Create Dictionary ${values} Evaluate re.split('[|]', '${str}') re ${isSession} Convert To Integer ${values}[0]