1、添加时间工具关键字
2、调整部分错误
This commit is contained in:
@@ -2,333 +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
|
||||
Resource ../../../02-Keyword/tsg_bfapi/CommonUtil.robot
|
||||
*** Variables ***
|
||||
@{logType} security_event_log proxy_event_log connection_record_log radius_record_log
|
||||
${path} ${path}
|
||||
${apipath} http://${host}:${port}/${version}
|
||||
*** Test Cases ***
|
||||
ExportLog-001
|
||||
${conditions} Set Variable {"field":"common_log_id","type":"long","symbol":"=","value":["59526984506148866"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... [${conditions}]
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["${starttime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":">", "value":["${starttime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"<", "value":["${endtime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"<=", "value":["${endtime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":">=", "value":["${starttime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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","${endtime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"between", "value":["${starttime}","${endtime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/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","${endtime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${starttime} Get Time
|
||||
${endtime}= Add Time To Date ${starttime} -1 days
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["${starttime}","${endtime}"] }
|
||||
${logname} Set Variable active_defence_event_log
|
||||
|
||||
${logCondition} GetLogCondition ${logname} ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
log ${logCondition}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
${success} downloadexcel ${header} ${logCondition} ${path}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/log/batch
|
||||
log ${success}
|
||||
Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ Resource ../../../02-Keyword/tsg_bfapi/Log_search.robot
|
||||
Library string
|
||||
Library REST http://${host}:${port}
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Log_keyword.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/CommonUtil.robot
|
||||
|
||||
*** Test Cases ***
|
||||
log-schema-001
|
||||
@@ -19,7 +20,9 @@ log-search-002
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} []
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
#date_format=%Y-%m-%d %H:%M:%S
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} []
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -27,8 +30,9 @@ log-search-003
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable {"field":"common_log_id","type":"long","symbol":"=","value":["59526984506148866"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -41,8 +45,9 @@ log-search-004
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"=", "value":["2020-04-27 12:48:33"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"=", "value":["${starttime}"] }
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -55,8 +60,9 @@ log-search-005
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"=", "value":["774"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -69,8 +75,9 @@ log-search-006
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"ad_cc_target_url", "type":"string", "symbol":"sub", "value":["www.jianshu.com"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -83,8 +90,9 @@ log-search-007
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"sub", "value":["22"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -97,8 +105,9 @@ log-search-008
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"prefix", "value":["10"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -111,8 +120,9 @@ log-search-009
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"suffix", "value":["222"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -125,8 +135,9 @@ log-search-010
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"ad_target_ip", "type":"string", "symbol":"exactly", "value":["10.3.22.222"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -139,8 +150,9 @@ log-search-011
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${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"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -158,7 +170,8 @@ log-search-011
|
||||
log-search-012
|
||||
${conditions} Set Variable {"field":"common_log_id","type":"long","symbol":"=","value":["59526984506148866"] }
|
||||
${simpleCondition} Set Variable "common_server_ips": "40"
|
||||
${logCondition} GetLogCondition active_defence_event_log 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${logCondition} GetLogCondition active_defence_event_log ${starttime} ${endtime} 30 1
|
||||
... ${conditions}
|
||||
${response} BasePostRequest /${version}/log/list ${logCondition}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
@@ -173,7 +186,8 @@ log-search-013
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_policy_id", "type":"int", "value":["774"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -187,7 +201,8 @@ log-search-014
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"!=", "value":["774"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -196,7 +211,8 @@ log-search-015
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":">", "value":["774"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -205,7 +221,8 @@ log-search-016
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"<", "value":["774"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -214,7 +231,8 @@ log-search-017
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"<=", "value":["774"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -223,7 +241,8 @@ log-search-018
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":">=", "value":["774"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -232,7 +251,8 @@ log-search-019
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_policy_id", "type":"int", "symbol":"in", "value":["774","95"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} ${conditions}
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} ${conditions}
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -240,22 +260,24 @@ log-search-020
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["2020-04-27 12:48:33"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["${starttime}"] }
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
log ${responsedata}
|
||||
${responselist} Get From Dictionary ${responsedata} list
|
||||
${time} Set Variable ${responselist}[0][common_recv_time]
|
||||
Should Be Equal As Strings ${time} 2020-04-27 12:48:33
|
||||
Should Be Equal As Strings ${time} ${starttime}
|
||||
|
||||
log-search-021
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":">", "value":["2020-04-27 12:48:33"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":">", "value":["${starttime}"] }
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -264,7 +286,8 @@ log-search-022
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"<", "value":["2020-04-27 12:48:33"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -272,8 +295,9 @@ log-search-023
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"<=", "value":["2020-04-27 12:48:33"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"<=", "value":["${starttime}"] }
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
@@ -286,8 +310,9 @@ log-search-024
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":">=", "value":["2020-04-27 12:48:33"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":">=", "value":["${starttime}"] }
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -295,8 +320,9 @@ log-search-025
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"between", "value":["2020-04-27 12:48:33","2020-04-27 13:27:03"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${starttime} ${endtime} GetLast24HoursStartAndEndTime
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "symbol":"between", "value":["${starttime}","${endtime}"] }
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
@@ -304,7 +330,7 @@ log-search-026
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request /${version}/log/schema?logType=active_defence_event_log
|
||||
${filds} Set Variable ${responsedata['data']['fields']}
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["2020-04-27 12:48:33","2020-04-27 13:27:03"] }
|
||||
${response} log_search 2020-04-26 12:27:03 2020-04-27 13:27:03 active_defence_event_log ${filds} [${conditions}]
|
||||
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["2020-04-27 12:48:33","${endtime}"] }
|
||||
${response} log_search ${starttime} ${endtime} active_defence_event_log ${filds} [${conditions}]
|
||||
log ${response}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
|
||||
Reference in New Issue
Block a user