This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_adc/Wan_Nat/Snat_00002.robot

83 lines
4.9 KiB
Plaintext
Raw Normal View History

*** Settings ***
Test Teardown DeletePolicyAndObjectAndIPpoor ${policyIds} ${wan_ippoor}
Force Tags tsg_adc_wp adc_api wan_nat
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_adc/FileOperation.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../05-Other/AllFlowCaseVariable.txt
Resource ../../../02-Keyword/tsg_common/StmpHandle.robot
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${wan_ippoor} ${EMPTY}
*** Test Cases ***
a_wan_nat-snat-00002
[Tags] Never+IP Pools内多个IP
Comment 创建ip1
${must_parameter} Create Dictionary profileName=jwctest profileId=
${iplist1} Create Dictionary ip=192.168.50.7 relative_location=internal link_info={"link_id":123,"src_mac":321}
${wan_nat_ip_iplist} Create List ${iplist1}
${ip1} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
Comment 创建ip1
${must_parameter} Create Dictionary profileName=jwctest-1 profileId=
${iplist1} Create Dictionary ip=192.168.50.8 relative_location=internal link_info={"link_id":123,"src_mac":321}
${wan_nat_ip_iplist} Create List ${iplist1}
${ip2} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
Comment 创建ip1
${must_parameter} Create Dictionary profileName=jwctest-2 profileId=
${iplist1} Create Dictionary ip=192.168.50.9 relative_location=internal link_info={"link_id":123,"src_mac":321}
${wan_nat_ip_iplist} Create List ${iplist1}
${ip3} Add&EditWanIpPood ${must_parameter} ${wan_nat_ip_iplist}
Comment 创建snat策略
${policyDict} Create Dictionary policyName=wan_nat_snat-00002 policyType=wannat policyDesc=autotest action=wannat userRegion={"method":"snat","snat_ip_pool_profile_id":[${ip1},${ip2},${ip3}],"snat_vpn_user_account":"user-1","connection_timeout":"5","ip_select_option":{"snat_algorithm":"random","time":"","count":""}} isValid=${1}
log ${policyDict}
${rescode} ${policyId2} AddPolicies 1 ${policyDict} v2
insert_policyId_to_file1 ip1 ${ip1}
insert_policyId_to_file1 ip2 ${ip2}
insert_policyId_to_file1 ip3 ${ip3}
insert_policyId_to_file1 snat3 ${policyId2}
b_wan_nat-snat-00002
[Tags] Never+IP Pools内单个IP
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_sant_00001.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List Welcome to nginx HTTP
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/wan_nat_sant_00002.bat
${stringlist} run keyword if '${systemType}'=='Windows' Create List self signed certificate
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup test.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 202.106.196.115
${rescode} SystemCommands ${commandstr} ${stringlist}
Comment 功能端验证
${FTP} FTP_login ftp://192.168.44.8/test.txt -u"ftpuser:123456" 123456
should contain ${FTP} ftp_success
Comment 功能端验证
${Smtp服务器} Set Variable 192.168.40.156
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable yyq@163.com
${邮箱密码} Set Variable 111111
${邮件主题} Set Variable 你好明天
${发送者} Set Variable yyq@163.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["zmm@163.com"]
${抄送者} Set Variable ["zmm@163.com"]
${密送者} Set Variable ["zmm@163.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_success
c_wan_nat-snat-00002
[Tags] Never+IP Pools内单个IP
${policyIds} Create List {"policyType":"wannat","policyIds":[${snat3}]}
${wan_ippoor} Create List ${ip1} ${ip2} ${ip3}