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_bfapi/policy_object/20.08版本后废弃ip单元参数修改.robot
2020-07-23 16:21:20 +08:00

54 lines
2.5 KiB
Plaintext

*** Settings ***
Test Teardown DeletePolicyAndObjectAndProfile ${policyIds} ${objectIds} ${profiles}
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Object.robot
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Log.robot
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Library json
Library DateTime
*** Variables ***
@{policyIds}
@{profiles}
*** Test Cases ***
single-object
Comment 创建IP
#object为IP→endpoint时的addItemList单个对象
${addItemList1} Create Dictionary isSession=endpoint ip=192.168.41.68-192.168.41.69 port=0-0 direction=0 protocol=0 isInitialize=0
#可以添加多个
${addItemLists} Create list ${addItemList1}
#objectList对象
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=${addItemLists}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectIds} Set Variable ${objectId1}
Log To Console Create IP Object
${params} Create Dictionary objectId=${objectId1} itemType=ip
${rescode} ${itemIds} ${itemList} GetObjectItems ${params}
Log To Console ${itemIds}
Comment 更新IP
#更新对象属性
FOR ${item} IN @{itemList}
Set To Dictionary ${item} ip 192.168.41.67-192.168.41.69
Remove From Dictionary ${item} isInitialize
Set To Dictionary ${item} port 0-1
END
${objectDict} Create Dictionary objectId=${objectId1} objectType=ip
... updateItemList=${itemList}
log ${objectDict}
log ${itemList}
${rescode} UpdateObjects ${1} ${objectDict} update
Log To Console Create IP Object
group-object
Comment 创建IP
${subObjectIds} Create list 18470 18439
${objectDict} Create Dictionary objectType=ip isValid=${1} subObjectIds=${subObjectIds}
log ${objectDict}
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
${objectIds} Set Variable ${objectId1}
Log To Console Create IP Object
${params} Create Dictionary objectId=${objectId1} itemType=ip
Comment 更新IP
${objectDict} Create Dictionary objectId=${objectId1} objectType=ip subObjectIds=${subObjectIds}
${rescode} UpdateObjects ${1} ${objectDict} update
Log To Console Create IP Object