1、IP类适配GEO类型;
2、appid变量内置初始化补全; 3、策略对象删除必填部分校验; 4、公共对象适配addobjects;
This commit is contained in:
@@ -8,6 +8,7 @@ Variables ../../../05-Other/variable/policy/apipolicyrequesttest.py
|
||||
Variables ../../../05-Other/variable/policy/apipolicyjsonbase.py
|
||||
Resource ../../../03-Variable/ApplicationID.txt
|
||||
#Resource ../../tsg_bfapi/PolicyObject.robot
|
||||
Library ../../../04-CustomLibrary/Custometest/Common.py
|
||||
|
||||
*** Variables ***
|
||||
${policyIds}
|
||||
@@ -280,8 +281,192 @@ Test-Policy-Test
|
||||
#新增对象添加到删除策略列表,及时添加避免后面异常导致遗留垃圾数据
|
||||
#${policyId1} Set Variable {"policyType":"tsg_security","policyIds":[${policyid}]}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyid}]}
|
||||
|
||||
|
||||
|
||||
Test-Policy-TestNew
|
||||
[Tags] test
|
||||
#获取当前Case名称
|
||||
${sourcejson} Set Variable ${EMPTY}
|
||||
${destjson} Set Variable ${EMPTY}
|
||||
${filterjson} Set Variable ${EMPTY}
|
||||
${iconColor} Set Variable 31739C
|
||||
log ${TEST NAME}
|
||||
#IP对象
|
||||
log @{Test}
|
||||
${tt} Get From List ${Test} 0
|
||||
${parmList} Create List 1.1.1.2 0-65535
|
||||
${ipObjs} JsonIPItem ${parmList}
|
||||
${parmList} Create List 1.1.1.1-1.1.1.200 1-65535
|
||||
${ipObj} JsonIPItem ${parmList}
|
||||
${ipObjs} Catenate SEPARATOR=, ${ipObjs} ${ipObj}
|
||||
${parmList} Create List 2.2.2.2/24 443
|
||||
${ipObj} JsonIPItem ${parmList}
|
||||
${ipObjs} Catenate SEPARATOR=, ${ipObjs} ${ipObj}
|
||||
${parmList} Create List a1::b1 0-65535
|
||||
${ipObj} JsonIPItem ${parmList}
|
||||
${ipObjs} Catenate SEPARATOR=, ${ipObjs} ${ipObj}
|
||||
${parmList} Create List a1::b1-a1::b15 1-65535
|
||||
${ipObj} JsonIPItem ${parmList}
|
||||
${ipObjs} Catenate SEPARATOR=, ${ipObjs} ${ipObj}
|
||||
${parmList} Create List a1::b1/128 8080
|
||||
${ipObj} JsonIPItem ${parmList}
|
||||
${ipObjs} Catenate SEPARATOR=, ${ipObjs} ${ipObj}
|
||||
${parmList} Create List 192.168.0.1 0-65535
|
||||
${ipObj} JsonIPItem ${parmList}
|
||||
${ipObjs} Catenate SEPARATOR=, ${ipObjs} ${ipObj}
|
||||
#拼接obj对象
|
||||
# ${parmList} ${objectType} 0 ${objectSubType} 1 ${objectName} 2 ${addItemList} 3 ${updateItemList} 4 ${deleteItemIds} 5 ${subObjectIds} 6 ${ipLearning} 7
|
||||
${parmList} Create List ip endpoint ${TEST NAME}_IP ${ipObjs} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${iconColor}
|
||||
${ipObjjson} JsonOBJ ${parmList}
|
||||
#拼接新增json
|
||||
#${parmList}:${opAction}0 ${returnData} 1 ${objectList} 2
|
||||
${parmList} Create List add 1 ${ipObjjson}
|
||||
${ipObjjson} JsonOBJS ${parmList}
|
||||
#add Object,return statuscode,objectid 多个返回以英文逗号分隔
|
||||
${returncode} ${ipid} AddObjectData 1 ${ipObjjson}
|
||||
#新增对象添加到删除对象列表,及时添加避免下面异常导致遗留垃圾数据
|
||||
${objectid} Set Variable ${ipid}
|
||||
${objectIds} Create List [${objectid}]
|
||||
${sourcejson} Set Variable {"objectId" : ${ipid},"protocolField" : "TSG_SECURITY_SOURCE_ADDR"}
|
||||
${destjson} Set Variable {"objectId" : ${ipid},"protocolField" : "TSG_SECURITY_DESTINATION_ADDR"}
|
||||
|
||||
#Geo对象
|
||||
${parmList} Create List Armenia.Abovyan.*
|
||||
${ipGeos} JsonGEOItem ${parmList}
|
||||
${parmList} Create List Armenia.Agarak.*
|
||||
${ipGeo} JsonGEOItem ${parmList}
|
||||
${ipGeos} Catenate SEPARATOR=, ${ipGeos} ${ipGeo}
|
||||
#拼接obj对象
|
||||
# ${parmList} ${objectType} 0 ${objectSubType} 1 ${objectName} 2 ${addItemList} 3 ${updateItemList} 4 ${deleteItemIds} 5 ${subObjectIds} 6 ${ipLearning} 7
|
||||
${parmList} Create List ip geo_location ${TEST NAME}_GEO ${ipGeos} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${iconColor}
|
||||
${ipGeojson} JsonOBJ ${parmList}
|
||||
#拼接新增json
|
||||
#${parmList}:${opAction}0 ${returnData} 1 ${objectList} 2
|
||||
${parmList} Create List add 1 ${ipGeojson}
|
||||
${ipObjjson} JsonOBJS ${parmList}
|
||||
#add Object,return statuscode,objectid 多个返回以英文逗号分隔
|
||||
${returncode} ${ipid} AddObjectData 1 ${ipObjjson}
|
||||
#新增对象添加到删除对象列表,及时添加避免下面异常导致遗留垃圾数据
|
||||
${objectid} Catenate SEPARATOR=, ${objectid} ${ipid}
|
||||
${objectIds} Create List [${objectid}]
|
||||
${sourcejson} Catenate SEPARATOR=, ${sourcejson} {"objectId" : ${ipid},"protocolField" : "TSG_SECURITY_SOURCE_LOCATION"}
|
||||
${destjson} Catenate SEPARATOR=, ${destjson} {"objectId" : ${ipid},"protocolField" : "TSG_SECURITY_DESTINATION_LOCATION"}
|
||||
|
||||
#IPLEARN对象
|
||||
#${parmList}:${fromFqdns} ${fromProtocol} ${learningDepth} ${agingTime} ${voteClientNum} ${learnedIpLimit}
|
||||
${parmList} Create List "*abc.com","$www.dce.com" HTTP,SSL 2 48 20 10000
|
||||
${ipLearns} JsonIPLEARNItem ${parmList}
|
||||
#拼接obj对象
|
||||
# ${parmList} ${objectType} 0 ${objectSubType} 1 ${objectName} 2 ${addItemList} 3 ${updateItemList} 4 ${deleteItemIds} 5 ${subObjectIds} 6 ${ipLearning} 7
|
||||
${parmList} Create List ip ip_learning ${TEST NAME}_IPLEARN ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${ipLearns} ${iconColor}
|
||||
${ipLearnjson} JsonOBJ ${parmList}
|
||||
#拼接新增json
|
||||
#${parmList}:${opAction}0 ${returnData} 1 ${objectList} 2
|
||||
${parmList} Create List add 1 ${ipLearnjson}
|
||||
${ipObjjson} JsonOBJS ${parmList}
|
||||
#add Object,return statuscode,objectid 多个返回以英文逗号分隔
|
||||
${returncode} ${ipid} AddObjectData 1 ${ipObjjson}
|
||||
#新增对象添加到删除对象列表,及时添加避免下面异常导致遗留垃圾数据
|
||||
${objectid} Catenate SEPARATOR=, ${objectid} ${ipid}
|
||||
${objectIds} Create List [${objectid}]
|
||||
${sourcejson} Catenate SEPARATOR=, ${sourcejson} {"objectId" : ${ipid},"protocolField" : "TSG_SECURITY_SOURCE_ADDR"}
|
||||
${destjson} Catenate SEPARATOR=, ${destjson} {"objectId" : ${ipid},"protocolField" : "TSG_SECURITY_DESTINATION_ADDR"}
|
||||
|
||||
#subid对象
|
||||
#${parmList}:${itemId} ${keywordArray} ${isHexbin} ${isInitialize}
|
||||
#创建拼接对象参数list
|
||||
${parmList} Create List ${EMPTY} $test1 0 0
|
||||
#调用关键字生成对象itemjson
|
||||
${subids} JsonKeywords ${parmList}
|
||||
#添加另一个 创建拼接对象参数list
|
||||
${parmList} Create List ${EMPTY} $test62 0 0
|
||||
${subid} JsonKeywords ${parmList}
|
||||
${subids} Catenate SEPARATOR=, ${subids} ${subid}
|
||||
#拼接obj对象
|
||||
# ${parmList} ${objectType} 0 ${objectSubType} 1 ${objectName} 2 ${addItemList} 3 ${updateItemList} 4 ${deleteItemIds} 5 ${subObjectIds} 6 ${ipLearning} 7
|
||||
${parmList} Create List subscriberid subscriberid ${TEST NAME}_SUBID ${subids} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${iconColor}
|
||||
${subidjson} JsonOBJ ${parmList}
|
||||
#拼接新增json
|
||||
#${parmList}:${opAction}0 ${returnData} 1 ${objectList} 2
|
||||
${parmList} Create List add 1 ${subidjson}
|
||||
${subidjson} JsonOBJS ${parmList}
|
||||
#add Object,return statuscode,objectid 多个返回以英文逗号分隔
|
||||
${returncode} ${subidid} AddObjectData 1 ${subidjson}
|
||||
${objectid} Catenate SEPARATOR=, ${objectid} ${subidid}
|
||||
${objectIds} Create List [${objectid}]
|
||||
${sourcejson} Catenate SEPARATOR=, ${sourcejson} {"objectId" : ${subidid},"protocolField" : ""}
|
||||
#${destjson} Catenate SEPARATOR=, ${destjson} {"objectId" : ${subidid},"protocolField" : ""}
|
||||
|
||||
#fqdn对象
|
||||
#${parmList}:${itemId} ${keywordArray} ${isHexbin} ${isInitialize}
|
||||
${parmList} Create List ${EMPTY} $www.abc.com 0 0
|
||||
${fqdns} JsonKeywords ${parmList}
|
||||
${parmList} Create List ${EMPTY} *.abc.com 0 0
|
||||
${fqdn} JsonKeywords ${parmList}
|
||||
${fqdns} Catenate SEPARATOR=, ${fqdns} ${fqdn}
|
||||
#拼接obj对象
|
||||
# ${parmList} ${objectType} 0 ${objectSubType} 1 ${objectName} 2 ${addItemList} 3 ${updateItemList} 4 ${deleteItemIds} 5 ${subObjectIds} 6 ${ipLearning} 7
|
||||
${parmList} Create List fqdn fqdn ${TEST NAME}_FQDN ${fqdns} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${iconColor}
|
||||
${fqdnjson} JsonOBJ ${parmList}
|
||||
#拼接新增json
|
||||
#${parmList}:${opAction}0 ${returnData} 1 ${objectList} 2
|
||||
${parmList} Create List add 1 ${fqdnjson}
|
||||
${fqdnjson} JsonOBJS ${parmList}
|
||||
#add Object,return statuscode,objectid 多个返回以英文逗号分隔
|
||||
${returncode} ${fqdnidSub} AddObjectData 1 ${fqdnjson}
|
||||
#新增对象添加到删除对象列表,及时添加避免下面异常导致遗留垃圾数据
|
||||
#${objectid} Catenate SEPARATOR=, ${objectid} ${fqdnid}
|
||||
${objectIds} Create List [${objectid}] [${fqdnidSub}]
|
||||
|
||||
#fqdn对象组
|
||||
#拼接obj对象
|
||||
# ${parmList} ${objectType} 0 ${objectSubType} 1 ${objectName} 2 ${addItemList} 3 ${updateItemList} 4 ${deleteItemIds} 5 ${subObjectIds} 6 ${ipLearning} 7
|
||||
${parmList} Create List fqdn fqdn ${TEST NAME}_FQDN_GROUP ${EMPTY} ${EMPTY} ${EMPTY} ${fqdnidSub} ${EMPTY} ${iconColor}
|
||||
${fqdnjson} JsonOBJ ${parmList}
|
||||
#拼接新增json
|
||||
#${parmList}:${opAction}0 ${returnData} 1 ${objectList} 2
|
||||
${parmList} Create List add 1 ${fqdnjson}
|
||||
${fqdnjson} JsonOBJS ${parmList}
|
||||
#add Object,return statuscode,objectid 多个返回以英文逗号分隔
|
||||
${returncode} ${fqdnid} AddObjectData 1 ${fqdnjson}
|
||||
${objectid} Catenate SEPARATOR=, ${objectid} ${fqdnid}
|
||||
${objectIds} Create List [${objectid}] [${fqdnidSub}]
|
||||
${filterjson} Set Variable {"objectId" : ${fqdnid},"protocolField" : "TSG_FIELD_SSL_SNI"}
|
||||
|
||||
#从变量文件中加载的新增对象JSON串
|
||||
# ${Test-LoadBase_POLICY}
|
||||
${appIdObjects} Set Variable ${SSL_ID}
|
||||
${userRegion} Set Variable "protocol" : "SSL","keyring" : 1,"decryption" : 1,"decrypt_mirror" : {"enable" : 0,"mirror_profile" : null}
|
||||
${policyDesc} Set Variable ${TEST NAME}_aututest
|
||||
#~!@#$%^&*()_+{}|:\"><?`1234567890-=\[\]\;\',./mn
|
||||
${parmList} Create List ${EMPTY} 1 ${TEST NAME}_Policy tsg_security intercept ${EMPTY} 1 ${userRegion} ${sourcejson} ${destjson} ${filterjson} ${appIdObjects} ${policyDesc} ${EMPTY} ${EMPTY} ${EMPTY}
|
||||
#${policyId}0 ${isValid}1 ${policyName}2 ${policyType}3 ${action}4 ${userTags}5 ${doLog}6 ${userRegion}7 ${source}8 ${destination}9 ${filterList}10 ${appIdObjects}11 ${policyDesc}12 ${effectiveRange}13 ${appSelectorObjects}14 ${scheduleId}15
|
||||
${policys} JsonPolicy ${parmList}
|
||||
#log ${Test-LoadBase_POLICYS}
|
||||
${parmList} Create List add 1 ${policys}
|
||||
${policysJson} JsonPolicys ${parmList}
|
||||
#add Object,return statcode,objectid
|
||||
${returncode} ${policyid} AddPolicyData 1 ${policysJson}
|
||||
|
||||
#新增对象添加到删除策略列表,及时添加避免后面异常导致遗留垃圾数据
|
||||
#${policyId1} Set Variable {"policyType":"tsg_security","policyIds":[${policyid}]}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyid}]}
|
||||
|
||||
test
|
||||
|
||||
|
||||
# 新建一个list变量
|
||||
${l1} create list aa bb
|
||||
# 为list追加数据 同Append To List
|
||||
${l2} create list 11 22
|
||||
${l3} create list
|
||||
# 为list追加数据 同Append To List
|
||||
Append To List ${l3} ${l1}
|
||||
Append To List ${l3} ${l2}
|
||||
log ${l3}
|
||||
log ${Test}
|
||||
${a} Get From List ${Test} 0
|
||||
${b} Get From List ${Test} 1
|
||||
#${tWarningMessage} Run Keyword If abcdef AutoItLibrary.Win Get Text Generate Fee Data warning message ELSE Set Variable ""
|
||||
|
||||
#${tIfDuplicateFee} Evaluate "Duplicate Fee Warning" in """${tWarningMessage}"""
|
||||
@@ -305,6 +490,8 @@ test
|
||||
# 为list追加数据 同Append To List
|
||||
Append To List @{list} dd
|
||||
|
||||
|
||||
|
||||
#可以获取list的某一段子list,从两端截取或从中间截取
|
||||
#list的下标从0开始
|
||||
@{list} Create List lilei hanmeimei liming liliang liming
|
||||
@@ -366,6 +553,9 @@ test
|
||||
|
||||
Test-GetRandomIP
|
||||
[Tags] test
|
||||
log ${CURDIR}
|
||||
${a} aisincludeb . 1.1.1.2
|
||||
${b} get_md5_01 E:/x509_cert_tool-master.zip
|
||||
${ip} GetRandomIP ipv4
|
||||
log ${ip}
|
||||
${ip} GetRandomIP ipv6
|
||||
|
||||
Reference in New Issue
Block a user