summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyword/common/log_variable.robot4
-rw-r--r--keyword/common/login_logout.robot29
-rw-r--r--keyword/common/logschema.robot25
-rw-r--r--keyword/objects/object.robot12
-rw-r--r--keyword/objects/process_object_body.robot6
-rw-r--r--keyword/policys/manage_policy_body.robot4
-rw-r--r--keyword/policys/policy.robot60
-rw-r--r--keyword/policys/process_policy_body.robot37
-rw-r--r--keyword/profiles/profile.robot6
-rw-r--r--keyword/system/administration/administering_access_tokens.robot4
10 files changed, 100 insertions, 87 deletions
diff --git a/keyword/common/log_variable.robot b/keyword/common/log_variable.robot
index 513343a..0052d4f 100644
--- a/keyword/common/log_variable.robot
+++ b/keyword/common/log_variable.robot
@@ -123,7 +123,7 @@ GetLogListMulti
[Arguments] ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} ${logQueryParam} ${schemaType}=${EMPTY}
${logCondition} GetLogCondition ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} ${schemaType}
log ${logCondition}
- ${returnLogListResponse} ${LogListResponse} Run Keyword And Ignore Error PostRemoteData /${version}/log/list ${logCondition}
+ ${returnLogListResponse} ${LogListResponse} Run Keyword And Ignore Error PostRemoteData /${version}/log/query ${logCondition}
Should Be Equal As Strings ${LogListResponse.status_code} 200
${returnData} To Json ${LogListResponse.content}
${responseCode} Get From Dictionary ${returnData} code
@@ -132,7 +132,7 @@ GetLogListMulti
log this time request security_event \ table logRecord \ : ${LogListResponse.content}
${a} Set Variable this time request security_event \ table logRecord \ : ${LogListResponse.content}
log ${a}
- ${log} Set Variable ${LogListResponse.json()}[data][list]
+ ${log} Set Variable ${LogListResponse.json()}[data][result]
FOR ${logs} IN ${log}
log ${logs}
END
diff --git a/keyword/common/login_logout.robot b/keyword/common/login_logout.robot
index dc0c293..1d72ec9 100644
--- a/keyword/common/login_logout.robot
+++ b/keyword/common/login_logout.robot
@@ -17,8 +17,8 @@ Resource ${EXECDIR}/keyword/profiles/profile.robot
InitPotocol
${appDict} Create Dictionary
${appVDict} Create Dictionary
- Connect To Database Using Custom Params pymysql host='${host}',port=3306,user='${mysqluser}',passwd='test',database='tsg-bifang'
- ${app_id} query SELECT group_id, app_id, app_name FROM app_id_dict WHERE is_valid = 1 AND app_name = 'http' OR app_name = 'ssl' OR app_name = 'dns' OR app_name = 'ftp' OR app_name = 'mail' OR app_name = 'doh' OR app_name = 'rtp' OR app_name = 'sip' OR app_name = 'ssh' OR app_name = 'https' OR app_name = 'imaps' OR app_name = 'pop3s' OR app_name = 'smtps' OR app_name = 'quic' OR app_name = 'Psiphon3' OR app_name = 'tor' OR app_name = 'TachyonVPN' OR app_name = 'Freegate' OR app_name = 'skype' OR app_name = 'facebook' OR app_name = 'baidu' OR app_name = 'instagram' OR app_name = 'telegram' OR app_name = 'whatsapp' OR app_name = 'twitter' OR app_name = 'youtube' OR app_name = 'gmail' OR app_name = 'taobao' OR app_name = 'qq' OR app_name = 'wechat' OR app_name = 'wireguard' OR app_name = 'tachyonvpn' OR app_name = 'dingding' OR app_name = 'v4c' OR app_name = 'UGVPN' OR app_name = 'VPNlat' OR app_name = 'AnonyTun' OR app_name = 'urbanVPN' OR app_name = 'TurboVPN' OR app_name = 'FlashVPN' OR app_name = 'ProtonVPN' OR app_name = 'bilibili' OR app_name = 'gtalk' OR app_name = 'TurboVPN_mm' OR app_name = 'facebook_messenger' OR app_name = 'testAutoApplication'
+ Connect To Database Using Custom Params pymysql host='${host}',port=3306,user='test',passwd='test',database='tsg-bifang'
+ ${app_id} query SELECT object_id, app_id, app_name FROM app_id_dict WHERE is_valid = 1 AND app_name = 'http' OR app_name = 'ssl' OR app_name = 'dns' OR app_name = 'ftp' OR app_name = 'mail' OR app_name = 'doh' OR app_name = 'rtp' OR app_name = 'sip' OR app_name = 'ssh' OR app_name = 'https' OR app_name = 'imaps' OR app_name = 'pop3s' OR app_name = 'smtps' OR app_name = 'quic' OR app_name = 'Psiphon3' OR app_name = 'tor' OR app_name = 'TachyonVPN' OR app_name = 'Freegate' OR app_name = 'skype' OR app_name = 'facebook' OR app_name = 'baidu' OR app_name = 'instagram' OR app_name = 'telegram' OR app_name = 'whatsapp' OR app_name = 'twitter' OR app_name = 'youtube' OR app_name = 'gmail' OR app_name = 'taobao' OR app_name = 'qq' OR app_name = 'wechat' OR app_name = 'wireguard' OR app_name = 'tachyonvpn' OR app_name = 'dingding' OR app_name = 'v4c' OR app_name = 'UGVPN' OR app_name = 'VPNlat' OR app_name = 'AnonyTun' OR app_name = 'urbanVPN' OR app_name = 'TurboVPN' OR app_name = 'FlashVPN' OR app_name = 'ProtonVPN' OR app_name = 'bilibili' OR app_name = 'gtalk' OR app_name = 'TurboVPN_mm' OR app_name = 'facebook_messenger' OR app_name = 'testAutoApplication'
# ... SELECT group_id,low_boundary,region_name FROM tsg_obj_app_id WHERE is_valid=1 and region_name in('http','ftp','${httpVersion}','ssl','dns','doh','quic','mail')
${app_length} Get Length ${app_id}
log ${app_length}
@@ -253,10 +253,25 @@ TestinLogin
ApiLogout
[Tags] tsg_adc tsg_bf_api
- POST /${version}/user/logout headers=${headers}
- Object response body
- Integer $.code 200
- ${rescode} Integer $.code
+
+
+ # ${headers} Set Variable {"Authorization":"${token}","Content-Type":"application/json"}
+ # Create session api ${httpVersion}://${host}:${port} ${headers} verify=false
+ # ${login_data} Create Dictionary username=${username} password=${encodePassword} authMode=${authmode}
+ # ${login_data} json.Dumps ${login_data}
+ # # ${response}= Post Request api /${version}/user/login?username=${username}&password=${encodePassword}&authMode=${authmode}&vsysId=${vsysId}
+ # ${response} Post Request api /${version}/user/login data=${login_data}
+ # ${response} to json ${response.content}
+ # Should Be Equal As Strings ${response['code']} 200
+
+ ${headers} Set Variable {"Authorization":"${token}","Content-Type":"application/json"}
+ Create session api ${httpVersion}://${host}:${port} ${headers} verify=false
+ ${response} Post Request api /${version}/user/logout
+
+ # POST /${version}/user/logout headers=${headers}
+ # Object response body
+ # Integer $.code 200
+ # ${rescode} Integer $.code
BifangLoginAndAddLocalIP
[Tags] tsg_adc tsg_bf_api
@@ -321,7 +336,7 @@ AddInterceptPolicy
${mvysKeyringId} ${mvysDecryptionProfileId} Run Keyword If "${vsysType}"!="1" and "${tsgVersion}"=="22.10" CreateMvsysInterProfile tango-ca-v3-trust-ca.cer tango-ca-v3-trust-ca.key
... ELSE Set Variable 1 1
Comment 创建安全策略
- ${policyDict} Run Keyword If "${tsgVersion}">="22.11" Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=pxy_intercept policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring_for_trusted":${turstKeyringId},"keyring_for_untrusted":${unTurstKeyringId},"decryption":${defaultDescryptionId},"tcp_option_profile":1,"traffic_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
+ ${policyDict} Run Keyword If "${tsgVersion}">="22.11" Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=pxy_intercept policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring_for_trusted":${turstKeyringId},"keyring_for_untrusted":${unTurstKeyringId},"decryption_profile":${defaultDescryptionId},"tcp_option_profile":1,"traffic_mirror":{"enable":0}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
... ELSE Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":${mvysKeyringId},"decryption":${mvysDecryptionProfileId},"traffic_mirror":{"enable":0}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
diff --git a/keyword/common/logschema.robot b/keyword/common/logschema.robot
index c19708c..2070180 100644
--- a/keyword/common/logschema.robot
+++ b/keyword/common/logschema.robot
@@ -10,21 +10,28 @@ GetLogCondition
[Arguments] ${logname} ${startTime} ${endTime} ${client_ip} ${policy_id} ${schemaType}=${EMPTY}
${headers} Set variable {"Authorization":"${token}","Content-Type":"application/json"}
Create session api ${httpVersion}://${host}:${port} ${headers} verify=false
- ${response}= Get Request api /${version}/log/schema/${logname}
- ${response} to json ${response.content}
- ${field} Get From Dictionary ${response['data']} fields
- ${field} Evaluate ",".join([${field['name']} for field in ${log_schema}])
- ${field} json.Dumps ${field}
+ ${response}= Get Request api /${version}/log/schema/${logname}?vsys_id=${vsysId}
+ # ${response} to json ${response.content}
+ # log ${response}
+ ${field} json.loads ${response.text}
+ ${field} Set Variable ${field['data']['fields']}
+ # ${field} Get From Dictionary ${field['data']} fields
+ ${field} Evaluate ",".join([field['name'] for field in ${field}])
+ # ${field} json.Dumps ${field}
# ${field} Replace String ${field} ' "
-
+ ${rule_list} Run Keyword If "${logname}"=="security_event" Set Variable security_rule_list
+ ... ELSE IF "${logname}"=="proxy_event" Set Variable proxy_rule_list
+
+ ${identifier_name} Run Keyword If "${logname}"=="security_event" Set Variable security-event-list
+ ... ELSE IF "${logname}"=="proxy_event" Set Variable proxy-event-manipulation-count
log ${field}
${pageSize} Set Variable 30
${pageNo} Set Variable 1
- ${filter} Set Variable client_ip='${client_ip}' AND has(security_rule_list,${policy_id})
+ ${filter} Set Variable client_ip='${client_ip}' AND has(${rule_list},${policy_id})
# ${logCondition} Run Keyword If "${logname}"=="security_event" or "${logname}"=="proxy_event" Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","fields":${field},"start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition} ,"common_client_ips":"${client_ip}","common_policy_ids":"${policy_id}"}
# ... ELSE IF ${logname}=="session_record" and "${schemaType}"="ssh" Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","fields":${field},"start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition} ,"common_client_ips":"${client_ip}","common_schema_type":"${schemaType}"}
- ${logCondition} Run Keyword If "${logname}"=="security_event" or "${logname}"=="proxy_event" Set Variable {"page_no":${pageNo},"page_size":${pageSize},"source":"${logname}","fields":${field},"start_time":"${startTime}","end_time":"${endTime}","filter":"${filter}","vsys_id":${vsysId}}
- ... ELSE IF ${logname}=="session_record" and "${schemaType}"="ssh" Set Variable {"page_no":${pageNo},"page_size":${pageSize},"source":"${logname}","fields":${field},"start_time":"${startTime}","end_time":"${endTime}","filter":"${filter}","vsys_id":${vsysId}}
+ ${logCondition} Run Keyword If "${logname}"=="security_event" or "${logname}"=="proxy_event" Set Variable {"page_no":${pageNo},"page_size":${pageSize},"source":"${logname}","columns":"${field}","start_time":"${startTime}","end_time":"${endTime}","filter":"${filter}","vsys_id":${vsysId},"execution_mode":"oneshot","identifier_name":"${identifier_name}"}
+ ... ELSE IF ${logname}=="session_record" and "${schemaType}"="ssh" Set Variable {"page_no":${pageNo},"page_size":${pageSize},"source":"${logname}","columns":"${field}","start_time":"${startTime}","end_time":"${endTime}","filter":"${filter}","vsys_id":${vsysId},"execution_mode":"oneshot","identifier_name":"${identifier_name}"}
log this time query condition:${logCondition}
Delete All Sessions
[Return] ${logCondition}
diff --git a/keyword/objects/object.robot b/keyword/objects/object.robot
index 9f6c729..e9c623a 100644
--- a/keyword/objects/object.robot
+++ b/keyword/objects/object.robot
@@ -70,7 +70,7 @@ AddLocalIPObject
Append To List ${object_ids} ${objectId1}
${object_ids} Create Dictionary object_ids=${object_ids}
Append To List ${objects} ${object_ids}
- ${sourceClientIP} Create Dictionary objects=${objects} protocol_field=ATTR_SOURCE_ADDR not_flag=${0}
+ ${sourceClientIP} Create Dictionary objects=${objects} attribute_name=ATTR_SOURCE_IP is_negate=${0}
# ${imsi_id} Evaluate int(${imsi_id})
# ${imsi_id} Convert To Integer ${imsi_id}
@@ -729,7 +729,7 @@ CreateObjectList
... 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_SOURCE_ADDR" Set Variable ATTR_SOURCE_IP
... 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
@@ -739,7 +739,7 @@ CreateObjectList
#${objectIds} ${objectList} CreateObjects ${objectData}
log ${protocolField}
${objecTemptList} Run Keyword If "${protocolFieldReturn}"=="FAIL" 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}
+ ... ELSE IF "${protocolField}" == "ATTR_SOURCE_IP" 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}" == "ATTR_DESTINATION_ADDR" or "${protocolField}" == "TSG_SECURITY_DESTINATION_LOCATION" Set Variable ${objectList}
#filter
@@ -919,7 +919,7 @@ JoinKeywordsData
Append To List ${items} ${string}
log ${patterns}
END
- ${items} Create Dictionary items=${items} type=1
+ ${items} Create Dictionary items=${items} type=item
# ${member} Create Dictionary member=${items}
# ${member} json.dumps ${member}
# log ${member}
@@ -1024,7 +1024,7 @@ ObjectIdsToObjList
... 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_SOURCE_ADDR" Set Variable ATTR_SOURCE_IP
... 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
@@ -1036,7 +1036,7 @@ ObjectIdsToObjList
Append To List ${object_id_list} ${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}
+ ${objectsList} Create Dictionary objects=${objectsList} attribute_name=${protocolField} is_negate=${0}
END
Log objectsList:${objectsList}
[Return] ${objectsList}
diff --git a/keyword/objects/process_object_body.robot b/keyword/objects/process_object_body.robot
index 3ffbbe8..0460eb1 100644
--- a/keyword/objects/process_object_body.robot
+++ b/keyword/objects/process_object_body.robot
@@ -201,7 +201,7 @@ ObjectOrganize
# ${return} ${subObjectIds} Run Keyword And Ignore Error Get From Dictionary ${object} subObjectIds
# Run Keyword If "${return}"!="FAIL" and "${subObjectIds}"!="${EMPTY}" and "${subObjectIds}"!="${None}" Set To Dictionary ${returnDict} subObjectIds=${subObjectIds}
# ... ELSE Set Variable ${emptyList}
-
+ Set To Dictionary ${returnDict} statistics_option=none
${return} ${iconColor} Run Keyword And Ignore Error Set Variable ${object['iconColor']}
Run Keyword If "${return}"!="FAIL" Set To Dictionary ${returnDict} icon_color=${iconColor}
#补充ip learning对象
@@ -365,7 +365,7 @@ CombineKeywords
Append To List ${items} ${string}
log ${patterns}
END
- ${items} Create Dictionary items=${items} type=1
+ ${items} Create Dictionary items=${items} type=item
# ${member} Create Dictionary member=${items}
# ${member} json.dumps ${member}
# log ${member}
@@ -382,7 +382,7 @@ CombineIp
${ip} Create Dictionary ip=${ip} op=add
Append To List ${items} ${ip}
END
- ${items} Create Dictionary items=${items} type=1
+ ${items} Create Dictionary items=${items} type=item
[Return] ${items}
ManageUpdateItemList
[Documentation]
diff --git a/keyword/policys/manage_policy_body.robot b/keyword/policys/manage_policy_body.robot
index 45a29ba..895c405 100644
--- a/keyword/policys/manage_policy_body.robot
+++ b/keyword/policys/manage_policy_body.robot
@@ -240,9 +240,7 @@ ManageClientIPObject
${intid} Evaluate int(${testClentID})
${obj1} Create Dictionary object_id=${intid} protocol_field=${list1}
Append To List ${emptyList} ${obj1}
- # ${list2} Create List null
- # ${obj2} Create Dictionary objectId=${testClentSubID} protocolFields=${list2}
- # Append To List ${emptyList} ${obj2}
+
ManageClientSubIDObject
[Arguments] ${emptyList}
# 增加引用测试终端IP策略对象
diff --git a/keyword/policys/policy.robot b/keyword/policys/policy.robot
index 14c9f00..b19d7d0 100644
--- a/keyword/policys/policy.robot
+++ b/keyword/policys/policy.robot
@@ -780,7 +780,7 @@ ExcuteFtpCommand
${hopeResult} Get From Dictionary ${verify} hopeResult
# ${returnFtp} ${ftp} Run Keyword And Ignore Error Write curl -m 10 ftp://${ftpHost}${ftpUrl} -u ${ftpUserName}:${ftpPassword}
- ${command} Set Variable curl -m 10 ftp://${ftpHost}${ftpUrl} -u ${ftpUserName}:${ftpPassword}
+ ${command} Set Variable curl -m 25 ftp://${ftpHost}${ftpUrl} -u ${ftpUserName}:${ftpPassword}
${returnFtp} ${ftp} Run Keyword And Ignore Error Write ${command}
${return} ${res} Run Keyword And Ignore Error Read delay=15s
@@ -831,7 +831,7 @@ EmailSend
${isUTC} Evaluate ${tsgVersion}>=22.03
${starttime} Run Keyword If "${isUTC}"=="True" Get Current Date UTC exclude_millis=True
... ELSE Get Time
- sleep 5
+ sleep 15
${returnConnect} ${connect} Run Keyword And Ignore Error Open Connection ${manageIp}
${returnLogin} ${login} Run Keyword And Ignore Error SSHLibrary.Login ${manageUser} ${managePassword}
@@ -850,7 +850,7 @@ EmailSend
# ${aaa} SSHLibrary.Execute Command curl --connect-timeout 10 -m 10 --url "smtp://${smtpServer}" --mail-from "${mailFrom}" --mail-rcpt "${mailTo}" -H @${scriptsPath}${mailMessagePath} --user "${mailFrom}:${mailPassword}" -F '=(;type=multipart/mixed' -F '=(;type=multipart/mixed' -F "="Bestman";type=text/plain" -F "file=@${scriptsPath}${mailAttachPath};type=`file --mime-type "${scriptsPath}${mailAttachPath}"|sed 's/.*: //'`;encoder=base64" -F '=)'
# log ${aaa}
- ${return} ${write} Run Keyword And Ignore Error SSHLibrary.Write curl --connect-timeout 10 -m 10 --url "smtp://${smtpServer}" --mail-from "${mailFrom}" --mail-rcpt "${mailTo}" -H @${scriptsPath}${mailMessagePath} --user "${mailFrom}:${mailPassword}" -F '=(;type=multipart/mixed' -F '=(;type=multipart/mixed' -F "="Bestman";type=text/plain" -F "file=@${scriptsPath}${mailAttachPath};type=`file --mime-type "${scriptsPath}${mailAttachPath}"|sed 's/.*: //'`;encoder=base64" -F '=)'
+ ${return} ${write} Run Keyword And Ignore Error SSHLibrary.Write curl --connect-timeout 25 -m 25 --url "smtp://${smtpServer}" --mail-from "${mailFrom}" --mail-rcpt "${mailTo}" -H @${scriptsPath}${mailMessagePath} --user "${mailFrom}:${mailPassword}" -F '=(;type=multipart/mixed' -F '=(;type=multipart/mixed' -F "="Bestman";type=text/plain" -F "file=@${scriptsPath}${mailAttachPath};type=`file --mime-type "${scriptsPath}${mailAttachPath}"|sed 's/.*: //'`;encoder=base64" -F '=)'
${return} ${res} Run Keyword And Ignore Error Read delay=15s
@@ -1356,15 +1356,15 @@ CreatePolicysAndObjects
${destinationList} json.Dumps ${destinationList}
${filterList} json.Dumps ${filterList}
log ${sourceList}
- ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "sources": null "sources":${sourceList}
+ ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "source": null "source":${sourceList}
... ELSE Replace String ${policyJson} "source": null "source":${sourceList}
- ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "destinations": null "destinations":${destinationList}
+ ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "destination": null "destination":${destinationList}
... ELSE Replace String ${policyJson} "destination": null "destination":${destinationList}
- ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "filters": null "filters":${filterList}
+ ${policyJson} Run Keyword If "${tsgVersion}" >= "23.10" Replace String ${policyJson} "filter": null "filter":${filterList}
... ELSE Replace String ${policyJson} "filterList": null "filterList":${filterList}
log ${policyJson}
#${policyInfo} Get From Dictionary ${policyData} condation
- Comment 处理策略数据: "opAction": "add" "returnData": 1 "policyName": "autotest" "policyType": "tsg_security" "action": "allow" "userTags": "" "doBlacklist": 0 "doLog": 1 "policyDesc": "autotest" "effectiveRange": "userRegion": "appIdObjects": "appSelectorObjects": "isValid": 1 "scheduleId":
+ Comment 处理策略数据: "opAction": "add" "returnData": 1 "policyName": "autotest" "policyType": "security" "action": "allow" "userTags": "" "doBlacklist": 0 "doLog": 1 "policyDesc": "autotest" "effectiveRange": "userRegion": "appIdObjects": "appSelectorObjects": "isValid": 1 "scheduleId":
#转json替换
#${policyJson} json.Dumps ${ipMode}
#JSON处理
@@ -1389,16 +1389,18 @@ CreatePolicysAndObjects
... ELSE Set Variable ${policyJson}}
${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}
+ ${policyType} Run Keyword If "${policyType}"=="tsg_security" Set Variable security
+ ... ELSE Set Variable ${policyType}
log ${policyType}
log ${action}
log ${policyJson}
- ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyType}" != "pxy_manipulation" 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}"=="monitor" and "${policyType}"=="tsg_security" Replace String ${policyJson} "type": "tsg_security" "type": "monitor"
- ... ELSE IF "${policyType}" == "pxy_manipulation" Replace String ${policyJson} "type": "tsg_security" "type": "pxy_manipulation"
+ ${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyType}" != "pxy_manipulation" and "${action}"!="intercept" and "${tsgVersion}" < "23.05" Replace String ${policyJson} "type": "security" "type": "${policyType}"
+ ... ELSE IF "${action}"=="intercept" and "${tsgVersion}" >= "23.05" Replace String ${policyJson} "type": "security" "type": "pxy_intercept"
+ ... ELSE IF "${action}"=="monitor" and "${policyType}"=="security" Replace String ${policyJson} "type": "security" "type": "monitor"
+ ... ELSE IF "${policyType}" == "pxy_manipulation" Replace String ${policyJson} "type": "security" "type": "pxy_manipulation"
... ELSE Set Variable ${policyJson}
+
${return} ${method} Run Keyword And Ignore Error Get From Dictionary ${policyData} method
#${method} Run Keyword If "${return}"!="FAIL" Set Variable ${method} ELSE Set Variable ${EMPTY}
@@ -1518,21 +1520,18 @@ CreatePolicysAndObjects
log ${appIdObjects}
FOR ${key} IN @{appIdObjects}
log ${key}
- ${appObjId} Get From Dictionary ${objprotol} ${key}
- # ${appObjId} Create Dictionary objectId=${appObjId}
- # ${appObjId} json.Dumps ${appObjId}
- # Log To Console ${appObjId}
- # ${appObjId} Set Variable {\"object_id\":${appObjId}}
+ ${appObjId} Get From Dictionary ${objprotol} ${key}
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}"}
+ ${userRegionStr} Run Keyword If "${method}" == "alert" and ("${profileIds}"=="None" or "${profileIds}"=="${EMPTY}") Set Variable {"method": "${method}","code":${code},"${messageKey}":"${message}","packet_capture":{"enable":0}}
... ELSE IF "${method}" == "alert" and "${profileIds}"!="None" Set Variable {"method": "${method}","code":${code},"${messageKey}":${profileIds},"packet_capture":{"enable":0}}
... ELSE IF "${method}" == "block" and "${key}"=="mail" and "${return}" != "FAIL" Set Variable {"method": "${method}","code":${code},"packet_capture":{"enable":${logCapture},"capture_depth":${captureDepth}}}
... ELSE IF "${method}" == "block" and "${key}"=="mail" and "${return}" == "FAIL" Set Variable {"method": "${method}","code":${code},"packet_capture":{"enable":0}}
... ELSE IF "${method}" == "hijack" or "${method}" == "insert" or "${method}" == "run_script" Set Variable {"method": "${method}","${messageKey}":${profileIds}}
- ... ELSE IF "${method}" == "redirect" and "${key}"=="http" and "${policyType}" == "tsg_security" and "${return}" == "FAIL" Set Variable {"method": "${method}","code":${code},"to":"${redirect_to}","packet_capture":{"enable":0}}
- ... ELSE IF "${method}" == "redirect" and "${key}"=="http" and "${policyType}" != "tsg_security" and "${return}" == "FAIL" Set Variable {"method": "${method}","code":${code},"to":"${redirect_to}"}
+ ... ELSE IF "${method}" == "tamper" Set Variable {"method": "${method}","tamper_mode": "complete","packet_capture":{"enable":0}}
+ ... ELSE IF "${method}" == "redirect" and "${key}"=="http" and "${policyType}" == "security" and "${return}" == "FAIL" Set Variable {"method": "${method}","code":${code},"to":"${redirect_to}","packet_capture":{"enable":0}}
+ ... ELSE IF "${method}" == "redirect" and "${key}"=="http" and "${policyType}" != "security" and "${return}" == "FAIL" Set Variable {"method": "${method}","code":${code},"to":"${redirect_to}"}
... ELSE IF "${method}" == "redirect" and "${key}"=="dns" Set Variable {"method": "${method}","resolution":${dnsResolution},"packet_capture":{"enable":0}}
... ELSE IF "${method}" == "replace" or "${method}" == "edit_element" Set Variable {"method": "${method}","rules":${rules}}
... ELSE IF "${method}" == "rate_limit" and "${return}" == "FAIL" Set Variable {"method": "${method}","bps":${bps},"enforce_direction":"both","packet_capture":{"enable":0}}
@@ -1548,21 +1547,21 @@ CreatePolicysAndObjects
... ELSE IF "${action}" == "deny" and "${method}" != "drop" and "${return}" != "FAIL" Set Variable {"method": "${method}","packet_capture":{"enable":${logCapture},"capture_depth":${captureDepth}}}
... ELSE IF "${action}" == "deny" and "${method}" == "drop" and "${return}" != "FAIL" and "${tsgVersion}" >= "23.01" Set Variable {"method": "${method}","send_icmp_unreachable":${sendIcmpUnreachable},"send_tcp_reset":${send_tcp_reset},"after_n_packets":${after_n_packets},"send_tcp_reset":${send_tcp_reset},"packet_capture":{"enable":${logCapture},"capture_depth":${captureDepth}}}
... ELSE IF "${action}" == "deny" and "${method}" == "drop" and "${return}" != "FAIL" and "${tsgVersion}" < "23.01" Set Variable {"method": "${method}","send_icmp_unreachable":${sendIcmpUnreachable},"enforce_direction":"both","packet_capture":{"enable":${logCapture},"capture_depth":${captureDepth}}}
- ... ELSE IF "${action}" == "deny" and "${method}" != "block" and "${return}" == "FAIL" and "${policyType}" == "tsg_security" Set Variable {"method": "${method}","packet_capture":{"enable":0}}
- ... ELSE IF "${action}" == "deny" and "${method}" != "block" and "${return}" == "FAIL" and "${policyType}" != "tsg_security" Set Variable {"method": "${method}"}
- ... ELSE IF "${action}" == "monitor" and "${returnMirrorVlan}"!="FAIL" and "${mirrorVlan}"!= "None" and "${policyType}" == "tsg_security" and "${return}" == "FAIL" Set Variable {"traffic_mirror":{"enable":${mirrorEnable},"mirror_vlan":${mirrorVlan}},"packet_capture":{"enable":0}}
- ... ELSE IF "${action}" == "monitor" and "${returnMirrorVlan}"=="FAIL" and "${policyType}" == "tsg_security" and "${return}" == "FAIL" Set Variable {"traffic_mirror":{"enable":${mirrorEnable},"mirror_vlan":null},"packet_capture":{"enable":0}}
- ... ELSE IF "${action}" == "monitor" and "${returnMirrorVlan}"=="FAIL" and "${policyType}" == "tsg_security" and "${return}" != "FAIL" Set Variable {"traffic_mirror":{"enable":${mirrorEnable},"mirror_vlan":null},"packet_capture":{"enable":${logCapture},"capture_depth":${captureDepth}}}
+ ... ELSE IF "${action}" == "deny" and "${method}" != "block" and "${return}" == "FAIL" and "${policyType}" == "security" Set Variable {"method": "${method}","packet_capture":{"enable":0}}
+ ... ELSE IF "${action}" == "deny" and "${method}" != "block" and "${return}" == "FAIL" and "${policyType}" != "security" Set Variable {"method": "${method}"}
+ ... ELSE IF "${action}" == "monitor" and "${returnMirrorVlan}"!="FAIL" and "${mirrorVlan}"!= "None" and "${policyType}" == "security" and "${return}" == "FAIL" Set Variable {"traffic_mirror":{"enable":${mirrorEnable},"mirror_vlan":${mirrorVlan}},"packet_capture":{"enable":0}}
+ ... ELSE IF "${action}" == "monitor" and "${returnMirrorVlan}"=="FAIL" and "${policyType}" == "security" and "${return}" == "FAIL" Set Variable {"traffic_mirror":{"enable":${mirrorEnable},"mirror_vlan":null},"packet_capture":{"enable":0}}
+ ... ELSE IF "${action}" == "monitor" and "${returnMirrorVlan}"=="FAIL" and "${policyType}" == "security" and "${return}" != "FAIL" Set Variable {"traffic_mirror":{"enable":${mirrorEnable},"mirror_vlan":null},"packet_capture":{"enable":${logCapture},"capture_depth":${captureDepth}}}
... ELSE IF "${action}" == "intercept" and "${key}" == "ssl" and ${tsgVersion}<=22.10 Set Variable {"protocol":"SSL","keyring": ${keyring},"decryption":${decryption},"traffic_mirror":${traffic_mirror}}
- ... ELSE IF "${action}" == "intercept" and "${key}" == "ssl" and ${tsgVersion}>=22.11 and "${decryption}" == "None" and "${decryption}" != "${EMPTY}" Set Variable {"protocol":"SSL","keyring_for_trusted":${keyring},"keyring_for_untrusted":${unTurstKeyringId},"decryption":${defaultDescryptionId},"tcp_option_profile":1,"traffic_mirror":${traffic_mirror}}
- ... ELSE IF "${action}" == "intercept" and "${key}" == "ssl" and ${tsgVersion}>=22.11 and "${decryption}" != "None" Set Variable {"protocol":"SSL","keyring_for_trusted":${keyring},"keyring_for_untrusted":${unTurstKeyringId},"decryption":${decryption},"tcp_option_profile":1,"traffic_mirror":${traffic_mirror}}
+ ... ELSE IF "${action}" == "intercept" and "${key}" == "ssl" and ${tsgVersion}>=22.11 and "${decryption}" == "None" and "${decryption}" != "${EMPTY}" Set Variable {"protocol":"SSL","keyring_for_trusted":${keyring},"keyring_for_untrusted":${unTurstKeyringId},"decryption_profile":${defaultDescryptionId},"tcp_option_profile":1,"traffic_mirror":${traffic_mirror}}
+ ... ELSE IF "${action}" == "intercept" and "${key}" == "ssl" and ${tsgVersion}>=22.11 and "${decryption}" != "None" Set Variable {"protocol":"SSL","keyring_for_trusted":${keyring},"keyring_for_untrusted":${unTurstKeyringId},"decryption_profile":${decryption},"tcp_option_profile":1,"traffic_mirror":${traffic_mirror}}
... ELSE IF "${action}" == "intercept" and "${key}" == "http" and ${tsgVersion}>=22.11 Set Variable {"protocol":"HTTP","tcp_option_profile":1,"traffic_mirror":${traffic_mirror}}
... 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} Create Dictionary objects=${objects} attribute_name=ATTR_APP_ID is_negate=${0}
${application} json.Dumps ${application}
# Run Keyword If "${returnAppIdObjects}"!="FAIL" and "${appIdObjects}" != "${EMPTY}" Remove From List ${appIdObjectIds} 0
log ${userRegionStr}
@@ -1897,7 +1896,7 @@ CreateCondation
... 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_SOURCE_ADDR" Set Variable ATTR_SOURCE_IP
... 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
@@ -1924,7 +1923,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_IP" 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}" == "ATTR_SERVER_FQDN" or "${protocolField}" == "TSG_SECURITY_DESTINATION_ASN" AppendListToList ${destinationList} ${objectList}
#filter
@@ -2057,6 +2056,7 @@ AirTestFuncVerify
#app执行对应的操作
${airTestJson} Run Keyword If "${policyId}"=="${EMPTY}" Set Variable {"test_device_id":"${deviceId}","app_name":"${app_name}","app_operation":"${app_operation}","upper_device_ip":"${operationIp}","packet_name":"","upper_device_id":"111111","report_name":"${task_id}_${policyName}_no_policy"}
... ELSE Set Variable {"test_device_id":"${deviceId}","app_name":"${app_name}","app_operation":"${app_operation}","upper_device_ip":"${operationIp}","packet_name":"","upper_device_id":"111111","report_name":"${task_id}_${policyName}_with_policy"}
+ log to console ${airTestJson}
${response} BasePostRequest task ${airTestJson}
${returnCode} Set Variable ${response['success']}
${verifyReturn} ${verify} Run Keyword And Ignore Error Run Keyword If "${action}"!="deny" Should Be Equal As Integers ${returnCode} 0
diff --git a/keyword/policys/process_policy_body.robot b/keyword/policys/process_policy_body.robot
index 17fe163..157c1b0 100644
--- a/keyword/policys/process_policy_body.robot
+++ b/keyword/policys/process_policy_body.robot
@@ -75,12 +75,14 @@ PolicyDataOperation
... 单个策略处理
Log To Console Call PolicyDataOperation
${json} PolicyOrganize ${policy} ${opAction} ${policyObjectVersion}
+ ${returnData} evaluate ${returnData}
+ ${vsysId} evaluate ${vsysId}
# 转为json结构并返回
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary op_action=${opAction} return_data=${returnData} rule=replace:policyList vsys_id=${vsysId}
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary op_action=${opAction} return_data=${returnData} rule=replace:policyList vsys_id=${vsysId} type=pxy_intercept
... ELSE Create Dictionary op_action=${opAction} return_data=${returnData} policy_list=replace:policyList
${bodyJson} json.Dumps ${dict} ensure_ascii=False
${json} Replace String ${bodyJson} "replace:policyList" ${json}
- ${json} Replace String ${json} "appIdObjects": [163, 109] "application":{"not_flag":0,"protocol_field":"ATTR_APP_ID","objects":[{"object_ids":[109,163]}]}
+ ${json} Replace String ${json} "appIdObjects": [163, 109] "application":{"is_negate":0,"attribute_name":"ATTR_APP_ID","objects":[{"object_ids":[109,163]}]}
# ${json} Replace String ${json} "destination": [] "destination":{"object_list":[]}
# ${json} Replace String ${json} "filterList": [] "application":{"notFlag":0,"appIdObjectList":[{"objectId":109},{"objectId":163}]}
Log Policy_Request_Body-${json}
@@ -256,33 +258,24 @@ ManageObjectV2
#默认客户端条件类型:clientip or clientsubid
${return} ${defaultClient} Run Keyword And Ignore Error Get From Dictionary ${policy} defaultClient
- # ${return1} ${defaultClient1} Run Keyword And Ignore Error Get From Dictionary ${policy} defaultClient1
- # ${return2} ${defaultClient2} Run Keyword And Ignore Error Get From Dictionary ${policy} defaultClient2
- # ${return3} ${defaultClient3} Run Keyword And Ignore Error Get From Dictionary ${policy} defaultClient3
- # ${return4} ${defaultClient4} Run Keyword And Ignore Error Get From Dictionary ${policy} defaultClient4
${defaultClient} Run Keyword If "${return}"=="FAIL" or "${defaultClient}"=="${EMPTY}" Set Variable ${Default_Client_Type}
- # ${defaultClient1} Run Keyword If "${return1}"=="FAIL" or "${defaultClient1}"=="${EMPTY}" Set Variable ${Default_Client_subidType}
- # ${defaultClient2} Run Keyword If "${return2}"=="FAIL" or "${defaultClient2}"=="${EMPTY}" Set Variable ${Default_Client_imsiType}
- # ${defaultClient3} Run Keyword If "${return3}"=="FAIL" or "${defaultClient3}"=="${EMPTY}" Set Variable ${Default_Client_phonenumberType}
- # ${defaultClient4} Run Keyword If "${return4}"=="FAIL" or "${defaultClient4}"=="${EMPTY}" Set Variable ${Default_Client_apnType}
- # ... ELSE Set Variable ${defaultClient}
+
${sourceList} Create List
${destinationList} Create List
${filterList} Create List
${sourceList} Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient}'!='${EMPTY}' and '${defaultClient}'=='clientip' ManageClientIPObjectV2 ${sourceList}
- # Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient1}'!='${EMPTY}' and '${defaultClient1}'=='clientsubid' ManageClientSubIDObjectV2 ${sourceList}
- # Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient2}'!='${EMPTY}' and '${defaultClient2}'=='clientImsi' ManageClientImsiObjectV2 ${sourceList}
- # Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient3}'!='${EMPTY}' and '${defaultClient3}'=='clientPhoneNumber' ManageClientPhoneNumberObjectV2 ${sourceList}
- # Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient4}'!='${EMPTY}' and '${defaultClient4}'=='clientApn' ManageClientApnObjectV2 ${sourceList}
-
+ log ${sourceList}
+ ${sourceList1} Create List
+ Append To List ${sourceList1} ${sourceList}
+ log ${sourceList1}
log ${sourceList}
AnalysisObjectV2 ${policy} source ${sourceList}
AnalysisObjectV2 ${policy} destination ${destinationList}
AnalysisObjectV2 ${policy} filterList ${filterList}
# ${sourceList} Create Dictionary object_list=${sourceList}
- Set To Dictionary ${returnDict} sources=${sourceList} destination=${destinationList} filter_list=${filterList}
+ Set To Dictionary ${returnDict} source=${sourceList1} destination=${destinationList} filter_list=${filterList}
Log ${policy}
ManageClientIPObjectV2
@@ -293,10 +286,10 @@ ManageClientIPObjectV2
${object_ids} Create List
InsertObjectIdToFile testClentIpId ${intid}
Append To List ${object_ids} ${intid}
- ${object_ids} Create Dictionary object_ids=${object_ids}
+ ${object_ids} Create Dictionary object_ids=${object_ids} object_type=ip object_sub_type=ip
${objects} Create List
- Append To List ${objects} ${object_ids}
- ${obj1} Create Dictionary objects=${objects} protocol_field=ATTR_SOURCE_ADDR not_flag=${0}
+ Append To List ${objects} ${object_ids}
+ ${obj1} Create Dictionary objects=${objects} attribute_name=ATTR_SOURCE_IP is_negate=${0}
Append To List ${emptyList} ${obj1}
[Return] ${obj1}
@@ -319,7 +312,7 @@ ManageClientImsiObjectV2
${object_ids} Create Dictionary object_ids=${object_ids}
${objects} Create List
Append To List ${objects} ${object_ids}
- ${obj1} Create Dictionary objects=${objects} protocol_field=ATTR_GTP_IMSI not_flag=${0}
+ ${obj1} Create Dictionary objects=${objects} protocol_field=ATTR_GTP_IMSI is_negate=${0}
Append To List ${emptyList} ${obj1}
ManageClientPhoneNumberObjectV2
@@ -332,7 +325,7 @@ ManageClientPhoneNumberObjectV2
${object_ids} Create Dictionary object_ids=${object_ids}
${objects} Create List
Append To List ${objects} ${object_ids}
- ${obj1} Create Dictionary objects=${objects} protocol_field=ATTR_GTP_PHONE_NUMBER not_flag=${0}
+ ${obj1} Create Dictionary objects=${objects} protocol_field=ATTR_GTP_PHONE_NUMBER is_negate=${0}
Append To List ${emptyList} ${obj1}
ManageClientApnObjectV2
diff --git a/keyword/profiles/profile.robot b/keyword/profiles/profile.robot
index ccbc04a..1506e8a 100644
--- a/keyword/profiles/profile.robot
+++ b/keyword/profiles/profile.robot
@@ -723,11 +723,11 @@ GetTrustAndUnTrustKeying
${headers} Set variable {"Authorization":"${token}","Content-Type":"application/json"}
Create session api ${httpVersion}://${host}:${port} ${headers} verify=false
#查询SSL的内置信任Keying
- ${response} Get Request api /${version}${keyringProfileUrl}?vsys_id=${vsysId}&name=Default&with_sub_vsys=false
+ ${response} Get Request api /${version}${keyringProfileUrl}?vsys_id=${vsysId}&name=Default&with_sub_vsys=0
${turstKeyring} GetResId ${response} ${resType}
SET GLOBAL VARIABLE ${turstKeyringId} ${turstKeyring}
#查询SSL的内置信任Keying
- ${response} Get Request api /${version}${keyringProfileUrl}?vsys_id=${vsysId}&name=Untrusted&with_sub_vsys=false
+ ${response} Get Request api /${version}${keyringProfileUrl}?vsys_id=${vsysId}&name=Untrusted&with_sub_vsys=0
${unTurstKeyring} GetResId ${response} ${resType}
SET GLOBAL VARIABLE ${unTurstKeyringId} ${unTurstKeyring}
[Return] ${turstKeyringId} ${unTurstKeyringId}
@@ -737,7 +737,7 @@ GetDefaultDescryption
${headers} Set variable {"Authorization":"${token}","Content-Type":"application/json"}
Create session api ${httpVersion}://${host}:${port} ${headers} verify=false
#查询SSL的内置信任Keying
- ${response} Get Request api /${version}${decryptionUrl}?vsys_id=${vsysId}&name=decryption-default&with_sub_vsys=false
+ ${response} Get Request api /${version}${decryptionUrl}?vsys_id=${vsysId}&name=decryption-default&with_sub_vsys=0
${defaultDescryption} GetResId ${response} ${resType}
SET GLOBAL VARIABLE ${defaultDescryptionId} ${defaultDescryption}
[Return] ${defaultDescryptionId}
diff --git a/keyword/system/administration/administering_access_tokens.robot b/keyword/system/administration/administering_access_tokens.robot
index f40853f..05113a6 100644
--- a/keyword/system/administration/administering_access_tokens.robot
+++ b/keyword/system/administration/administering_access_tokens.robot
@@ -20,7 +20,7 @@ AddAccessToken
[Arguments] ${tokenMessage}
${body} json.Dumps ${tokenMessage} ensure_ascii=False
log ${body}
- ${response} BasePostRequestForV2 ${accessTokenUrl} ${body} ${version}
+ ${response} BasePostRequestForV2 ${accessTokenUrl} ${body} ${version}
${rescode} Set Variable ${response['code']}
Should Be Equal As Strings ${rescode} 200
${accessToken} Set Variable ${response['data']['token']}
@@ -29,7 +29,7 @@ AddAccessToken
RevokeAccessToken
[Arguments] ${RevokeTokenMessage}
# ${body} json.Dumps ${RevokeTokenMessage} ensure_ascii=False
- ${response} BaseEditRequestForV2 ${accessTokenUrl} ${RevokeTokenMessage} ${version}
+ ${response} BaseEditRequestForV2 ${accessTokenUrl} ${RevokeTokenMessage} ${version} 1
${rescode} Set Variable ${response['code']}
Should Be Equal As Strings ${rescode} 200
[Return] ${rescode}