diff --git a/01-TestCase/tsg_bfapi/active_defence_event_log/Log_batch.robot b/01-TestCase/tsg_bfapi/active_defence_event_log/Log_batch.robot index 61fe65e..1a24842 100644 --- a/01-TestCase/tsg_bfapi/active_defence_event_log/Log_batch.robot +++ b/01-TestCase/tsg_bfapi/active_defence_event_log/Log_batch.robot @@ -2,283 +2,333 @@ Force Tags api api-log api-log-active_defence_event_log api-log-active_defence_event_log-batch Library downloadexcel.py Resource ../../../02-Keyword/tsg_bfapi/Log_keyword.robot - +Library DateTime *** Variables *** @{logType} security_event_log proxy_event_log connection_record_log radius_record_log -${path} http://${host}:${port}/${version} +${path} ${path} *** Test Cases *** ExportLog-001 ${conditions} Set Variable {"field":"common_log_id","type":"long","symbol":"=","value":["59526984506148866"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-002 ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"=", "value":["2020-04-27 12:48:33"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-003 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"=", "value":["774"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-004 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"=", "value":["774"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-005 ${conditions} Set Variable { "field":"ad_cc_target_url", "type":"string", "symbol":"sub", "value":["www.jianshu.com"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-006 ${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"sub", "value":["22"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-007 ${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"exactly", "value":["10.3.22.222"] },{"field":"common_log_id","type":"long","symbol":"=","value":["59526984506148866"] },{ "field":"common_recv_time", "type":"timestamp", "symbol":"=", "value":["2020-04-27 13:27:02"] },{ "field":"common_policy_id", "type":"int", "symbol":"=", "value":["95"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... [${conditions}] log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-008 ${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"prefix", "value":["10"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-009 ${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"suffix", "value":["222"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-010 ${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"exactly", "value":["10.3.22.222"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-011 ${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "value":["10"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-012 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "value":["774"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-013 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"!=", "value":["774"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-014 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":">", "value":["774"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-015 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"<", "value":["774"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-016 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"<=", "value":["774"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-017 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":">=", "value":["774"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-018 ${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"in", "value":["774","95"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-019 ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["2020-04-27 12:48:33"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-020 ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":">", "value":["2020-04-27 12:48:33"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-021 ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"<", "value":["2020-04-27 12:48:33"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-022 ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"<=", "value":["2020-04-27 12:48:33"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-023 ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":">=", "value":["2020-04-27 12:48:33"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-024 - ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"between", "value":["2020-04-27 12:48:33","2020-04-27 13:27:03"] } + ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"between", "value":["2020-04-27 12:48:33","${endtime}"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed ExportLog-025 - ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["2020-04-27 12:48:33","2020-04-27 13:27:03"] } + ${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["2020-04-27 12:48:33","${endtime}"] } ${logname} Set Variable active_defence_event_log - ${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1 + ${starttime} Get Time + ${endtime}= Add Time To Date ${starttime} -1 days + ${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1 ... ${conditions} log ${logCondition} ${header} Create Dictionary Content-Type=application/json Authorization=${token} - ${success} downloadexcel ${header} ${logCondition} http://${host}:${port}/${version}/log/batch + ${success} downloadexcel ${header} ${logCondition} ${path}/log/batch log ${success} Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed diff --git a/01-TestCase/tsg_bfapi/api_log/LogStatistics_Recommend.robot b/01-TestCase/tsg_bfapi/api_log/LogStatistics_Recommend.robot index 104d901..93d8116 100644 --- a/01-TestCase/tsg_bfapi/api_log/LogStatistics_Recommend.robot +++ b/01-TestCase/tsg_bfapi/api_log/LogStatistics_Recommend.robot @@ -1,9 +1,10 @@ *** Settings *** -Resource ../../02-Keyword/tsg_bfapi/LogStatistics.robot +Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot +Resource ../../../03-Variable/BifangApiVariable.txt Library DateTime *** Variables *** -${url} /report/url/recommend +${url} /${version}/report/url/recommend *** Test Cases *** LogStatistics-Recommend-00001 diff --git a/01-TestCase/tsg_bfapi/api_log/LogStatistics_Timeandcount.robot b/01-TestCase/tsg_bfapi/api_log/LogStatistics_Timeandcount.robot index 4daddad..76de6e2 100644 --- a/01-TestCase/tsg_bfapi/api_log/LogStatistics_Timeandcount.robot +++ b/01-TestCase/tsg_bfapi/api_log/LogStatistics_Timeandcount.robot @@ -1,8 +1,9 @@ *** Settings *** -Resource ../../02-Keyword/tsg_bfapi/LogStatistics.robot +Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot +Resource ../../../03-Variable/BifangApiVariable.txt *** Variables *** -${url} /report/policyevent/hit/timeandcount +${url} /${version}/report/policyevent/hit/timeandcount *** Test Cases *** LogStatistics-Timeandcount-00001 diff --git a/02-Keyword/tsg_bfapi/LogStatistics.robot b/02-Keyword/tsg_bfapi/LogStatistics.robot index 9bc0106..2355442 100644 --- a/02-Keyword/tsg_bfapi/LogStatistics.robot +++ b/02-Keyword/tsg_bfapi/LogStatistics.robot @@ -38,7 +38,7 @@ GetApi ${condition} catenate SEPARATOR= ${strstrartTime} ${strendTime} ${strstatisticTime} ${strlimit} ${strstatisticsUnit} ${strtimeGranularity} ${strpolicy_id} ${strip} ${strdevice_ids} ${strpolicy_ids} ${strorderBy} #创建请求信息 ${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token} - Create Session api http://${host}:${port}/${version} + Create Session api http://${host}:${port} #发送请求 ${remoteResponse} Get Request api ${url}?${condition} headers=${header} ${bifang} to json ${remoteResponse.content} @@ -235,7 +235,8 @@ SplicingTrafficSql Recommend [Arguments] ${url} ${statisticTime} ${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token} - Create Session api http://${host}:${port}/${version} headers=${header} + #Create Session api http://${host}:${port}/${version} headers=${header} + Create Session api http://${host}:${port} headers=${header} ${remoteResponse} Get Request api ${url}?statisticTime=${statisticTime} headers=${header} ${response} to json ${remoteResponse.content} Should Be Equal As Strings ${remoteResponse.status_code} 200 @@ -252,7 +253,8 @@ Trend Timeandcount [Arguments] ${url} ${logType} ${policyIds} ${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token} - Create Session api http://${host}:${port}/${version} headers=${header} + #Create Session api http://${host}:${port}/${version} headers=${header} + Create Session api http://${host}:${port} headers=${header} ${remoteResponse} Get Request api ${url}?policyIds=${policyIds}&logType=${logType} headers=${header} ${response} to json ${remoteResponse.content} Should Be Equal As Strings ${remoteResponse.status_code} 200 diff --git a/02-Keyword/tsg_bfapi/Log_keyword.robot b/02-Keyword/tsg_bfapi/Log_keyword.robot index 90e941b..477f5dc 100644 --- a/02-Keyword/tsg_bfapi/Log_keyword.robot +++ b/02-Keyword/tsg_bfapi/Log_keyword.robot @@ -13,7 +13,7 @@ Library json *** Keywords *** GetLogCondition [Arguments] ${logname} ${start_time} ${end_time} ${page_size} ${page_no} ${condition1} - ${responsedata} Get-Request log/schema?logType=active_defence_event_log + ${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log ${fields} Set Variable ${responsedata['data']['fields']} ${field} json.dumps ${fields} log ${field}