Settings
This commit is contained in:
163
01-TestCase/tsg_bfapi/setting/Dnsrecords.robot
Normal file
163
01-TestCase/tsg_bfapi/setting/Dnsrecords.robot
Normal file
@@ -0,0 +1,163 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_adc 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_bfapi/ApiRequest.robot
|
||||
Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/dnsrecords
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Dnsrecords_A_-00001
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=192.168.0.1
|
||||
${Dict2} Create Dictionary value=192.168.0.2
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=A recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": 1, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
Dnsrecords_MX_-00002
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=abc.com priority=10
|
||||
${Dict2} Create Dictionary value=edf.com priority=12
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=MX recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
Dnsrecords_CNAME_-00003
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=abc.com
|
||||
${Dict2} Create Dictionary value=edf.com
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
Dnsrecords_AAAA_-00004
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=2000:db8:2de::e13
|
||||
${Dict2} Create Dictionary value=2000:db8:2de::e13
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=AAAA recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
Dnsrecords_TXT_-00005
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=abc.com
|
||||
${Dict2} Create Dictionary value=edf.com
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
Dnsrecords_NS_-00006
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=abc.com
|
||||
${Dict2} Create Dictionary value=edf.com
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
Dnsrecords_PTR_-00007
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=abc.com
|
||||
${Dict2} Create Dictionary value=edf.com
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
Reference in New Issue
Block a user