日志统计用例完善
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
*** Settings ***
|
*** Settings ***
|
||||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||||
|
Library DateTime
|
||||||
|
|
||||||
*** Test Cases ***
|
*** Test Cases ***
|
||||||
LogStatistics-hijack_scrip_num-00001
|
LogStatistics-hijack_scrip_num-00001
|
||||||
@@ -21,10 +22,77 @@ LogStatistics-hijack_scrip_num-00002
|
|||||||
${apiName} set variable hijack_srcip_num
|
${apiName} set variable hijack_srcip_num
|
||||||
#请求地址 例如:/report/domain/recommend
|
#请求地址 例如:/report/domain/recommend
|
||||||
${url} set variable /report/hijack_srcip_num
|
${url} set variable /report/hijack_srcip_num
|
||||||
#开始时间格式Y-M-D h:i:s
|
|
||||||
${startTime} set variable 2020-04-26 16:40:01
|
|
||||||
#结束时间格式Y-M-D h:i:s
|
#结束时间格式Y-M-D h:i:s
|
||||||
${endTime} set variable 2020-05-26 10:57:47
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -01:00:00
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
#策略ID列表,多个逗号分隔
|
||||||
|
${policy_ids} set variable 0,1
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
|
||||||
|
|
||||||
|
LogStatistics-hijack_scrip_num-00003
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable hijack_srcip_num
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/hijack_srcip_num
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -1 days
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
#策略ID列表,多个逗号分隔
|
||||||
|
${policy_ids} set variable 0,1
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
|
||||||
|
|
||||||
|
LogStatistics-hijack_scrip_num-00004
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable hijack_srcip_num
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/hijack_srcip_num
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -7 days
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
#策略ID列表,多个逗号分隔
|
||||||
|
${policy_ids} set variable 0,1
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
|
||||||
|
|
||||||
|
LogStatistics-hijack_scrip_num-00005
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable hijack_srcip_num
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/hijack_srcip_num
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -30 days
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
#策略ID列表,多个逗号分隔
|
||||||
|
${policy_ids} set variable 0,1
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
|
||||||
|
|
||||||
|
LogStatistics-hijack_scrip_num-00006
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable hijack_srcip_num
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/hijack_srcip_num
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -365 days
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
#策略ID列表,多个逗号分隔
|
#策略ID列表,多个逗号分隔
|
||||||
${policy_ids} set variable 0,1
|
${policy_ids} set variable 0,1
|
||||||
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
*** Settings ***
|
*** Settings ***
|
||||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||||
|
Library DateTime
|
||||||
|
|
||||||
*** Test Cases ***
|
*** Test Cases ***
|
||||||
LogStatistics-injectionstatistics-00001
|
LogStatistics-injectionstatistics-00001
|
||||||
@@ -18,4 +19,93 @@ LogStatistics-injectionstatistics-00001
|
|||||||
${device_ids} set variable CBT2201925000001
|
${device_ids} set variable CBT2201925000001
|
||||||
#统计时间粒度,单位秒,最小统计粒度为30秒
|
#统计时间粒度,单位秒,最小统计粒度为30秒
|
||||||
${timeGranularity} set variable 30
|
${timeGranularity} set variable 30
|
||||||
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity} limit=${limit} #device_ids=${device_ids}
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity} limit=${limit} device_ids=${device_ids}
|
||||||
|
|
||||||
|
LogStatistics-injectionstatistics-00002
|
||||||
|
#120未更新
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable injectionstatistics
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/traffic/injectionstatistics
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -01:00:00
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
#统计时间粒度,单位秒,最小统计粒度为30秒
|
||||||
|
${timeGranularity} set variable 30
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
|
||||||
|
|
||||||
|
LogStatistics-injectionstatistics-00003
|
||||||
|
#120未更新
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable injectionstatistics
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/traffic/injectionstatistics
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -1 days
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
${device_ids} set variable CBT2201925000001
|
||||||
|
#统计时间粒度,单位秒,最小统计粒度为30秒
|
||||||
|
${timeGranularity} set variable 30
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
|
||||||
|
|
||||||
|
LogStatistics-injectionstatistics-00004
|
||||||
|
#120未更新
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable injectionstatistics
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/traffic/injectionstatistics
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -7 days
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
${device_ids} set variable CBT2201925000001
|
||||||
|
#统计时间粒度,单位秒,最小统计粒度为30秒
|
||||||
|
${timeGranularity} set variable 30
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
|
||||||
|
|
||||||
|
LogStatistics-injectionstatistics-00005
|
||||||
|
#120未更新
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable injectionstatistics
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/traffic/injectionstatistics
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -30 days
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
${device_ids} set variable CBT2201925000001
|
||||||
|
#统计时间粒度,单位秒,最小统计粒度为30秒
|
||||||
|
${timeGranularity} set variable 30
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
|
||||||
|
|
||||||
|
LogStatistics-injectionstatistics-00006
|
||||||
|
#120未更新
|
||||||
|
#apiName,请求大数据时,用于区分每个接口的sql
|
||||||
|
${apiName} set variable injectionstatistics
|
||||||
|
#请求地址 例如:/report/domain/recommend
|
||||||
|
${url} set variable /report/traffic/injectionstatistics
|
||||||
|
#结束时间格式Y-M-D h:i:s
|
||||||
|
${Time} get current date
|
||||||
|
${endTime}= add time to date ${Time} -00:05:00
|
||||||
|
${endTime} Get Substring ${endTime} \ -4
|
||||||
|
#开始时间格式Y-M-D h:i:s
|
||||||
|
${startTime}= add time to date ${endTime}= -365 days
|
||||||
|
${startTime} Get Substring ${startTime} \ -4
|
||||||
|
${device_ids} set variable CBT2201925000001
|
||||||
|
#统计时间粒度,单位秒,最小统计粒度为30秒
|
||||||
|
${timeGranularity} set variable 30
|
||||||
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ GetApi
|
|||||||
BigData
|
BigData
|
||||||
[Arguments] ${sql}
|
[Arguments] ${sql}
|
||||||
#创建请求信息
|
#创建请求信息
|
||||||
Create Session api http://192.168.40.224:9999
|
Create Session api http://192.168.40.186:9999
|
||||||
#发送请求
|
#发送请求
|
||||||
${remoteResponse}= Get Request api ?query=${sql}
|
${remoteResponse}= Get Request api ?query=${sql}
|
||||||
[Return] ${remoteResponse}
|
[Return] ${remoteResponse}
|
||||||
|
|||||||
Reference in New Issue
Block a user