1、删除在分步骤中添加UIAPI地址的白名单;
2、BifangApiVariable.txt文件:修改接口地址为44.17;删除无用的地址${currentpath}
E:/auto_git/eclipsegit/tsg_autotest/;添加#测试环境是否需要把tsgui和api添加为SecurityPolicy-Allow
1为需要,默认1 ,
${addTsgUIAPIFlag} 1
3、添加UIAPI地址白名单放到setup引用中修改文件:LoginLogout.robot文件;
4、修改本机ip对象引用id带“”问题:修改ManagePolicyBody。robot文件;ProcessPolicyBody.robot文件;
This commit is contained in:
@@ -6,6 +6,8 @@ Library SSHLibrary
|
||||
Resource PolicyObject.robot
|
||||
Resource ../tsg_ui/logout/Logout.robot
|
||||
Resource ../tsg_ui/login/Login.robot
|
||||
#Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||
Resource Tag.robot
|
||||
|
||||
*** Keywords ***
|
||||
@@ -48,7 +50,6 @@ Login
|
||||
log ${token}
|
||||
SET GLOBAL VARIABLE ${headers} {"Contest-Type":"application/json","Authorization":"${token}"}
|
||||
#Return ${rescode}
|
||||
|
||||
Logout
|
||||
[Tags] tsg_adc tsg_bf_api
|
||||
POST /${version}/user/logout headers=${headers}
|
||||
@@ -67,6 +68,9 @@ ApiLoginAndAddLocalIP
|
||||
#ApiAddAutoTagsCase
|
||||
#[Return] ${rescode}
|
||||
|
||||
#添加tsgUIAPI
|
||||
Run Keyword If ${addTsgUIAPIFlag}==1 SecurityPolicy-Allow-TSGUIAPI-Add
|
||||
|
||||
ApiLogoutAndDelLocalIP
|
||||
[Tags] tsg_adc tsg_bf_api
|
||||
log ApiLogoutAndDelLocalIP
|
||||
@@ -76,6 +80,9 @@ ApiLogoutAndDelLocalIP
|
||||
loginlogout.Logout
|
||||
#[Return] ${rescode}
|
||||
|
||||
#添加tsgUIAPI
|
||||
Run Keyword If ${addTsgUIAPIFlag}==1 SecurityPolicy-Allow-TSGUIAPI-DEL
|
||||
|
||||
CliLogin
|
||||
[Tags] tsg_cli cli_login
|
||||
Open Connection ${cliHost}
|
||||
@@ -85,4 +92,25 @@ CliLogout
|
||||
[Tags] tsg_cli cli_logout
|
||||
Close Connection
|
||||
Log Close CLI Connection
|
||||
|
||||
|
||||
SecurityPolicy-Allow-TSGUIAPI-Add
|
||||
[Tags] uiallow
|
||||
log toAddTSGUIAPI
|
||||
${addItemList1} Create Dictionary isSession=endpoint ip=${host}/32 port=0-0 direction=0 protocol=0 isInitialize=0
|
||||
#可以添加多个
|
||||
${addItemLists} Create list ${addItemList1}
|
||||
#objectList对象
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=${addItemLists}
|
||||
${rescode} ${objectId} AddObjects ${1} ${objectDict}
|
||||
SET GLOBAL VARIABLE ${testBifangIP} ${objectId}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-TSGUIAPI policyType=tsg_security policyDesc=autotest action=allow destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR userRegion={} isValid=${1} appIdObjects=2,3
|
||||
log ${policyDict}
|
||||
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
||||
SET GLOBAL VARIABLE ${testBifangPolicy} ${policyId}
|
||||
log addTSGUIAPISucess
|
||||
SecurityPolicy-Allow-TSGUIAPI-DEL
|
||||
[Tags] uiallow
|
||||
log toDelTSGUIAPI
|
||||
DeletePolicyAndObject ${testBifangPolicy} ${testBifangIP}
|
||||
log delTSGUIAPISucess
|
||||
Reference in New Issue
Block a user