WAN NAT IP池管理接口 关键字与实例
This commit is contained in:
41
01-TestCase/tsg_bfapi/setting/WanIPpoor.robot
Normal file
41
01-TestCase/tsg_bfapi/setting/WanIPpoor.robot
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
*** Settings ***
|
||||||
|
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||||
|
Force Tags tsg_adc proxy_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_bfapi/ApiRequest.robot
|
||||||
|
Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||||
|
|
||||||
|
*** Variables ***
|
||||||
|
${policyIds} ${EMPTY}
|
||||||
|
${objectids} ${EMPTY}
|
||||||
|
|
||||||
|
*** Test Cases ***
|
||||||
|
create_wan_ip_pood_add
|
||||||
|
# 新增不填写 profileId
|
||||||
|
${must_parameter} Create Dictionary profileName=zmmtest profileId=
|
||||||
|
${iplist1} Create Dictionary ip=1.1.1.1 relative_location=internal link_info={"link_id":123,"src_mac":321}
|
||||||
|
${iplist2} Create Dictionary ip=8.8.8.8 relative_location=external link_info={"xxxx":567,"yyyy":890}
|
||||||
|
${wan_nat_ip_iplist} Create List ${iplist1} ${iplist2}
|
||||||
|
${WanNatIpPood} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
|
||||||
|
|
||||||
|
|
||||||
|
create_wan_ip_pood_updata
|
||||||
|
# 修改填写 profileId
|
||||||
|
${must_parameter} Create Dictionary profileName=zmmtest profileId=41
|
||||||
|
${iplist1} Create Dictionary ip=1.1.1.1 relative_location=internal link_info={"link_id":123,"src_mac":321}
|
||||||
|
${wan_nat_ip_iplist} Create List ${iplist1}
|
||||||
|
${WanNatIpPood} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
|
||||||
|
|
||||||
|
|
||||||
|
delete_wan_ip_pood
|
||||||
|
# 删除一个vpn
|
||||||
|
${deletelist} Create List 41
|
||||||
|
${a} DeleteWanIpPood ${deletelist}
|
||||||
|
delete_wan_ip_pood_2
|
||||||
|
# 删除一个vpn
|
||||||
|
${deletelist} Create List 43 45
|
||||||
|
${a} DeleteWanIpPood ${deletelist}
|
||||||
|
|
||||||
@@ -107,6 +107,32 @@ DeleteWanVpn
|
|||||||
${response} Convert to String ${response}
|
${response} Convert to String ${response}
|
||||||
log ${response}
|
log ${response}
|
||||||
|
|
||||||
|
Add&EditWanIpPood
|
||||||
|
[Arguments] ${must_parameter} ${wan_nat_ip_iplist}
|
||||||
|
${body} WanNatIpPood ${must_parameter} ${wan_nat_ip_iplist}
|
||||||
|
log ${body}
|
||||||
|
${response} run keyword if '${must_parameter}[profileId]'=="" BasePostRequest /${version}/policy/profile/wannat/ippool ${body}
|
||||||
|
... ELSE BaseEditRequestOK /${version}/policy/profile/wannat/ippool ${body}
|
||||||
|
log ${response}
|
||||||
|
${response_code} Set Variable ${response['code']}
|
||||||
|
Should Be Equal As Strings ${response_code} 200
|
||||||
|
${response} Convert to String ${response}
|
||||||
|
log ${response}
|
||||||
|
[Return] ${response}
|
||||||
|
|
||||||
|
DeleteWanIpPood
|
||||||
|
[Arguments] ${vpnlist}
|
||||||
|
#删除Vpn
|
||||||
|
${body} Create Dictionary profileIds=${vpnlist}
|
||||||
|
log 删除vpn
|
||||||
|
${response} BaseDeleteRequest /${version}/policy/profile/wannat/ippool ${body}
|
||||||
|
${response_code} Get From Dictionary ${response} code
|
||||||
|
Should Be Equal As Strings ${response_code} 200
|
||||||
|
${response} Convert to String ${response}
|
||||||
|
log ${response}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EditObject
|
EditObject
|
||||||
[Arguments] ${objectList} ${opAction}
|
[Arguments] ${objectList} ${opAction}
|
||||||
|
|||||||
@@ -248,4 +248,17 @@ WanVpn
|
|||||||
${data2} set to dictionary ${dict} list=${wanvpnlist}
|
${data2} set to dictionary ${dict} list=${wanvpnlist}
|
||||||
[Return] ${data2}
|
[Return] ${data2}
|
||||||
|
|
||||||
|
WanNatIpPood
|
||||||
|
[Arguments] ${must_parameter} ${wan_nat_ip_iplist}
|
||||||
|
# 编写iplist json格式
|
||||||
|
${wan_nat_ip_iplist} Create Dictionary profileId=${must_parameter}[profileId] profileName=${must_parameter}[profileName] ipList=${wan_nat_ip_iplist} isValid=1
|
||||||
|
#编写二层list内地格式
|
||||||
|
${wan_nat_ip_list} Create List ${wan_nat_ip_iplist}
|
||||||
|
# 判断sjon是用于修改还是新增
|
||||||
|
${opAction} run keyword if '${must_parameter}[profileId]'=="" Set Variable add
|
||||||
|
... ELSE Set Variable update
|
||||||
|
#编写最外面的格式
|
||||||
|
${wan_nat_ip_pood_data} Create Dictionary opAction=${opAction} returnData=1 list=${wan_nat_ip_list}
|
||||||
|
# 返回请求json
|
||||||
|
log ${wan_nat_ip_pood_data}
|
||||||
|
[Return] ${wan_nat_ip_pood_data}
|
||||||
|
|||||||
Reference in New Issue
Block a user