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:
@@ -1,38 +0,0 @@
|
|||||||
*** Settings ***
|
|
||||||
Force Tags tsg_adc_wp adc_api security_policy
|
|
||||||
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/FileOperation.robot
|
|
||||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
|
||||||
|
|
||||||
*** Test Cases ***
|
|
||||||
SecurityPolicy-Allow-UIAPI
|
|
||||||
[Tags] uiallow
|
|
||||||
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.44.17/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}
|
|
||||||
Comment 创建安全策略
|
|
||||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-120 policyType=tsg_security policyDesc=autotest action=allow destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR userRegion={"protocol":"HTTP"} isValid=${1} appIdObjects=2
|
|
||||||
log ${policyDict}
|
|
||||||
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
|
||||||
insert_policyId_to_file1 SecurityPolicy-Allow ${objectId}
|
|
||||||
insert_policyId_to_file1 SecurityPolicy-Allow ${policyId}
|
|
||||||
#SecurityPolicy-Allow-UIAPI
|
|
||||||
# [Tags] uiallow
|
|
||||||
# ${addItemList1} Create Dictionary isSession=endpoint ip=192.168.40.120/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}
|
|
||||||
# Comment 创建安全策略
|
|
||||||
# ${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-120 policyType=tsg_security policyDesc=autotest action=allow destination=${objectId}|TSG_SECURITY_DESTINATION_ADDR userRegion=${EMPTY} isValid=${1} appIdObjects=2,3
|
|
||||||
# log ${policyDict}
|
|
||||||
# ${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
|
|
||||||
# insert_policyId_to_file1 SecurityPolicy-Allow ${objectId}
|
|
||||||
# insert_policyId_to_file1 SecurityPolicy-Allow ${policyId}
|
|
||||||
@@ -6,6 +6,8 @@ Library SSHLibrary
|
|||||||
Resource PolicyObject.robot
|
Resource PolicyObject.robot
|
||||||
Resource ../tsg_ui/logout/Logout.robot
|
Resource ../tsg_ui/logout/Logout.robot
|
||||||
Resource ../tsg_ui/login/Login.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
|
Resource Tag.robot
|
||||||
|
|
||||||
*** Keywords ***
|
*** Keywords ***
|
||||||
@@ -48,7 +50,6 @@ Login
|
|||||||
log ${token}
|
log ${token}
|
||||||
SET GLOBAL VARIABLE ${headers} {"Contest-Type":"application/json","Authorization":"${token}"}
|
SET GLOBAL VARIABLE ${headers} {"Contest-Type":"application/json","Authorization":"${token}"}
|
||||||
#Return ${rescode}
|
#Return ${rescode}
|
||||||
|
|
||||||
Logout
|
Logout
|
||||||
[Tags] tsg_adc tsg_bf_api
|
[Tags] tsg_adc tsg_bf_api
|
||||||
POST /${version}/user/logout headers=${headers}
|
POST /${version}/user/logout headers=${headers}
|
||||||
@@ -67,6 +68,9 @@ ApiLoginAndAddLocalIP
|
|||||||
#ApiAddAutoTagsCase
|
#ApiAddAutoTagsCase
|
||||||
#[Return] ${rescode}
|
#[Return] ${rescode}
|
||||||
|
|
||||||
|
#添加tsgUIAPI
|
||||||
|
Run Keyword If ${addTsgUIAPIFlag}==1 SecurityPolicy-Allow-TSGUIAPI-Add
|
||||||
|
|
||||||
ApiLogoutAndDelLocalIP
|
ApiLogoutAndDelLocalIP
|
||||||
[Tags] tsg_adc tsg_bf_api
|
[Tags] tsg_adc tsg_bf_api
|
||||||
log ApiLogoutAndDelLocalIP
|
log ApiLogoutAndDelLocalIP
|
||||||
@@ -76,6 +80,9 @@ ApiLogoutAndDelLocalIP
|
|||||||
loginlogout.Logout
|
loginlogout.Logout
|
||||||
#[Return] ${rescode}
|
#[Return] ${rescode}
|
||||||
|
|
||||||
|
#添加tsgUIAPI
|
||||||
|
Run Keyword If ${addTsgUIAPIFlag}==1 SecurityPolicy-Allow-TSGUIAPI-DEL
|
||||||
|
|
||||||
CliLogin
|
CliLogin
|
||||||
[Tags] tsg_cli cli_login
|
[Tags] tsg_cli cli_login
|
||||||
Open Connection ${cliHost}
|
Open Connection ${cliHost}
|
||||||
@@ -85,4 +92,25 @@ CliLogout
|
|||||||
[Tags] tsg_cli cli_logout
|
[Tags] tsg_cli cli_logout
|
||||||
Close Connection
|
Close Connection
|
||||||
Log Close CLI 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
|
||||||
@@ -263,7 +263,9 @@ ManageObjectV2
|
|||||||
ManageClientIPObjectV2
|
ManageClientIPObjectV2
|
||||||
[Arguments] ${emptyList}
|
[Arguments] ${emptyList}
|
||||||
# 增加引用测试终端IP策略对象
|
# 增加引用测试终端IP策略对象
|
||||||
${obj1} Create Dictionary objectId=${testClentID} protocolField=TSG_SECURITY_SOURCE_ADDR
|
|
||||||
|
${intid} Evaluate int(${testClentID})
|
||||||
|
${obj1} Create Dictionary objectId=${intid} protocolField=TSG_SECURITY_SOURCE_ADDR
|
||||||
Append To List ${emptyList} ${obj1}
|
Append To List ${emptyList} ${obj1}
|
||||||
|
|
||||||
ManageClientSubIDObjectV2
|
ManageClientSubIDObjectV2
|
||||||
|
|||||||
@@ -173,7 +173,9 @@ EffectiveRangeValueType3
|
|||||||
FOR ${var} IN @{list}
|
FOR ${var} IN @{list}
|
||||||
Append To List ${valueList} ${var}
|
Append To List ${valueList} ${var}
|
||||||
END
|
END
|
||||||
${obj} Create Dictionary tag=location value=${valueList}
|
${obj} Create Dictionary tag=location value=${valueList}
|
||||||
|
#适应adc设定标签
|
||||||
|
#${obj} Create Dictionary tag=device_id value=${valueList}
|
||||||
${return} Create List ${obj}
|
${return} Create List ${obj}
|
||||||
[Return] ${return}
|
[Return] ${return}
|
||||||
|
|
||||||
@@ -234,8 +236,9 @@ ManageReferenceObject
|
|||||||
ManageClientIPObject
|
ManageClientIPObject
|
||||||
[Arguments] ${emptyList}
|
[Arguments] ${emptyList}
|
||||||
# 增加引用测试终端IP策略对象
|
# 增加引用测试终端IP策略对象
|
||||||
${list1} Create List TSG_SECURITY_SOURCE_ADDR
|
${list1} Create List TSG_SECURITY_SOURCE_ADDR
|
||||||
${obj1} Create Dictionary objectId=${testClentID} protocolFields=${list1}
|
${intid} Evaluate int(${testClentID})
|
||||||
|
${obj1} Create Dictionary objectId=${intid} protocolFields=${list1}
|
||||||
Append To List ${emptyList} ${obj1}
|
Append To List ${emptyList} ${obj1}
|
||||||
# ${list2} Create List null
|
# ${list2} Create List null
|
||||||
# ${obj2} Create Dictionary objectId=${testClentSubID} protocolFields=${list2}
|
# ${obj2} Create Dictionary objectId=${testClentSubID} protocolFields=${list2}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ ${loginType} api
|
|||||||
#执行环境是否Widonws
|
#执行环境是否Widonws
|
||||||
${systemType} api
|
${systemType} api
|
||||||
#API配置信息
|
#API配置信息
|
||||||
${host} 192.168.40.120
|
${host} 192.168.44.17
|
||||||
${port} 8080
|
${port} 8080
|
||||||
${authmode} 1
|
${authmode} 1
|
||||||
${authCode} ${EMPTY}
|
${authCode} ${EMPTY}
|
||||||
@@ -21,14 +21,15 @@ ${testSubscriberID} $test57
|
|||||||
#自动化标签
|
#自动化标签
|
||||||
${userTagIds} ${EMPTY}
|
${userTagIds} ${EMPTY}
|
||||||
#Documentation] 是否添加测试终端IP到策略统一配置,0为不添加测试终端IP,1为添加测试终端IP,默认1
|
#Documentation] 是否添加测试终端IP到策略统一配置,0为不添加测试终端IP,1为添加测试终端IP,默认1
|
||||||
${addTestClentIPFlag} 0
|
${addTestClentIPFlag} 1
|
||||||
|
#测试环境是否需要把tsgui和api添加为SecurityPolicy-Allow 1为需要,默认1 ,
|
||||||
|
${addTsgUIAPIFlag} 1
|
||||||
#执行需要暂停时间
|
#执行需要暂停时间
|
||||||
#策略下发后到验证需等待时间
|
#策略下发后到验证需等待时间
|
||||||
${policyVerificationSleepSeconds} 20
|
${policyVerificationSleepSeconds} 20
|
||||||
#策略验证后到验证策略日志需等待时间
|
#策略验证后到验证策略日志需等待时间
|
||||||
${policyLogVerificationSleepSeconds} 60
|
${policyLogVerificationSleepSeconds} 60
|
||||||
${path} F:/tsg-git/tsg_autotest/05-Other/
|
${path} C:/Users/admin/git/tsg_autotest/05-Other/
|
||||||
${currentpath} E:/auto_git/eclipsegit/tsg_autotest/
|
|
||||||
${curlbatpath} ${path}/curl/
|
${curlbatpath} ${path}/curl/
|
||||||
${mailpath} ${path}/mail/
|
${mailpath} ${path}/mail/
|
||||||
${responsePageFiles} ${path}/response_pages_files/
|
${responsePageFiles} ${path}/response_pages_files/
|
||||||
|
|||||||
Reference in New Issue
Block a user