diff options
| author | hebingning <[email protected]> | 2023-11-28 20:19:58 +0800 |
|---|---|---|
| committer | hebingning <[email protected]> | 2023-11-28 20:19:58 +0800 |
| commit | 990380757d2c0e2398a44e733ac6baae28eccaf5 (patch) | |
| tree | 36930ad1124691535a2822643e7908b5c75d3529 | |
| parent | 38ac63a169fa4fe51ae868f8fe1c31dba56a3f42 (diff) | |
调整object,policy,profile相关逻辑,适配23.12版本api
| -rw-r--r-- | keyword/common/api_request.robot | 4 | ||||
| -rw-r--r-- | keyword/common/common.robot | 6 | ||||
| -rw-r--r-- | keyword/objects/object.robot | 160 | ||||
| -rw-r--r-- | keyword/objects/process_object_body.robot | 8 | ||||
| -rw-r--r-- | keyword/policys/policy.robot | 46 | ||||
| -rw-r--r-- | keyword/policys/process_policy_body.robot | 20 | ||||
| -rw-r--r-- | keyword/profiles/profile.robot | 16 | ||||
| -rw-r--r-- | other/data/template/template.yaml | 8 |
8 files changed, 177 insertions, 91 deletions
diff --git a/keyword/common/api_request.robot b/keyword/common/api_request.robot index f21b0a4..df72c01 100644 --- a/keyword/common/api_request.robot +++ b/keyword/common/api_request.robot @@ -37,8 +37,8 @@ DeleteRequest1 [Return] ${response}
UpFilePostRequest
- [Arguments] ${url} ${data} ${files} ${fileDesc}
- ${header} Set To Dictionary ${fileDesc} Authorization=${token}
+ [Arguments] ${url} ${data} ${files}
+ ${header} Create Dictionary Content-Type=multipart/form-data Authorization=${token}
Create Session api ${httpVersion}://${host}:${port} headers=${header} verify=false
#${aaa} evaluate type(${url})
# log -------${aaa}
diff --git a/keyword/common/common.robot b/keyword/common/common.robot index 8384caa..c79107e 100644 --- a/keyword/common/common.robot +++ b/keyword/common/common.robot @@ -291,10 +291,12 @@ AppendListToList ... 出:参${returnList}
[Arguments] ${returnList} ${insertList}
Comment 参数${objids}拼接后的list;参数${objectIds}对象ids
- Comment 如果参数${objectIds}返回多个id则逐个添加
+ Comment 如果参数${objectIds}返回多个id则逐个添加
+ log ${insertList}
FOR ${objdict} IN @{insertList}
Append To List ${returnList} ${objdict}
- END
+ END
+ log ${returnList}
Log AppendListToList-returnList:${returnList}
[Return] ${returnList}
diff --git a/keyword/objects/object.robot b/keyword/objects/object.robot index e14fe38..ff48aa8 100644 --- a/keyword/objects/object.robot +++ b/keyword/objects/object.robot @@ -75,9 +75,11 @@ AddLocalIPObject ${objectId1} Evaluate int(${objectId1})
${objectId1} Convert To Integer ${objectId1}
${object_ids} Create List
+ ${objects} Create List
Append To List ${object_ids} ${objectId1}
${object_ids} Create Dictionary object_ids=${object_ids}
- ${sourceClientIP} Create Dictionary objects=${object_ids} protocol_field=TSG_SECURITY_SOURCE_ADDR
+ Append To List ${objects} ${object_ids}
+ ${sourceClientIP} Create Dictionary objects=${objects} protocol_field=ATTR_SOURCE_ADDR not_flag=${0}
# ${}
# ${subiid} Convert To Integer ${subiid}
@@ -87,27 +89,33 @@ AddLocalIPObject # ${sourceImsi} Create Dictionary objectId=${imsi_id} protocolField=TSG_FILED_GTP_IMSI
${object_ids} Create List
+ ${objects} Create List
Append To List ${object_ids} ${imsi_id}
${object_ids} Create Dictionary object_ids=${object_ids}
- ${sourceImsi} Create Dictionary objects=${object_ids} protocol_field=TSG_FILED_GTP_IMSI
+ Append To List ${objects} ${object_ids}
+ ${sourceImsi} Create Dictionary objects=${objects} protocol_field=ATTR_GTP_IMSI not_flag=${0}
${phoneNum_id} Evaluate int(${phoneNum_id})
${phoneNum_id} Convert To Integer ${phoneNum_id}
# ${sourcePhoneNumber} Create Dictionary objectId=${phoneNum_id} protocolField=TSG_FILED_GTP_PHONE_NUMBER
${object_ids} Create List
+ ${objects} Create List
Append To List ${object_ids} ${phoneNum_id}
${object_ids} Create Dictionary object_ids=${object_ids}
- ${sourcePhoneNumber} Create Dictionary objects=${object_ids} protocol_field=TSG_FILED_GTP_PHONE_NUMBER
+ Append To List ${objects} ${object_ids}
+ ${sourcePhoneNumber} Create Dictionary objects=${objects} protocol_field=ATTR_GTP_PHONE_NUMBER not_flag=${0}
${apn_id} Evaluate int(${apn_id})
${apn_id} Convert To Integer ${apn_id}
# ${sourceApn} Create Dictionary objectId=${apn_id} protocolField=TSG_FILED_GTP_APN
${object_ids} Create List
+ ${objects} Create List
Append To List ${object_ids} ${apn_id}
${object_ids} Create Dictionary object_ids=${object_ids}
- ${sourceApn} Create Dictionary objects=${object_ids} protocol_field=TSG_FILED_GTP_APN
+ Append To List ${objects} ${object_ids}
+ ${sourceApn} Create Dictionary objects=${objects} protocol_field=ATTR_GTP_APN not_flag=${0}
${sourceList} Create List ${sourceClientIP} ${sourceImsi} ${sourcePhoneNumber} ${sourceApn}
@@ -282,7 +290,7 @@ DeleteIpByIds ${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary object_ids=${objectIds} vsys_id=${vsysId} object_type=ip
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary ids=${objectIds} vsys_id=${vsysId} type=ip
... ELSE Create Dictionary object_ids=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -298,7 +306,7 @@ DeleteFqdnByIds ${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary object_ids=${objectIds} vsys_id=${vsysId} object_type=fqdn
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary ids=${objectIds} vsys_id=${vsysId} type=fqdn
... ELSE Create Dictionary objectIds=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -314,7 +322,7 @@ DeleteHttpSignatureByIds ${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary object_ids=${objectIds} vsys_id=${vsysId} object_type=http_signature
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary ids=${objectIds} vsys_id=${vsysId} type=http_signature
... ELSE Create Dictionary objectIds=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -330,7 +338,7 @@ DeleteKeywordsByIds ${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary object_ids=${objectIds} vsys_id=${vsysId} object_type=keywords
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary ids=${objectIds} vsys_id=${vsysId} type=keywords
... ELSE Create Dictionary objectIds=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -346,7 +354,7 @@ DeleteUrlByIds ${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary object_ids=${objectIds} vsys_id=${vsysId} object_type=url
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary ids=${objectIds} vsys_id=${vsysId} type=url
... ELSE Create Dictionary objectIds=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -362,7 +370,7 @@ DeleteAccountByIds ${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary object_ids=${objectIds} vsys_id=${vsysId} object_type=account
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary ids=${objectIds} vsys_id=${vsysId} type=account
... ELSE Create Dictionary objectIds=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -379,7 +387,7 @@ DeleteMobileIdentityByIds ${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary object_ids=${objectIds} vsys_id=${vsysId} object_type=mobile_identity
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary ids=${objectIds} vsys_id=${vsysId} type=mobile_identity
... ELSE Create Dictionary objectIds=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -395,7 +403,7 @@ DeleteApnByIds ${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary object_ids=${objectIds} vsys_id=${vsysId} object_type=apn
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary ids=${objectIds} vsys_id=${vsysId} type=apn
... ELSE Create Dictionary objectIds=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -652,11 +660,11 @@ OrangeFilter [Documentation] filer对象处理,把一个filter的list处理为一个filter
#[Arguments] ${filterList} ${objectList}
[Arguments] ${objectList}
- ${filter} Create Dictionary objectList=${objectList}
- # ${list} Create List ${filter}
- ${list} Create Dictionary filter=${filter}
- ${list} Create List ${list}
- #${filterList} Append To List ${filter}
+ # ${filter} Create Dictionary objectList=${objectList}
+ # ${list} Create Dictionary filter=${filter}
+ ${list} Create List ${objectList}
+ log ${list}
+ log aaa
[Return] ${list}
GetPortFromPortRange
[Documentation] 从port范围(0-65535)获取port:
@@ -741,14 +749,42 @@ CreateObjectList log ${appName}
Comment 针对位置进行处理
${protocolFieldReturn} ${protocolField} Run Keyword And Ignore Error Get From Dictionary ${objectData} protocolField
+ ${protocolField} Run Keyword If "${protocolField}" == "TSG_FIELD_HTTP_HOST" Set Variable ATTR_HTTP_HOST
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_DOH_HOST" Set Variable ATTR_DOH_HOST
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_URL" Set Variable ATTR_HTTP_URL
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_FTP_URI" Set Variable ATTR_FTP_URI
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_REQ_HDR" Set Variable ATTR_HTTP_REQ_HDR
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_RES_HDR" Set Variable ATTR_HTTP_RES_HDR
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_REQ_BODY" Set Variable ATTR_HTTP_REQ_BODY
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_RES_BODY" Set Variable ATTR_HTTP_RES_BODY
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SSL_SNI" Set Variable ATTR_SSL_SNI
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SSL_SAN" Set Variable ATTR_SSL_SAN
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SSL_CN" Set Variable ATTR_SSL_CN
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_DNS_QNAME" Set Variable ATTR_DNS_QNAME
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_SUBJECT" Set Variable ATTR_MAIL_SUBJECT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_CONTENT" Set Variable ATTR_MAIL_CONTENT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_ATT_NAME" Set Variable ATTR_MAIL_ATT_NAME
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_ATT_CONTENT" Set Variable ATTR_MAIL_ATT_CONTENT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_FROM" Set Variable ATTR_MAIL_FROM
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_TO" Set Variable ATTR_MAIL_TO
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_ACCOUNT" Set Variable ATTR_MAIL_ACCOUNT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_FTP_CONTENT" Set Variable ATTR_FTP_CONTENT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_FTP_ACCOUNT" Set Variable ATTR_FTP_ACCOUNT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION" Set Variable ATTR_SIP_ORIGINATOR_DESCRIPTION
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SIP_RESPONDER_DESCRIPTION" Set Variable ATTR_SIP_RESPONDER_DESCRIPTION
+ ... ELSE IF "${protocolField}" == "TSG_SECURITY_SOURCE_ADDR" Set Variable ATTR_SOURCE_ADDR
+ ... ELSE IF "${protocolField}" == "TSG_SECURITY_DESTINATION" Set Variable ATTR_DESTINATION_ADDR
+ ... ELSE IF "${protocolField}" == "TSG_FILED_GTP_IMSI" Set Variable ATTR_GTP_IMSI
+ ... ELSE IF "${protocolField}" == "TSG_FILED_GTP_APN" Set Variable ATTR_GTP_APN
+ ... ELSE IF "${protocolField}" == "TSG_FILED_GTP_PHONE_NUMBER" Set Variable ATTR_GTP_PHONE_NUMBER
log ${objectData}
${objectIds} ${objectList} ${attribute} ${atributeObjectId} CreateObjects ${objectData} ${appName}
#${objectIds} ${objectList} CreateObjects ${objectData}
log passsssssssss
${objecTemptList} Run Keyword If "${protocolFieldReturn}"=="FAIL" Set Variable ${objectList}
- ... ELSE IF "${protocolField}" == "TSG_SECURITY_SOURCE_ADDR" or "${protocolField}" == "None" or "${protocolField}" == "TSG_SECURITY_SOURCE_LOCATION" or "${protocolField}" == "TSG_SECURITY_SOURCE_ASN" or "${protocolField}" == "TSG_FILED_GTP_IMSI" or "${protocolField}" == "TSG_FILED_GTP_PHONE_NUMBER" or "${protocolField}" == "TSG_FILED_GTP_APN" Set Variable ${objectList}
+ ... ELSE IF "${protocolField}" == "ATTR_SOURCE_ADDR" or "${protocolField}" == "None" or "${protocolField}" == "TSG_SECURITY_SOURCE_LOCATION" or "${protocolField}" == "TSG_SECURITY_SOURCE_ASN" or "${protocolField}" == "ATTR_GTP_IMSI" or "${protocolField}" == "ATTR_GTP_PHONE_NUMBER" or "${protocolField}" == "ATTR_GTP_APN" OrangeFilter ${objectList}
##############destination
- ... ELSE IF "${protocolField}" == "TSG_SECURITY_DESTINATION_ADDR" or "${protocolField}" == "TSG_SECURITY_DESTINATION_LOCATION" or "${protocolField}" == "TSG_SECURITY_DESTINATION_ASN" Set Variable ${objectList}
+ ... ELSE IF "${protocolField}" == "ATTR_DESTINATION_ADDR" or "${protocolField}" == "TSG_SECURITY_DESTINATION_LOCATION" or "${protocolField}" == "TSG_SECURITY_DESTINATION_ASN" Set Variable ${objectList}
#filter
... ELSE OrangeFilter ${objectList}
[Return] ${objectIds} ${objecTemptList} ${attribute} ${atributeObjectId}
@@ -769,8 +805,9 @@ CreateObjects ${objectJson} = Run Keyword If "${return}" != "FAIL" and "${objectType}" != "None" Replace String ${objectJson} "type": "ip" "type":"${objectType}"
... ELSE Set Variable ${objectJson}
${return} ${objectSubType} Run Keyword And Ignore Error Get From Dictionary ${objectData} objectSubType
- #${objectSubType} Run Keyword If "${return}"!="FAIL" Set Variable ${objectSubType} ELSE Set Variable ${EMPTY}
- ${objectJson} = Run Keyword If "${return}"!="FAIL" and "${objectSubType}" != "None" Replace String ${objectJson} "sub_type": "ip" "sub_type":"${objectSubType}"
+ ${objectSubType1} Run Keyword If "${objectSubType}"=="endpoint" Set Variable ip
+ ... ELSE Set Variable ${objectSubType}
+ ${objectJson} = Run Keyword If "${return}"!="FAIL" and "${objectSubType}" != "None" Replace String ${objectJson} "sub_type": "ip" "sub_type":"${objectSubType1}"
... ELSE Set Variable ${objectJson}
${return} ${objectId} Run Keyword And Ignore Error Get From Dictionary ${objectData} objectId
${objectJson} = Run Keyword If "${return}"!="FAIL" and "${objectId}" != "None" Replace String ${objectJson} "object_id": null "object_id":${objectId}
@@ -802,8 +839,9 @@ CreateObjects ${itemListJson} ${itemvalue} ${port} ${isHexbin} Run Keyword If "${returnAddItemList}" == "PASS" OrangeObjectItem ${addItemList} ${protocolFieldTemp} ${appName} ${objectSubType} ${itemvalue} ${objectType}
... ELSE IF "${returnUpdateItemList}" == "PASS" and "${addItemList}" != "None" OrangeObjectItem ${updateItemList} ${protocolFieldTemp} ${appName} ${objectSubType} ${itemvalue}
... ELSE IF ${deleteItemList} ${itemvalue}
+ log ${objectJson}
${objectJsonTemp} = Run Keyword If "${returnAddItemList}" != "FAIL" and "${objectSubType}" == "ip_learning" Replace String ${objectJson} "add_item_list": [null] "add_item_list": [], ${itemListJson}
- ... ELSE IF "${returnAddItemList}" != "FAIL" Replace String ${objectJson} "add_item_list": [null] "add_item_list": ${itemListJson}
+ ... ELSE IF "${returnAddItemList}" != "FAIL" Replace String ${objectJson} "member": "object" "member": ${itemListJson}
... ELSE IF "${returnUpdateItemList}" != "FAIL" and "${objectSubType}" == "ip_learning" Replace String ${objectJson} "update_item_list": [null] "update_item_list": [], ${itemListJson}
... ELSE IF "${returnUpdateItemList}" != "FAIL" Replace String ${objectJson} "update_item_list": [null] "update_item_list": ${itemListJson}
... ELSE IF "${returnDeleteItemIds}" != "FAIL" and "${objectSubType}" == "ip_learning" Replace String ${objectJson} "delete_item_ids": [null] "delete_item_ids": [], ${itemListJson}
@@ -813,13 +851,14 @@ CreateObjects ${objectJsonTemp} = Replace String ${objectJsonTemp} None null
#Create File ${path}/test.txt ${objectJson}
#Append To File ${path}/test.txt ${objectJson}
- ${objDictionary} json.loads ${objectJsonTemp}
- AppendListToList ${objectJsonList} ${objDictionary}
- END
+ ${objectJsonList} json.loads ${objectJsonTemp}
+ # AppendListToList ${objectJsonList} ${objDictionary}
+ END
+ log ${objectJsonList}
${return} ${returnCode} Run Keyword And Ignore Error Get From Dictionary ${objectData} returnCode
${returnCode} = Run Keyword If "${return}"=="PASS" Set Variable ${returnCode}
... ELSE Set Variable ${Empty}
- ${objectData} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary op_action=add return_data=1 object_list=${objectJsonList} vsys_id=${vsysId}
+ ${objectData} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary op=add return_data=1 object=${objectJsonList} vsys_id=${vsysId}
... ELSE Create Dictionary op_action=add return_data=1 object_listt=${objectJsonList}
Log !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Log ${itemvalue}
@@ -880,9 +919,9 @@ OrangeObjectItem #... ELSE Set Variable ${Empty}
Comment 处理keywordArray
log ${itemList}
- ${itemList} Run Keyword If "${objectType}"!="ip" JoinKeywordsData ${itemList} ${objectType} ${objectSubType}
+ ${items} Run Keyword If "${objectType}"!="ip" JoinKeywordsData ${itemList} ${objectType} ${objectSubType}
... ELSE JoinIpData ${itemList}
- ${itemListJson} json.Dumps ${itemList}
+ ${itemListJson} json.Dumps ${items}
${itemListJson} = Run keyword IF "${objectSubType}" == "endpoint" Replace String ${itemListJson} testClentIP ${testClentIP}
... ELSE Set Variable ${itemListJson}
#${objectJson} = Replace String ${objectJson} "addItemList": "addItemList":${itemList}
@@ -901,8 +940,8 @@ JoinIpData ${ip} Create Dictionary ip=${ip} op=add
Append To List ${items} ${ip}
END
- ${items} Create Dictionary items=${items}
- [Return] ${itemList}
+ ${items} Create Dictionary items=${items} type=1
+ [Return] ${items}
JoinKeywordsData
[Arguments] ${itemList} ${objectType} ${objectSubType}
@@ -923,12 +962,12 @@ JoinKeywordsData Append To List ${items} ${string}
log ${patterns}
END
- ${items} Create Dictionary items=${items}
- ${member} Create Dictionary member=${items}
+ ${items} Create Dictionary items=${items} type=1
+ # ${member} Create Dictionary member=${items}
# ${member} json.dumps ${member}
- log ${member}
+ # log ${member}
log ${keywords}
- [Return] ${itemList}
+ [Return] ${items}
GetFirstFromItemList
[Arguments] ${addItemList}
[Documentation] 从测试数据对象中获取第一个item作为测试参数
@@ -1005,14 +1044,42 @@ ObjectIdsToObjList # ${objectList} Create Dictionary object_id=${obj} protocol_field=${protocolField}
# Append To List ${objectsList} ${objectList}
# END
+ ${protocolField} Run Keyword If "${protocolField}" == "TSG_FIELD_HTTP_HOST" Set Variable ATTR_HTTP_HOST
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_DOH_HOST" Set Variable ATTR_DOH_HOST
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_URL" Set Variable ATTR_HTTP_URL
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_FTP_URI" Set Variable ATTR_FTP_URI
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_REQ_HDR" Set Variable ATTR_HTTP_REQ_HDR
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_RES_HDR" Set Variable ATTR_HTTP_RES_HDR
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_REQ_BODY" Set Variable ATTR_HTTP_REQ_BODY
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_RES_BODY" Set Variable ATTR_HTTP_RES_BODY
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SSL_SNI" Set Variable ATTR_SSL_SNI
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SSL_SAN" Set Variable ATTR_SSL_SAN
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SSL_CN" Set Variable ATTR_SSL_CN
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_DNS_QNAME" Set Variable ATTR_DNS_QNAME
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_SUBJECT" Set Variable ATTR_MAIL_SUBJECT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_CONTENT" Set Variable ATTR_MAIL_CONTENT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_ATT_NAME" Set Variable ATTR_MAIL_ATT_NAME
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_ATT_CONTENT" Set Variable ATTR_MAIL_ATT_CONTENT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_FROM" Set Variable ATTR_MAIL_FROM
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_TO" Set Variable ATTR_MAIL_TO
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_MAIL_ACCOUNT" Set Variable ATTR_MAIL_ACCOUNT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_FTP_CONTENT" Set Variable ATTR_FTP_CONTENT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_FTP_ACCOUNT" Set Variable ATTR_FTP_ACCOUNT
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SIP_ORIGINATOR_DESCRIPTION" Set Variable ATTR_SIP_ORIGINATOR_DESCRIPTION
+ ... ELSE IF "${protocolField}" == "TSG_FIELD_SIP_RESPONDER_DESCRIPTION" Set Variable ATTR_SIP_RESPONDER_DESCRIPTION
+ ... ELSE IF "${protocolField}" == "TSG_SECURITY_SOURCE_ADDR" Set Variable ATTR_SOURCE_ADDR
+ ... ELSE IF "${protocolField}" == "TSG_SECURITY_DESTINATION" Set Variable ATTR_DESTINATION_ADDR
+ ... ELSE IF "${protocolField}" == "TSG_FILED_GTP_IMSI" Set Variable ATTR_GTP_IMSI
+ ... ELSE IF "${protocolField}" == "TSG_FILED_GTP_APN" Set Variable ATTR_GTP_APN
+ ... ELSE IF "${protocolField}" == "TSG_FILED_GTP_PHONE_NUMBER" Set Variable ATTR_GTP_PHONE_NUMBER
FOR ${obj} IN @{objectIds}
${obj} Evaluate int(${obj})
# ${objectList} Create Dictionary object_id=${obj} protocol_field=${protocolField}
${object_id_list} Create List
Append To List ${object_id_list} ${obj}
- ${objectList} Create Dictionary object_ids=${obj}
+ ${objectList} Create Dictionary object_ids=${object_id_list}
Append To List ${objectsList} ${objectList}
-
+ ${objectsList} Create Dictionary objects=${objectsList} protocol_field=${protocolField} not_flag=${0}
END
Log objectsList:${objectsList}
[Return] ${objectsList}
@@ -1063,16 +1130,17 @@ GetObjectVerifyId ${return} ${data} Run Keyword And Ignore Error Get From Dictionary ${value} data
Return From Keyword If "${return}"=="FAIL" ${objectIdsTemp}
Log %%%%%%%%%%%%%%:${verifyValue}
- FOR ${object} IN @{value['data']['object_list']}
- ${object1} json.Dumps ${object}
- ${verifyValue} Replace String ${verifyValue} & \\&
- ${verifyValue} Replace String ${verifyValue} $ \\$
- ${verifyValue} Replace String ${verifyValue} * \\*
- ${temp} aisincludeb ${verifyValue} ${object1}
- ${objectId} Run Keyword IF "${temp}"=="True" Set Variable ${object['object_id']}
- ... ELSE Set Variable ${EMPTY}
- Exit For Loop If "${temp}"=="True"
- END
+ # FOR ${object} IN @{value['data']['object_list']}
+ # ${object1} json.Dumps ${object}
+ # ${verifyValue} Replace String ${verifyValue} & \\&
+ # ${verifyValue} Replace String ${verifyValue} $ \\$
+ # ${verifyValue} Replace String ${verifyValue} * \\*
+ # ${temp} aisincludeb ${verifyValue} ${object1}
+ # ${objectId} Run Keyword IF "${temp}"=="True" Set Variable ${object['object_id']}
+ # ... ELSE Set Variable ${EMPTY}
+ # Exit For Loop If "${temp}"=="True"
+ # END
+ ${objectId} Set Variable ${data['object']['id']}
[Return] ${objectId}
GetIniCategoryId
[Arguments] ${categoryName}
diff --git a/keyword/objects/process_object_body.robot b/keyword/objects/process_object_body.robot index cc49cef..3ffbbe8 100644 --- a/keyword/objects/process_object_body.robot +++ b/keyword/objects/process_object_body.robot @@ -569,9 +569,11 @@ getObjectListIds ${return} ${data} Run Keyword And Ignore Error Get From Dictionary ${value} data
Return From Keyword If "${return}"=="FAIL" ${objectIdsTemp}
- FOR ${object} IN @{value['data']['object_list']}
- Append To List ${objectIds} ${object['object_id']}
- END
+ # FOR ${object} IN @{value['data']['object_list']}
+ # Append To List ${objectIds} ${object['object_id']}
+ # END
+ ${object_id} Set Variable ${data['object']['id']}
+ Append To List ${objectIds} ${object_id}
[Return] ${objectIds}
GetCategoryIds
[Documentation]
diff --git a/keyword/policys/policy.robot b/keyword/policys/policy.robot index ee05dcc..4a33bc6 100644 --- a/keyword/policys/policy.robot +++ b/keyword/policys/policy.robot @@ -21,7 +21,7 @@ Resource ${EXECDIR}/keyword/common/stmp_handle.robot Resource ${EXECDIR}/keyword/common/common_interface.robot
*** Variables ***
-${policyUrl} /policy/compile
+${policyUrl} /policy/rule
${decryptionProfileUrl} /policy/profile/decryption
${decryptionExclusionUrl} /policy/items
*** Keywords ***
@@ -1343,11 +1343,11 @@ CreatePolicysAndObjects ${destinationList} json.Dumps ${destinationList}
${filterList} json.Dumps ${filterList}
log ${sourceList}
- ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "source": null "source":{"object_list":${sourceList}}
+ ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "sources": null "sources":${sourceList}
... ELSE Replace String ${policyJson} "source": null "source":${sourceList}
- ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "destination": null "destination":{"object_list":${destinationList}}
+ ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "destinations": null "destinations":${destinationList}
... ELSE Replace String ${policyJson} "destination": null "destination":${destinationList}
- ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "filter_list": null "filter_list":${filterList}
+ ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "filters": null "filters":${filterList}
... ELSE Replace String ${policyJson} "filterList": null "filterList":${filterList}
log ${policyJson}
#${policyInfo} Get From Dictionary ${policyData} condation
@@ -1362,13 +1362,13 @@ CreatePolicysAndObjects ${return} ${returnData} Run Keyword And Ignore Error Get From Dictionary ${policyData} returnData
#${returnData} Run Keyword If "${return}"!="FAIL" Set Variable ${returnData} ELSE Set Variable ${EMPTY}
- ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${returnData}" != "${EMPTY}" Replace String ${policyJson} "return_data": 1 "return_data": "${returnData}"
+ ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${returnData}" != "${EMPTY}" Replace String ${policyJson} "return_data": 1 "return_data": ${returnData}
... ELSE Set Variable ${policyJson}
${return} ${policyName} Run Keyword And Ignore Error Get From Dictionary ${policyData} policyName
#${policyName} Run Keyword If "${return}"!="FAIL" Set Variable ${policyName} ELSE Set Variable ${EMPTY}
- ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyName}" != "None" Replace String ${policyJson} "policy_name": "autotest" "policy_name": "${policyName}"
- ... ELSE Replace String ${policyJson} "policyName": "autotest" "policyName": "${testName}"
+ ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyName}" != "None" Replace String ${policyJson} "name": "autotest" "name": "${policyName}"
+ ... ELSE Replace String ${policyJson} "name": "autotest" "name": "${testName}"
${return} ${action} Run Keyword And Ignore Error Get From Dictionary ${policyData} action
#${action} Run Keyword If "${return}"!="FAIL" Set Variable ${action} ELSE Set Variable ${EMPTY}
@@ -1377,9 +1377,9 @@ CreatePolicysAndObjects ${return} ${policyType} Run Keyword And Ignore Error Get From Dictionary ${policyData} policyType
#${policyType} Run Keyword If "${return}"!="FAIL" Set Variable ${policyType} ELSE Set Variable ${EMPTY}
- ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyType}" != "None" and "${action}"!="intercept" and "${tsgVersion}" < "23.05" Replace String ${policyJson} "policyType": "tsg_security" "policyType": "${policyType}"
- ... ELSE IF "${action}"=="intercept" and "${tsgVersion}" >= "23.05" Replace String ${policyJson} "policy_type": "tsg_security" "policy_type": "pxy_intercept"
- ... ELSE IF "${action}"!="intercept" and "${tsgVersion}" >= "23.05" Replace String ${policyJson} "policy_type": "tsg_security" "policy_type": "${policyType}"
+ ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyType}" != "None" and "${action}"!="intercept" and "${tsgVersion}" < "23.05" Replace String ${policyJson} "type": "tsg_security" "type": "${policyType}"
+ ... ELSE IF "${action}"=="intercept" and "${tsgVersion}" >= "23.05" Replace String ${policyJson} "type": "tsg_security" "type": "pxy_intercept"
+ ... ELSE IF "${action}"!="intercept" and "${tsgVersion}" >= "23.05" Replace String ${policyJson} "type": "tsg_security" "type": "${policyType}"
... ELSE Set Variable ${policyJson}
@@ -1396,7 +1396,8 @@ CreatePolicysAndObjects #${doBlacklist} Run Keyword If "${return}"!="FAIL" Set Variable ${doBlacklist} ELSE Set Variable ${EMPTY}
${policyJson} = Run Keyword If "${return}"!="FAIL" and "${doBlacklist}" != "None" Replace String ${policyJson} "do_blacklist": 0 "do_blacklist": ${doBlacklist}
... ELSE Set Variable ${policyJson}
-
+ # 替换vsys_id
+ ${policyJson} Replace String ${policyJson} "vsys_id": 1 "vsys_id": ${vsysId}
${return} ${doLog} Run Keyword And Ignore Error Get From Dictionary ${policyData} doLog
#${doLog} Run Keyword If "${return}"!="FAIL" Set Variable ${doLog} ELSE Set Variable ${EMPTY}
${policyJson} = Run Keyword If "${return}"!="FAIL" and "${doLog}" != "None" Replace String ${policyJson} "do_log": 1 "do_log": ${doLog}
@@ -1407,7 +1408,7 @@ CreatePolicysAndObjects ${return} ${policyDesc} Run Keyword And Ignore Error Get From Dictionary ${policyData} policyDesc
#${policyDesc} Run Keyword If "${return}"!="FAIL" Set Variable ${policyDesc} ELSE Set Variable ${EMPTY}
- ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyDesc}" != "None" Replace String ${policyJson} "policy_desc": "autotest" "policy_desc": "${policyDesc}"
+ ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyDesc}" != "None" Replace String ${policyJson} "description": "autotest" "description": "${policyDesc}"
... ELSE Set Variable ${policyJson}
${return} ${effectiveRange} Run Keyword And Ignore Error Get From Dictionary ${policyData} effectiveRange
@@ -1490,7 +1491,9 @@ CreatePolicysAndObjects ${traffic_mirror} = Run Keyword If "${return}"!="FAIL" and "${traffic_mirror}" != "None" Set Variable ${traffic_mirror}
... ELSE Set Variable ""
${traffic_mirror} json.Dumps ${traffic_mirror}
- ${appIdObjectIds}= Create List
+ ${appIdObjectIds}= Create List
+ ${object_ids} Create List
+ ${objects} Create List
${return} ${logCapture} Run Keyword And Ignore Error Get From Dictionary ${policyData} logCapture
${logCapture} Run Keyword If "${return}"!="FAIL" Set Variable ${logCapture} ELSE Set Variable ${EMPTY}
${return} ${captureDepth} Run Keyword And Ignore Error Get From Dictionary ${policyData} captureDepth
@@ -1504,9 +1507,9 @@ CreatePolicysAndObjects # ${appObjId} Create Dictionary objectId=${appObjId}
# ${appObjId} json.Dumps ${appObjId}
# Log To Console ${appObjId}
- ${appObjId} Set Variable {\"object_id\":${appObjId}}
- Append To List ${appIdObjectIds} ${appObjId}
- log ${objprotol}
+ # ${appObjId} Set Variable {\"object_id\":${appObjId}}
+ Append To List ${object_ids} ${appObjId}
+ log ${object_ids}
log ${profileIds}
${userRegionStr} Run Keyword If "${method}" == "alert" and ("${profileIds}"=="None" or "${profileIds}"=="${EMPTY}") Set Variable {"method": "${method}","code":${code},"${messageKey}":"${message}"}
... ELSE IF "${method}" == "alert" and "${profileIds}"!="None" Set Variable {"method": "${method}","code":${code},"${messageKey}":${profileIds},"packet_capture":{"enable":0}}
@@ -1540,9 +1543,13 @@ CreatePolicysAndObjects ... ELSE IF "${return}" != "FAIL" Set Variable {"packet_capture":{"enable":${logCapture},"capture_depth":${captureDepth}}}
... ELSE Set Variable {"protocol":"${key}"}
END
+ ${object_ids} Create Dictionary object_ids=${object_ids}
+ Append To List ${objects} ${object_ids}
+ ${application} Create Dictionary objects=${objects} protocol_field=ATTR_APP_ID not_flag=${0}
+ ${application} json.Dumps ${application}
# Run Keyword If "${returnAppIdObjects}"!="FAIL" and "${appIdObjects}" != "${EMPTY}" Remove From List ${appIdObjectIds} 0
log ${userRegionStr}
- ${policyJson} = Run Keyword If "${returnAppIdObjects}"!="FAIL" and "${appIdObjects}" != "None" Replace String ${policyJson} "appIdObjects": [null] "application":{"app_id_object_list":${appIdObjectIds}}
+ ${policyJson} = Run Keyword If "${returnAppIdObjects}"!="FAIL" and "${appIdObjects}" != "None" Replace String ${policyJson} "application": "test" "application":${application}
... ELSE Set Variable ${policyJson}
${policyJson} = Replace String ${policyJson} "user_region": null "user_region": ${userRegionStr}
@@ -1849,7 +1856,7 @@ CreateCondation ${atributeObjectIds} Create List
FOR ${key} IN @{objectListData}
${protocolField} Run Keyword And Continue On Failure Get From Dictionary ${key} protocolField
- Run Keyword If "${protocolField}" == "TSG_FIELD_HTTP_HOST" Set Variable ATTR_HTTP_HOST
+ ${protocolField} Run Keyword If "${protocolField}" == "TSG_FIELD_HTTP_HOST" Set Variable ATTR_HTTP_HOST
... ELSE IF "${protocolField}" == "TSG_FIELD_DOH_HOST" Set Variable ATTR_DOH_HOST
... ELSE IF "${protocolField}" == "TSG_FIELD_HTTP_URL" Set Variable ATTR_HTTP_URL
... ELSE IF "${protocolField}" == "TSG_FIELD_FTP_URI" Set Variable ATTR_FTP_URI
@@ -1899,7 +1906,7 @@ CreateCondation ... ELSE Set Variable ${atributeObjectIds}
#${len}= Get Length ${objectIdsList}
#${objectIdsList} Run Keyword IF ${len} != 0 AppendListToList ${objectIdsList} ${objectIds} ELSE Set Variable ${objectIds}
- Run Keyword If "${protocolField}" == "ATTR_SOURCE_ADDR" or "${protocolField}" == "None" or "${protocolField}" == "TSG_SECURITY_SOURCE_LOCATION" or "${protocolField}" == "TSG_SECURITY_SOURCE_ASN" or "${protocolField}" == "ATTR_GTP_IMSI" or "${protocolField}" == "ATTR_GTP_PHONE_NUMBER" or "${protocolField}" == "ATTR_GTP_APN" AppendListToList ${sourceList} ${objectList} #Append To List
+ Run Keyword If "${protocolField}" == "ATTR_SOURCE_ADDR" or "${protocolField}" == "None" or "${protocolField}" == "TSG_SECURITY_SOURCE_LOCATION" or "${protocolField}" == "TSG_SECURITY_SOURCE_ASN" or "${protocolField}" == "ATTR_GTP_IMSI" or "${protocolField}" == "ATTR_GTP_PHONE_NUMBER" or "${protocolField}" == "ATTR_GTP_APN" AppendListToList ${sourceList} ${objectList} #Append To List
##############destination
... ELSE IF "${protocolField}" == "ATTR_DESTINATION_ADDR" or "${protocolField}" == "TSG_SECURITY_DESTINATION_LOCATION" or "${protocolField}" == "TSG_SECURITY_DESTINATION_ASN" AppendListToList ${destinationList} ${objectList}
#filter
@@ -1910,6 +1917,7 @@ CreateCondation Comment 策略中添加默认的测试客户端信息
${sourceList} Run Keyword If "${addTestClentIPFlag}" == "1" AppendListToList ${sourceList} ${defaultClient}
... ELSE Set Variable ${sourceList}
+ log ${sourceList}
[Return] ${objectIds} ${sourceList} ${destinationList} ${filterList} ${attributes} ${atributeObjectIds}
CreatePolilcys
diff --git a/keyword/policys/process_policy_body.robot b/keyword/policys/process_policy_body.robot index 09c42fe..96f25ca 100644 --- a/keyword/policys/process_policy_body.robot +++ b/keyword/policys/process_policy_body.robot @@ -392,15 +392,19 @@ GetPolicyIds [Documentation] 获取结果中的策略类型及ID ... 策略接口返回json串 ... 返回结果格式:[{'policyType': 'tsg_security', 'policyIds': [108480]}, {'policyType': 'tsg_security', 'policyIds': [108481]}, {'policyType': 'tsg_security', 'policyIds': [108482]}, {'policyType': 'tsg_security', 'policyIds': [108483]}, {'policyType': 'tsg_security', 'policyIds': [108484]}] + log ${value} ${policyIds} Create List - FOR ${policy} IN @{value['data']['policy_list']} - ${policyIdList} Create List ${policy['policy_id']} - #${policyIdList} Set Variable ${policy['policyId']} - ${policyObj} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary policy_type=${policy['policy_type']} policy_ids=${policyIdList} vsys_id=${vsysId} - ... ELSE Create Dictionary policy_type=${policy['policyType']} policy_ids=${policyIdList} - Append To List ${policyIds} ${policyObj} - #Append To List ${policyIds} ${policy['policyId']} - END + # FOR ${policy} IN @{value['data']['policy_list']} + # ${policyIdList} Create List ${policy['policy_id']} + # #${policyIdList} Set Variable ${policy['policyId']} + # ${policyObj} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary policy_type=${policy['policy_type']} policy_ids=${policyIdList} vsys_id=${vsysId} + # ... ELSE Create Dictionary policy_type=${policy['policyType']} policy_ids=${policyIdList} + # Append To List ${policyIds} ${policyObj} + # #Append To List ${policyIds} ${policy['policyId']} + # END + ${policyIdList} Create List ${value['data']['rule']['id']} + ${policyObj} Create Dictionary type=${value['data']['rule']['type']} ids=${policyIdList} vsys_id=${vsysId} + Append To List ${policyIds} ${policyObj} log ${policyIds} [Return] ${policyIds} GetPids diff --git a/keyword/profiles/profile.robot b/keyword/profiles/profile.robot index 6c2583d..23df099 100644 --- a/keyword/profiles/profile.robot +++ b/keyword/profiles/profile.robot @@ -631,17 +631,17 @@ CreatePolicyFile ${suffix} Generate Random String
${randomName} Catenate SEPARATOR=_ test ${suffix}
${value} Run Keyword If '${flag}'=='resPages' and ${tsgVersion}<22.06 Set Variable {"is_valid":1,"format":"html","op_action":"add","profile_name":"${randomName}","profile_id":null,"return_data":1}
- ... ELSE IF '${flag}'=='resPages' and ${tsgVersion}>=22.06 Set Variable {"is_valid":1,"format":"html","op_action":"add","profile_name":"${randomName}","profile_id":null,"vsys_id":${vsysId},"isShared":0,"return_data":1}
+ ... ELSE IF '${flag}'=='resPages' and ${tsgVersion}>=22.06 Set Variable {"format":"html","name":"${randomName}","vsys_id":${vsysId},"return_data":1}
... ELSE IF '${flag}'=='hijack' and ${tsgVersion}<22.06 Set Variable {"is_valid":1,"content_type":"${feature}","op_action":"add","profile_name":"${randomName}","content_name":"${fileName}","profile_id":null,"return_data":1}
- ... ELSE IF '${flag}'=='hijack' and ${tsgVersion}>=22.06 Set Variable {"is_valid":1,"content_type":"${feature}","op_action":"add","profile_name":"${randomName}","content_name":"${fileName}","profile_id":null,"vsys_id":${vsysId},"isShared":0,"return_data":1}
+ ... ELSE IF '${flag}'=='hijack' and ${tsgVersion}>=22.06 Set Variable {"content_type":"${feature}","name":"${randomName}","content_name":"${fileName}","vsys_id":${vsysId},"return_data":1}
... ELSE IF '${flag}'=='insert' and ${tsgVersion}<22.06 Set Variable {"is_valid":1,"format":"js","insert_on":"${feature}","op_action":"add","profile_name":"${randomName}","profile_id":null,"return_data":1}
- ... ELSE IF '${flag}'=='insert' and ${tsgVersion}>=22.06 Set Variable {"is_valid":1,"format":"js","insert_on":"${feature}","op_action":"add","profile_name":"${randomName}","profile_id":null,"vsys_id":${vsysId},"isShared":0,"return_data":1}
+ ... ELSE IF '${flag}'=='insert' and ${tsgVersion}>=22.06 Set Variable {"format":"js","insert_on":"${feature}","name":"${randomName}","vsys_id":${vsysId},"return_data":1}
... ELSE IF '${flag}'=='insertcss' and ${tsgVersion}<22.06 Set Variable {"is_valid":1,"format":"css","insert_on":"","op_action":"add","profile_name":"${randomName}","profile_id":null,"return_data":1}
- ... ELSE IF '${flag}'=='insertcss' and ${tsgVersion}>=22.06 Set Variable {"is_valid":1,"format":"css","insert_on":"","op_action":"add","profile_name":"${randomName}","profile_id":null,"vsys_id":${vsysId},"isShared":0,"return_data":1}
- ... ELSE IF '${flag}'=='runScript' and ${tsgVersion}>=22.08 Set Variable {"maxExecTime":${feature},"namespaceId":1,"op_action":"add","profile_name":"${randomName}","vsys_id":${vsysId},"return_data":1}
- ... ELSE IF '${flag}'=='keyring' and ${tsgVersion}>=22.10 Set Variable {"is_valid":1,"op_action":"add","return_data":1,"keyring_name":"${fileName}","keyring_type":"root","reissue_expiry_hour":24,"crl":"null","public_key_algo":"rsa2048","keyring_id":null,"include_root":0,"use_hsm":0,"vsys_id":${vsysId},"slot_id":null}
+ ... ELSE IF '${flag}'=='insertcss' and ${tsgVersion}>=22.06 Set Variable {"format":"css","name":"${randomName}","vsys_id":${vsysId},"return_data":1}
+ ... ELSE IF '${flag}'=='runScript' and ${tsgVersion}>=22.08 Set Variable {"maxExecTime":${feature},"name":"${randomName}","vsys_id":${vsysId},"return_data":1}
+ ... ELSE IF '${flag}'=='keyring' and ${tsgVersion}>=22.10 Set Variable {"return_data":1,"keyring_name":"${fileName}","keyring_type":"root","reissue_expiry_hour":24,"crl":"null","public_key_algo":"rsa2048","keyring_id":null,"include_root":0,"use_hsm":0,"vsys_id":${vsysId},"slot_id":null}
- ${header} Set Variable ${value}
+ ${requestData} Set Variable ${value}
${binFile} Evaluate open(r"${filePath}${fileName}",'rb')
${privateBinFile} Run Keyword If "${flag}"=="keyring" Evaluate open(r"${filePath}${feature}",'rb')
@@ -651,7 +651,7 @@ CreatePolicyFile ${requestData} Create Dictionary name="file" filename="${fileName}" Content-Type=application/octet-stream
${suffix} Generate Random String
${profileName} Catenate SEPARATOR=_ test ${suffix}
- ${fileDesc} Create Dictionary File-Desc=${header}
+ # ${fileDesc} Create Dictionary File-Desc=${header}
${content} UpFilePostRequest ${url} ${requestData} ${fileDict} ${fileDesc}
${msg} Set Variable ${content['msg']}
${list} Set Variable ${content['data']['list']}
diff --git a/other/data/template/template.yaml b/other/data/template/template.yaml index 0271e89..c0cb263 100644 --- a/other/data/template/template.yaml +++ b/other/data/template/template.yaml @@ -77,11 +77,13 @@ "do_log": 1
"effective_range":
"user_region":
- "source":
- "destination":
+ "sources":
+ "destinations":
"filters":
- "application":
+ "application": "test"
"is_enabled": 1
+ "description": "test"
+ "vsys_id": 1
"schedule_id":
-
##################################################
|
