添加 Wan Vpn 新建与删除关键字 以及 使用示例
This commit is contained in:
36
01-TestCase/tsg_bfapi/setting/WanVpn.robot
Normal file
36
01-TestCase/tsg_bfapi/setting/WanVpn.robot
Normal file
@@ -0,0 +1,36 @@
|
||||
*** 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_vpn_1
|
||||
#添加一个vpn
|
||||
${wan_vpn_dict} Create Dictionary username=zmmtest1 password=abcdef iconColor=#dddddd
|
||||
${wan_vpn_list} Create List ${wan_vpn_dict}
|
||||
${a} AddWanVpn ${wan_vpn_list}
|
||||
log ${a}
|
||||
create_wan_vpn_2
|
||||
#添加一个vpn
|
||||
${wan_vpn_dict} Create Dictionary username=zmmtest2 password=abcdef iconColor=#dddddd
|
||||
${wan_vpn_dict_2} Create Dictionary username=zmmtest3 password=abcdef iconColor=#dddddd
|
||||
${wan_vpn_list} Create List ${wan_vpn_dict} ${wan_vpn_dict_2}
|
||||
${a} AddWanVpn ${wan_vpn_list}
|
||||
log ${a}
|
||||
delete_wan_vpn_1
|
||||
# 删除一个vpn
|
||||
${deletelist} Create List 31
|
||||
${a} DeleteWanVpn ${deletelist}
|
||||
delete_wan_vpn_2
|
||||
# 删除一个vpn
|
||||
${deletelist} Create List 35 33
|
||||
${a} DeleteWanVpn ${deletelist}
|
||||
@@ -88,6 +88,26 @@ AddObject2
|
||||
${rescodeReturn} Set Variable ${response['code']}
|
||||
[Return] ${rescodeReturn} ${objectId}
|
||||
|
||||
AddWanVpn
|
||||
[Arguments] ${wan_vpnList}
|
||||
${body} WanVpn ${wan_vpnList}
|
||||
${response} BasePostRequest /${version}/policy/profile/wannat/vpn/account ${body}
|
||||
log ${response}
|
||||
${rescodeReturn} Set Variable ${response['code']}
|
||||
[Return] ${rescodeReturn}
|
||||
|
||||
DeleteWanVpn
|
||||
[Arguments] ${vpnlist}
|
||||
#删除Vpn
|
||||
${body} Create Dictionary ids=${vpnlist}
|
||||
log 删除vpn
|
||||
${response} BaseDeleteRequest /${version}/policy/profile/wannat/vpn/account ${body}
|
||||
${response_code} Get From Dictionary ${response} code
|
||||
Should Be Equal As Strings ${response_code} 200
|
||||
${response} Convert to String ${response}
|
||||
log ${response}
|
||||
|
||||
|
||||
EditObject
|
||||
[Arguments] ${objectList} ${opAction}
|
||||
${body} ObjectParamsOpertion ${0} ${objectList} ${opAction}
|
||||
|
||||
@@ -241,7 +241,11 @@ OtherParams
|
||||
${return} ${itemDesc} Run Keyword And Ignore Error Set Variable ${values}[6]
|
||||
Run Keyword If "${return}"!="FAIL" and "${itemDesc}"!="${EMPTY}" Set To Dictionary ${obj} itemDesc=${itemDesc}
|
||||
|
||||
|
||||
|
||||
WanVpn
|
||||
[Arguments] ${wanvpnlist}
|
||||
${data} Set Variable "opAction":"add","returnData":1
|
||||
${dict}= Evaluate eval ('{${data}}')
|
||||
${data2} set to dictionary ${dict} list=${wanvpnlist}
|
||||
[Return] ${data2}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user