feat(API):增加TsgAPI接口测试用例
Keyring策略文件、 可信证书颁发机构策略文件、 内容劫持策略文件、 访问阻断页面策略文件、 注入脚本策略文件、 流量转发目的地址配置和中间证书
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_bf_api Clear_All_Policys
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url1} /policy/profile/keyringobj
|
||||
${url2} /policy/profile/trustedcacertobj
|
||||
${url3} /policy/profile/responsepages
|
||||
${url4} /policy/profile/hijackfiles
|
||||
${url5} /policy/profile/insertscripts
|
||||
${url6} /policy/profile/trafficmirror
|
||||
|
||||
*** Test Cases ***
|
||||
Keyring Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url1} ${reqData}
|
||||
|
||||
Trusted Cert Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url2} ${reqData}
|
||||
|
||||
Response Pages Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url3} ${reqData}
|
||||
|
||||
Hijack Files Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url4} ${reqData}
|
||||
|
||||
Insert Scripts Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url5} ${reqData}
|
||||
|
||||
Traffic Mirror Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url6} ${reqData}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Hijack_Files
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/hijackfiles
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Hijack Files Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile2 ${url} Hijack Files-files/ Create-Hijack Files-test-3.html hijack
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} Hijack Files-files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Insert_Scripts
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/insertscripts
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Insert Scripts Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile2 ${url} Insert Scripts-files/ Create-Insert Scripts-test-1.js insert
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
# 修改
|
||||
${reqHeader_edit} Set Variable {"isValid":1,"format":"css","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} Insert Scripts-files/ Create-Insert Scripts-test.css ${reqHeader_edit}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_bf_api Cached_Intermediate_Certificates
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/exch/intermediacert
|
||||
|
||||
*** Test Cases ***
|
||||
Intermedia Cert Policy case
|
||||
|
||||
# 查询1
|
||||
${suffix_quary} Catenate SEPARATOR=& certId=269 sni=nationalbank.kz
|
||||
QueryPolicyFile ${url} ${suffix_quary}
|
||||
|
||||
# 查询2
|
||||
${suffix_quary} Catenate SEPARATOR=& certIds=263,265 sni=dw-online.ksosoft
|
||||
QueryPolicyFile ${url} ${suffix_quary}
|
||||
|
||||
# 启用/暂停
|
||||
${certId} QueryPolicyFile2 ${url} isValid=1
|
||||
${certIds} Create List ${certId}
|
||||
${data} Set Variable {"opAction":"disable","certIds":${certIds}}
|
||||
UpdatePolicyFile2 ${url} ${data}
|
||||
${data2} Set Variable {"opAction":"enable","certIds":${certIds}}
|
||||
UpdatePolicyFile2 ${url} ${data2}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} keyringIds ${keyringId}
|
||||
Force Tags tsg_bf_api Decryption_Keyrings
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/keyringobj
|
||||
${keyringId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Keyring Policy File case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyMutipartFile ${url} Keyrings/root/ mesalab-ca-cert.pem mesalab-ca-key.pem
|
||||
|
||||
# 查询
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
${keyringName} Get From Dictionary ${response} keyringName
|
||||
QueryPolicyFile ${url} keyringId=${keyringId}&keyringName=${keyringName}
|
||||
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"opAction":"update","returnData":1,"keyringName":"test_edit","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":"${keyringId}","includeRoot":0}
|
||||
UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Response_Pages
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/responsepages
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Response Pages Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile2 ${url} Response pages-files/ Create-Response Pages-test-1.html resPages
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"format":"html","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} Response pages-files/ Create-Response Pages-test.html ${header_edit}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Traffic_Mirror_Profiles
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/trafficmirror
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Traffic Mirror Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile3 ${url}
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
# 修改
|
||||
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
|
||||
UpdatePolicyFile2 ${url} ${reqData_edit}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} certIds ${certId}
|
||||
Force Tags tsg_bf_api Trusted_Certificate_Authorities
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/functionalKeywords.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/trustedcacertobj
|
||||
${certId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Trusted Cert Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile ${url} Keyrings/root/ tango-ca-trust-ca-cer.pem
|
||||
|
||||
# 查询
|
||||
${certId} Get From Dictionary ${response} certId
|
||||
${certName} Get From Dictionary ${response} certName
|
||||
QueryPolicyFile ${url} certId=${certId}&certName=${certName}
|
||||
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"opAction":"update","certName":"test_edit","certId":"${certId}","returnData":1}
|
||||
UpdatePolicyFile ${url} Keyrings/Intermediate/ tang-ca-v3-intermediate-01-cer.pem ${header_edit}
|
||||
|
||||
@@ -4,8 +4,8 @@ Library OperatingSystem
|
||||
Library RequestsLibrary
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg-bf-api/common.txt
|
||||
Resource ../../../02-Keyword/tsg-bf-api/apirequest.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/apirequest.robot
|
||||
Resource ../../../03-Variable/bifangapivariable.txt
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user