Compare commits
88 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
009cee44c2 | ||
|
|
75c2a38c01 | ||
|
|
b29fdf0b29 | ||
|
|
3ad59e41de | ||
|
|
9a6f33a22d | ||
|
|
6f13eb5e3c | ||
|
|
6adb137468 | ||
|
|
9b3d88178d | ||
|
|
3df6e275af | ||
|
|
7f5caeef81 | ||
|
|
2c9aee7dbd | ||
|
|
3df5c2f490 | ||
|
|
4521e6d3d1 | ||
|
|
b5e18f6584 | ||
|
|
1f3013a5cd | ||
|
|
98805f5688 | ||
|
|
660cac41de | ||
|
|
2205378992 | ||
|
|
cbda2f4247 | ||
|
|
0ddb38d37a | ||
|
|
24e8c56184 | ||
|
|
b26fe07caf | ||
|
|
513d0ce671 | ||
|
|
98a37f5ee1 | ||
|
|
79eee3754d | ||
|
|
0704cd2172 | ||
|
|
a5d909ff29 | ||
|
|
fc79ac3782 | ||
|
|
a3f9d64293 | ||
|
|
b439b79e90 | ||
|
|
e49dc6ae44 | ||
|
|
578115e865 | ||
|
|
0c697853fc | ||
|
|
969dc7bf1c | ||
|
|
34c02dec90 | ||
|
|
bbc604f568 | ||
|
|
d6daa601f0 | ||
|
|
a567786cd7 | ||
|
|
2d673f6711 | ||
|
|
a7d05c205c | ||
|
|
f1161f84c9 | ||
|
|
7418b65cf2 | ||
|
|
ab51260399 | ||
|
|
a4c9e2bbcd | ||
|
|
82a3fb4945 | ||
|
|
20c0e70a39 | ||
|
|
e675444a62 | ||
|
|
1864e8b3cd | ||
|
|
c3e18a4586 | ||
|
|
707268f0aa | ||
|
|
ca22cc7ba7 | ||
|
|
e9893ac45d | ||
|
|
8a41c0112b | ||
|
|
b6cd16e91c | ||
|
|
a2b1f8e435 | ||
|
|
d49bacc3ac | ||
|
|
c090a8e543 | ||
|
|
e968f84c0c | ||
|
|
75c5a4c6e5 | ||
|
|
d8827dfb8f | ||
|
|
3b0fbc9477 | ||
|
|
543ea25db2 | ||
|
|
99d3d9b64f | ||
|
|
07a90e9334 | ||
|
|
6a373444a7 | ||
|
|
8fad174fc0 | ||
|
|
ea85769fa8 | ||
|
|
4185f1b2ea | ||
|
|
b36f413d16 | ||
|
|
2b35194cdd | ||
|
|
5c454fec1c | ||
|
|
adc3e5abef | ||
|
|
c6c166891f | ||
|
|
afb1e1a8dd | ||
|
|
d604fb65e2 | ||
|
|
ad53bddc3a | ||
|
|
5cfbf79c04 | ||
|
|
580f9d231d | ||
|
|
78f1139faf | ||
|
|
6f245c88ff | ||
|
|
d02ce7623d | ||
|
|
382ee10779 | ||
|
|
44ab2e5c37 | ||
|
|
cf9d6bd18e | ||
|
|
671651a625 | ||
|
|
208b3cf504 | ||
|
|
ff0652739c | ||
|
|
c03a7c9358 |
64
.gitlab-ci.yml
Normal file
64
.gitlab-ci.yml
Normal file
@@ -0,0 +1,64 @@
|
||||
stages:
|
||||
- deploy #运行的类型,有
|
||||
- deployagain
|
||||
|
||||
api: #随意填写,起标示作用
|
||||
stage: deploy #和上述的类型对应
|
||||
|
||||
only:
|
||||
- deploy #指定触发分支
|
||||
tags:
|
||||
- "155auto"
|
||||
|
||||
script:
|
||||
- pwd
|
||||
- docker stop auto-custom-clibrary-api || true && docker rm auto-custom-clibrary-api || true
|
||||
- cd docker/api
|
||||
- docker-compose build
|
||||
- time=`date +%m%d` docker-compose up -d
|
||||
|
||||
|
||||
cli: #随意填写,起标示作用
|
||||
stage: deploy #和上述的类型对应
|
||||
|
||||
only:
|
||||
- deploy #指定触发分支
|
||||
tags:
|
||||
- "155auto"
|
||||
|
||||
script:
|
||||
- pwd
|
||||
- docker stop auto-custom-clibrary-cli || true && docker rm auto-custom-clibrary-cli || true
|
||||
- cd docker/cli
|
||||
- docker-compose build
|
||||
- time=`date +%m%d` docker-compose up -d
|
||||
|
||||
|
||||
156api: #随意填写,起标示作用
|
||||
stage: deployagain #和上述的类型对应
|
||||
|
||||
only:
|
||||
- deploy #指定触发分支
|
||||
tags:
|
||||
- "156auto"
|
||||
script:
|
||||
- pwd
|
||||
- docker stop auto-custom-clibrary-api || true && docker rm auto-custom-clibrary-api || true
|
||||
- cd docker/api
|
||||
- docker-compose build
|
||||
- time=`date +%m%d` docker-compose up -d
|
||||
|
||||
|
||||
156cli: #随意填写,起标示作用
|
||||
stage: deployagain #和上述的类型对应
|
||||
|
||||
only:
|
||||
- deploy #指定触发分支
|
||||
tags:
|
||||
- "156auto"
|
||||
script:
|
||||
- pwd
|
||||
- docker stop auto-custom-clibrary-cli || true && docker rm auto-custom-clibrary-cli || true
|
||||
- cd docker/cli
|
||||
- docker-compose build
|
||||
- time=`date +%m%d` docker-compose up -d
|
||||
@@ -11,7 +11,7 @@ Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/decryption
|
||||
${url} /v1/policy/profile/decryption
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags tsg_adc proxy_policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
@@ -11,7 +10,7 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/responsepages
|
||||
${url} /v1/policy/profile/responsepages
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -46,6 +45,7 @@ ProxyPolicy-Deny-Http-00001
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00002
|
||||
[Tags] selfserver ip+fqdn完整匹配
|
||||
@@ -78,6 +78,7 @@ ProxyPolicy-Deny-Http-00002
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00003
|
||||
[Tags] selfserver ip+cat右匹配
|
||||
@@ -110,6 +111,7 @@ ProxyPolicy-Deny-Http-00003
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00004
|
||||
[Tags] selfserver ip+url右匹配
|
||||
@@ -144,6 +146,7 @@ ProxyPolicy-Deny-Http-00004
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Http-00005
|
||||
[Tags] selfserver ip+url字串匹配
|
||||
@@ -178,6 +181,7 @@ ProxyPolicy-Deny-Http-00005
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Http-00006
|
||||
[Tags] selfserver ip+url完整匹配
|
||||
@@ -210,6 +214,7 @@ ProxyPolicy-Deny-Http-00006
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00007
|
||||
[Tags] selfserver ip+url左匹配
|
||||
@@ -245,6 +250,7 @@ ProxyPolicy-Deny-Http-00007
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Http-00008
|
||||
[Tags] selfserver ip+请求头右匹配
|
||||
@@ -279,6 +285,7 @@ ProxyPolicy-Deny-Http-00008
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Http-00009
|
||||
[Tags] selfserver ip+请求头字串匹配
|
||||
@@ -313,6 +320,7 @@ ProxyPolicy-Deny-Http-00009
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Http-00010
|
||||
[Tags] selfserver ip+请求头完整匹配
|
||||
@@ -345,6 +353,7 @@ ProxyPolicy-Deny-Http-00010
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00011
|
||||
[Tags] selfserver ip+请求头左匹配
|
||||
@@ -380,6 +389,7 @@ ProxyPolicy-Deny-Http-00011
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Http-00012
|
||||
[Tags] selfserver ip+cookie字串匹配
|
||||
@@ -412,6 +422,7 @@ ProxyPolicy-Deny-Http-00012
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00013
|
||||
[Tags] selfserver ip+应答头右匹配
|
||||
@@ -444,6 +455,7 @@ ProxyPolicy-Deny-Http-00013
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00014
|
||||
[Tags] selfserver ip+应答头字串匹配
|
||||
@@ -478,6 +490,7 @@ ProxyPolicy-Deny-Http-00014
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Http-00015
|
||||
[Tags] selfserver ip+应答头完整匹配
|
||||
@@ -510,6 +523,7 @@ ProxyPolicy-Deny-Http-00015
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00016
|
||||
[Tags] selfserver ip+应答头左匹配
|
||||
@@ -542,6 +556,7 @@ ProxyPolicy-Deny-Http-00016
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00017
|
||||
[Tags] selfserver ip+set-cookie右匹配
|
||||
@@ -574,6 +589,7 @@ ProxyPolicy-Deny-Http-00017
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00018
|
||||
[Tags] selfserver ip+set-cookie字串匹配
|
||||
@@ -608,6 +624,7 @@ ProxyPolicy-Deny-Http-00018
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Http-00019
|
||||
[Tags] selfserver ip+set-cookie完整匹配
|
||||
@@ -640,6 +657,7 @@ ProxyPolicy-Deny-Http-00019
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00020
|
||||
[Tags] selfserver ip+set-cookie左匹配
|
||||
@@ -672,6 +690,7 @@ ProxyPolicy-Deny-Http-00020
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00021
|
||||
[Tags] selfserver ip+请求体字串匹配
|
||||
@@ -704,6 +723,7 @@ ProxyPolicy-Deny-Http-00021
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00022
|
||||
[Tags] selfserver ip+应答体字串匹配
|
||||
@@ -736,6 +756,7 @@ ProxyPolicy-Deny-Http-00022
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00023
|
||||
[Tags] selfserver 最大组合
|
||||
@@ -784,6 +805,7 @@ ProxyPolicy-Deny-Http-00023
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
ProxyPolicy-Deny-Http-00024
|
||||
[Tags] selfserver 修改
|
||||
Comment 创建url
|
||||
@@ -835,6 +857,7 @@ ProxyPolicy-Deny-Http-00024
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
ProxyPolicy-Deny-Http-00025
|
||||
[Tags] selfserver ip+请求体and关系
|
||||
Comment 创建请求体
|
||||
@@ -866,6 +889,7 @@ ProxyPolicy-Deny-Http-00025
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00026
|
||||
[Tags] selfserver ip+请求体或更新
|
||||
@@ -898,6 +922,7 @@ ProxyPolicy-Deny-Http-00026
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00027
|
||||
[Tags] selfserver ip+应答体and关系
|
||||
@@ -930,6 +955,7 @@ ProxyPolicy-Deny-Http-00027
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Http-00028
|
||||
[Tags] selfserver ip+应答体或关系
|
||||
@@ -962,3 +988,4 @@ ProxyPolicy-Deny-Http-00028
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags tsg_adc proxy_policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
@@ -11,7 +10,7 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/responsepages
|
||||
${url} /v1/policy/profile/responsepages
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -46,6 +45,7 @@ ProxyPolicy-Deny-Ssl-00001
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00002
|
||||
[Tags] selfserver ip+fqdn完整匹配
|
||||
@@ -78,6 +78,7 @@ ProxyPolicy-Deny-Ssl-00002
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00003
|
||||
[Tags] selfserver ip+cat右匹配
|
||||
@@ -110,6 +111,7 @@ ProxyPolicy-Deny-Ssl-00003
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00004
|
||||
[Tags] selfserver ip+url右匹配
|
||||
@@ -144,6 +146,7 @@ ProxyPolicy-Deny-Ssl-00004
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00005
|
||||
[Tags] selfserver ip+url字串匹配
|
||||
@@ -178,6 +181,7 @@ ProxyPolicy-Deny-Ssl-00005
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00006
|
||||
[Tags] selfserver ip+url完整匹配
|
||||
@@ -210,6 +214,7 @@ ProxyPolicy-Deny-Ssl-00006
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00007
|
||||
[Tags] selfserver ip+url左匹配
|
||||
@@ -245,6 +250,7 @@ ProxyPolicy-Deny-Ssl-00007
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00008
|
||||
[Tags] selfserver ip+请求头右匹配
|
||||
@@ -279,6 +285,7 @@ ProxyPolicy-Deny-Ssl-00008
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00009
|
||||
[Tags] selfserver ip+请求头字串匹配
|
||||
@@ -313,6 +320,7 @@ ProxyPolicy-Deny-Ssl-00009
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00010
|
||||
[Tags] selfserver ip+请求头完整匹配
|
||||
@@ -345,6 +353,7 @@ ProxyPolicy-Deny-Ssl-00010
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00011
|
||||
[Tags] selfserver ip+请求头左匹配
|
||||
@@ -380,6 +389,7 @@ ProxyPolicy-Deny-Ssl-00011
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00012
|
||||
[Tags] selfserver ip+cookie字串匹配
|
||||
@@ -412,6 +422,7 @@ ProxyPolicy-Deny-Ssl-00012
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00013
|
||||
[Tags] selfserver ip+应答头右匹配
|
||||
@@ -444,6 +455,7 @@ ProxyPolicy-Deny-Ssl-00013
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00014
|
||||
[Tags] selfserver ip+应答头字串匹配
|
||||
@@ -478,6 +490,7 @@ ProxyPolicy-Deny-Ssl-00014
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00015
|
||||
[Tags] selfserver ip+应答头完整匹配
|
||||
@@ -510,6 +523,7 @@ ProxyPolicy-Deny-Ssl-00015
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00016
|
||||
[Tags] selfserver ip+应答头左匹配
|
||||
@@ -542,6 +556,7 @@ ProxyPolicy-Deny-Ssl-00016
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00017
|
||||
[Tags] selfserver ip+set-cookie右匹配
|
||||
@@ -574,6 +589,7 @@ ProxyPolicy-Deny-Ssl-00017
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00018
|
||||
[Tags] selfserver ip+set-cookie字串匹配
|
||||
@@ -608,6 +624,7 @@ ProxyPolicy-Deny-Ssl-00018
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00019
|
||||
[Tags] selfserver ip+set-cookie完整匹配
|
||||
@@ -640,6 +657,7 @@ ProxyPolicy-Deny-Ssl-00019
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00020
|
||||
[Tags] selfserver ip+set-cookie左匹配
|
||||
@@ -672,6 +690,7 @@ ProxyPolicy-Deny-Ssl-00020
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00021
|
||||
[Tags] selfserver ip+请求体字串匹配
|
||||
@@ -704,6 +723,7 @@ ProxyPolicy-Deny-Ssl-00021
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00022
|
||||
[Tags] selfserver ip+应答体字串匹配
|
||||
@@ -736,6 +756,7 @@ ProxyPolicy-Deny-Ssl-00022
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00023
|
||||
[Tags] selfserver 最大组合
|
||||
@@ -784,6 +805,7 @@ ProxyPolicy-Deny-Ssl-00023
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
ProxyPolicy-Deny-Ssl-00024
|
||||
[Tags] selfserver 修改
|
||||
Comment 创建fqdn
|
||||
@@ -833,6 +855,7 @@ ProxyPolicy-Deny-Ssl-00024
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
ProxyPolicy-Deny-Ssl-00025
|
||||
[Tags] selfserver ip+请求体and关系
|
||||
Comment 创建请求体
|
||||
@@ -864,6 +887,7 @@ ProxyPolicy-Deny-Ssl-00025
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00026
|
||||
[Tags] selfserver ip+请求体或关系
|
||||
@@ -896,6 +920,7 @@ ProxyPolicy-Deny-Ssl-00026
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00027
|
||||
[Tags] selfserver ip+应答体and关系
|
||||
@@ -928,6 +953,7 @@ ProxyPolicy-Deny-Ssl-00027
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
ProxyPolicy-Deny-Ssl-00028
|
||||
[Tags] selfserver ip+应答体或关系
|
||||
@@ -960,4 +986,5 @@ ProxyPolicy-Deny-Ssl-00028
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Test Teardown DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
Force Tags tsg_adc proxy_policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
@@ -11,7 +11,7 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/hijackfiles
|
||||
${url} /v1/policy/profile/hijackfiles
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Test Teardown DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
Force Tags tsg_adc proxy_policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
@@ -11,7 +11,7 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/hijackfiles
|
||||
${url} /v1/policy/profile/hijackfiles
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Test Teardown DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
Force Tags tsg_adc proxy_policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
@@ -11,7 +11,7 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/insertscripts
|
||||
${url} /v1/policy/profile/insertscripts
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Test Teardown DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${profiledId}
|
||||
Force Tags tsg_adc proxy_policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
@@ -11,7 +11,7 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/insertscripts
|
||||
${url} /v1/policy/profile/insertscripts
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
|
||||
@@ -199,7 +199,7 @@ SecurityPolicy-Deny-DNS-00007
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.suning.com
|
||||
... ELSE set variable nslookup -debug -query=AAAA www.suning.com
|
||||
... ELSE set variable nslookup -debug -query=AAAA www.suning.com
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:66 www.zhihu.com ttl = 300
|
||||
... ELSE Create List fc00::2:66 www.zhihu.com ttl = 300
|
||||
${starttime} Get Time
|
||||
|
||||
@@ -11,7 +11,7 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/responsepages
|
||||
${url} /v1/policy/profile/responsepages
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
|
||||
@@ -22,7 +22,7 @@ SecurityPolicy-Deny-Mail-00001
|
||||
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${object_Subject_Id}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00001 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"rst"} referenceObject=${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appObjectIdArray=5
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00001 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"block","code":550} referenceObject=${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT isValid=${1} appObjectIdArray=5
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
@@ -158,7 +158,7 @@ SecurityPolicy-Deny-Mail-00005
|
||||
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${object_Content_Id}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"rst"} referenceObject=${object_Content_Id}|TSG_FIELD_MAIL_CONTENT isValid=${1} appObjectIdArray=5
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"block","code":551} referenceObject=${object_Content_Id}|TSG_FIELD_MAIL_CONTENT isValid=${1} appObjectIdArray=5
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
@@ -192,7 +192,7 @@ SecurityPolicy-Deny-Mail-00006
|
||||
${rescode} ${object_ATT_CONT_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${object_ATT_CONT_Id}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT isValid=${1} appObjectIdArray=5
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_ATT_CONT_Id}|TSG_FIELD_MAIL_ATT_CONTENT isValid=${1} appObjectIdArray=5
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
@@ -226,7 +226,7 @@ SecurityPolicy-Deny-Mail-00007
|
||||
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${object_From_Id}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"rst"} referenceObject=${object_From_Id}|TSG_FIELD_MAIL_FROM isValid=${1} appObjectIdArray=5
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"rst"} referenceObject=${object_From_Id}|TSG_FIELD_MAIL_FROM isValid=${1} appObjectIdArray=5
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
@@ -260,7 +260,7 @@ SecurityPolicy-Deny-Mail-00008
|
||||
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${object_From_Id}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"rst"} referenceObject=${object_From_Id}|TSG_FIELD_MAIL_FROM isValid=${1} appObjectIdArray=5
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"rst"} referenceObject=${object_From_Id}|TSG_FIELD_MAIL_FROM isValid=${1} appObjectIdArray=5
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
@@ -294,7 +294,7 @@ SecurityPolicy-Deny-Mail-00009
|
||||
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${object_From_Id}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00009 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_From_Id}|TSG_FIELD_MAIL_FROM isValid=${1} appObjectIdArray=5
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00009 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_From_Id}|TSG_FIELD_MAIL_FROM isValid=${1} appObjectIdArray=5
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
@@ -328,7 +328,7 @@ SecurityPolicy-Deny-Mail-00010
|
||||
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${object_From_Id}
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-Mail-00010 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_From_Id}|TSG_FIELD_MAIL_FROM isValid=${1} appObjectIdArray=5
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00010 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_From_Id}|TSG_FIELD_MAIL_FROM isValid=${1} appObjectIdArray=5
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags tsg_adc Security_Policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Resource ../../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/keyringobj
|
||||
${url} /v1/policy/profile/keyringobj
|
||||
${keyringId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
SecurityPolicy-Intercept-SSL-00001
|
||||
[Tags] ip root selfserver
|
||||
Comment 创建证书
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/root/ mesalab-ca-cert.pem mesalab-ca-key.pem
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/root/ mesalab-ca-cert.pem mesalab-ca-key.pem root
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
|
||||
@@ -42,7 +42,7 @@ SecurityPolicy-Intercept-SSL-00001
|
||||
SecurityPolicy-Intercept-SSL-00002
|
||||
[Tags] root selfserver ip+cat
|
||||
Comment 创建证书
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/root/ tango-ca-root-01-cer.pem tango-ca-root-01-key.pem
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/root/ tango-ca-root-01-cer.pem tango-ca-root-01-key.pem root
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
|
||||
@@ -70,7 +70,7 @@ SecurityPolicy-Intercept-SSL-00002
|
||||
SecurityPolicy-Intercept-SSL-00003
|
||||
[Tags] root ip+fqdn selfserver
|
||||
Comment 创建证书
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/root/ tango-ca-trust-ca-cer.pem tango-ca-trust-ca-key.pem
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/root/ tango-ca-trust-ca-cer.pem tango-ca-trust-ca-key.pem root
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
|
||||
@@ -98,7 +98,7 @@ SecurityPolicy-Intercept-SSL-00003
|
||||
SecurityPolicy-Intercept-SSL-00004
|
||||
[Tags] Selfserver ip intermediate
|
||||
Comment 创建证书
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/intermediate/ tang-ca-v3-intermediate-01-cer.pem tang-ca-v3-intermediate-01-key.pem {"isValid":1,"opAction":"add","returnData":1,"keyringName":"test1","keyringType":"intermediate","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa1024","keyringId":null,"includeRoot":0}
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/intermediate/ tang-ca-v3-intermediate-01-cer.pem tang-ca-v3-intermediate-01-key.pem intermediate
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
|
||||
@@ -122,7 +122,7 @@ SecurityPolicy-Intercept-SSL-00004
|
||||
SecurityPolicy-Intercept-SSL-00005
|
||||
[Tags] selfserver ip+cat intermediate
|
||||
Comment 创建证书
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/intermediate/ tang-ca-v3-intermediate-02-cer.pem tang-ca-v3-intermediate-02-key.pem {"isValid":1,"opAction":"add","returnData":1,"keyringName":"test2","keyringType":"intermediate","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa1024","keyringId":null,"includeRoot":0}
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/intermediate/ tang-ca-v3-intermediate-02-cer.pem tang-ca-v3-intermediate-02-key.pem intermediate
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
|
||||
@@ -150,7 +150,7 @@ SecurityPolicy-Intercept-SSL-00005
|
||||
SecurityPolicy-Intercept-SSL-00006
|
||||
[Tags] ip+fqdn selfserver end-entity
|
||||
Comment 创建证书
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem {"isValid":1,"opAction":"add","returnData":1,"keyringName":"test3","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa1024","keyringId":null,"includeRoot":0}
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem end-entity
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
Comment 创建cat
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
|
||||
@@ -178,7 +178,7 @@ SecurityPolicy-Intercept-SSL-00006
|
||||
SecurityPolicy-Intercept-SSL-00007
|
||||
[Tags] Selfserver ip end-entity
|
||||
Comment 创建证书
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.bing.com-cer.pem tang-ca-v3-www.bing.com-key.pem {"isValid":1,"opAction":"add","returnData":1,"keyringName":"test4","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa1024","keyringId":null,"includeRoot":0}
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.bing.com-cer.pem tang-ca-v3-www.bing.com-key.pem end-entity
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
|
||||
|
||||
24
01-TestCase/tsg_bfapi/Filter/file_integrity_rate.robot
Normal file
24
01-TestCase/tsg_bfapi/Filter/file_integrity_rate.robot
Normal file
@@ -0,0 +1,24 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Filter.robot
|
||||
|
||||
*** Test Cases ***
|
||||
File_integrity_rate-1
|
||||
[Tags] 正向
|
||||
Filter file_integrity_rate jwc-1 10 12
|
||||
|
||||
File_integrity_rate-2
|
||||
[Tags] 最大值
|
||||
Filter file_integrity_rate jwc-2 1 100
|
||||
|
||||
File_integrity_rate-3
|
||||
[Tags] 超过最大值
|
||||
Filter file_integrity_rate jwc-3 1 101
|
||||
|
||||
File_integrity_rate-4
|
||||
[Tags] 小于最小值
|
||||
Filter file_integrity_rate jwc-4 0 100
|
||||
|
||||
File_integrity_rate-5
|
||||
[Tags] 下界大于上界
|
||||
Filter file_integrity_rate jwc-5 15 10
|
||||
24
01-TestCase/tsg_bfapi/Filter/file_size.robot
Normal file
24
01-TestCase/tsg_bfapi/Filter/file_size.robot
Normal file
@@ -0,0 +1,24 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Filter.robot
|
||||
|
||||
*** Test Cases ***
|
||||
File_size-1
|
||||
[Tags] 正向
|
||||
Filter file_size jwc-1 10 12
|
||||
|
||||
File_size-2
|
||||
[Tags] 最大值
|
||||
Filter file_size jwc-2 0 2147483647
|
||||
|
||||
File_size-3
|
||||
[Tags] 超过最大值
|
||||
Filter file_size jwc-3 0 2147483648
|
||||
|
||||
File_size-4
|
||||
[Tags] 小于最小值
|
||||
Filter file_size jwc-4 -1 2147483647
|
||||
|
||||
File_size-5
|
||||
[Tags] 下界大于上界
|
||||
Filter file_size jwc-4 100 99
|
||||
@@ -7,7 +7,6 @@ Library Selenium2Library
|
||||
Library RequestsLibrary
|
||||
Library Collections
|
||||
Library string
|
||||
Library REST http://${host}:${port}/${version}
|
||||
Library json
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -19,7 +18,7 @@ CountLog-001
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -33,7 +32,7 @@ CountLog-002
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -47,7 +46,7 @@ CountLog-003
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -61,7 +60,7 @@ CountLog-004
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -75,7 +74,7 @@ CountLog-005
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -89,7 +88,7 @@ CountLog-006
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -103,7 +102,7 @@ CountLog-007
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","condaiapi-logaa tions":[${condition}]}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -117,7 +116,7 @@ CountLog-008
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -131,7 +130,7 @@ CountLog-009
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -145,7 +144,7 @@ CountLog-010
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -159,7 +158,7 @@ CountLog-011
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -173,7 +172,7 @@ CountLog-012
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -187,7 +186,7 @@ CountLog-013
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -201,7 +200,7 @@ CountLog-014
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -215,7 +214,7 @@ CountLog-015
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -229,7 +228,7 @@ CountLog-016
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -243,7 +242,7 @@ CountLog-017
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -257,7 +256,7 @@ CountLog-018
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -271,7 +270,7 @@ CountLog-019
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -285,7 +284,7 @@ CountLog-020
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -299,7 +298,7 @@ CountLog-021
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -313,7 +312,7 @@ CountLog-022
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -327,7 +326,7 @@ CountLog-023
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -341,7 +340,7 @@ CountLog-024
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
@@ -355,7 +354,7 @@ CountLog-025
|
||||
${endtime} Set Variable 2020-04-27 13:27:03
|
||||
${logname} Set Variable active_defence_event_log
|
||||
${logCondition} Set Variable {"pageNo":${pageNo},"pageSize":${pageSize},"logType":"${logname}","start_common_recv_time":"${startTime}","end_common_recv_time":"${endTime}","conditions":${condition}}
|
||||
${url} Set Variable log/count
|
||||
${url} Set Variable /${version}/log/count
|
||||
${response} Post-Request ${url} ${logCondition}
|
||||
${responsejson} Evaluate type($response)
|
||||
Should Be Equal As Strings ${response}[code] 200
|
||||
|
||||
@@ -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
|
||||
|
||||
Resource ../../../02-Keyword/tsg_bfapi/CommonUtil.robot
|
||||
*** Variables ***
|
||||
@{logType} security_event_log proxy_event_log connection_record_log radius_record_log
|
||||
|
||||
${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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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
|
||||
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
|
||||
${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} http://${host}:${port}/${version}/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","2020-04-27 13:27:03"] }
|
||||
${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} ${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} http://${host}:${port}/${version}/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","2020-04-27 13:27:03"] }
|
||||
${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} ${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} http://${host}:${port}/${version}/log/batch
|
||||
${success} downloadexcel ${header} ${logCondition} ${apipath}/log/batch
|
||||
log ${success}
|
||||
Should Be Equal ${success} ${200} active_defence_event_log\ test query export failed
|
||||
|
||||
|
||||
@@ -7,8 +7,9 @@ Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Log_schema.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Log_search.robot
|
||||
Library string
|
||||
Library REST http://${host}:${port}/${version}
|
||||
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
|
||||
@@ -17,18 +18,21 @@ log-schema-001
|
||||
|
||||
log-search-002
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-003
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -39,10 +43,11 @@ log-search-003
|
||||
|
||||
log-search-004
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -53,10 +58,11 @@ log-search-004
|
||||
|
||||
log-search-005
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -67,10 +73,11 @@ log-search-005
|
||||
|
||||
log-search-006
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -81,10 +88,11 @@ log-search-006
|
||||
|
||||
log-search-007
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -95,10 +103,11 @@ log-search-007
|
||||
|
||||
log-search-008
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -109,10 +118,11 @@ log-search-008
|
||||
|
||||
log-search-009
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -123,10 +133,11 @@ log-search-009
|
||||
|
||||
log-search-010
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -137,10 +148,11 @@ log-search-010
|
||||
|
||||
log-search-011
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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,9 +170,10 @@ 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 v1/log/list ${logCondition}
|
||||
${response} BasePostRequest /${version}/log/list ${logCondition}
|
||||
Should Be Equal As Strings ${response.code} 200
|
||||
${responsedata} Get From Dictionary ${response} data
|
||||
log ${responsedata}
|
||||
@@ -170,10 +183,11 @@ log-search-012
|
||||
|
||||
log-search-013
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -184,96 +198,106 @@ log-search-013
|
||||
|
||||
log-search-014
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-015
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-016
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-017
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-018
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-019
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-020
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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 log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-022
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-023
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
@@ -284,27 +308,29 @@ log-search-023
|
||||
|
||||
log-search-024
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-025
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
log-search-026
|
||||
#${filds} schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${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
|
||||
|
||||
Binary file not shown.
@@ -1,13 +1,14 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Library DateTime
|
||||
|
||||
*** Test Cases ***
|
||||
Statistics-Country-00001
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable country
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/country/sourceipnum
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/country/sourceipnum
|
||||
#开始时间格式Y-M-D h:i:s
|
||||
${startTime} set variable 2020-05-10 15:56:05
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -20,8 +21,8 @@ Statistics-Country-00002
|
||||
#最近一小时
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable country
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/country/sourceipnum
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/country/sourceipnum
|
||||
#开始时间
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
@@ -36,8 +37,8 @@ Statistics-Country-00003
|
||||
#最近一天
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable country
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/country/sourceipnum
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/country/sourceipnum
|
||||
#开始时间
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
@@ -54,8 +55,8 @@ Statistics-Country-00004
|
||||
#最近一周
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable country
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/country/sourceipnum
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/country/sourceipnum
|
||||
#开始时间
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
@@ -72,8 +73,8 @@ Statistics-Country-00005
|
||||
#最近一个月(30天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable country
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/country/sourceipnum
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/country/sourceipnum
|
||||
#开始时间
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
@@ -90,8 +91,8 @@ Statistics-Country-00006
|
||||
#最近一年(365天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable country
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/country/sourceipnum
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/country/sourceipnum
|
||||
#开始时间
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Test Cases ***
|
||||
Statistics-domain-00001
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable domain
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/domain/recommend
|
||||
${url} set variable /${version}/report/domain/recommend
|
||||
# \ 统计时间, \ 查询最近24小时数据;例如当前时间为2020-03-26 15:14:00, 查询时间应设为推前1小时的整点,实际传入参数为 "2020-03-26 14:00:00"
|
||||
${statisticTime} set variable 2020-05-10 15:56:05
|
||||
GetApi ${apiName} ${url} statisticTime=${statisticTime}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
*** Settings ***
|
||||
Library DateTime
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Test Cases ***
|
||||
LogStatistics-domain_resource-00001
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable domain_resource
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/domain/resource/analyze
|
||||
${url} set variable /${version}/report/domain/resource/analyze
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Library DateTime
|
||||
|
||||
*** Test Cases ***
|
||||
Statistics-hijack_srcip_location-00001
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_location
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_location
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_location
|
||||
#开始时间格式Y-M-D h:i:s
|
||||
${startTime} set variable 2020-04-26 16:40:01
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -20,8 +21,8 @@ Statistics-hijack_srcip_location-00002
|
||||
#最近一小时
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_location
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_location
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_location
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -37,8 +38,8 @@ Statistics-hijack_srcip_location-00003
|
||||
#最近一天
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_location
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_location
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_location
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -54,8 +55,8 @@ Statistics-hijack_srcip_location-00004
|
||||
#最近一周
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_location
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_location
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_location
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -71,8 +72,8 @@ Statistics-hijack_srcip_location-00005
|
||||
#最近一个月(30天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_location
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_location
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_location
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -88,8 +89,8 @@ Statistics-hijack_srcip_location-00006
|
||||
#最近一年(365天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_location
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_location
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_location
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Library DateTime
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -7,8 +8,8 @@ LogStatistics-hijack_scrip_num-00001
|
||||
#120未更新
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_num
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_num
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/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
|
||||
@@ -20,8 +21,8 @@ LogStatistics-hijack_scrip_num-00001
|
||||
LogStatistics-hijack_scrip_num-00002
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_num
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_num
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_num
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -36,8 +37,8 @@ LogStatistics-hijack_scrip_num-00002
|
||||
LogStatistics-hijack_scrip_num-00003
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_num
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_num
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_num
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -52,8 +53,8 @@ LogStatistics-hijack_scrip_num-00003
|
||||
LogStatistics-hijack_scrip_num-00004
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_num
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_num
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_num
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -68,8 +69,8 @@ LogStatistics-hijack_scrip_num-00004
|
||||
LogStatistics-hijack_scrip_num-00005
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_num
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_num
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_num
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -84,8 +85,8 @@ LogStatistics-hijack_scrip_num-00005
|
||||
LogStatistics-hijack_scrip_num-00006
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable hijack_srcip_num
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/hijack_srcip_num
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/hijack_srcip_num
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Library DateTime
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -7,8 +8,8 @@ LogStatistics-injectionstatistics-00001
|
||||
#120未更新
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable injectionstatistics
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/injectionstatistics
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/injectionstatistics
|
||||
#开始时间格式Y-M-D h:i:s
|
||||
${startTime} set variable 2020-04-26 16:40:01
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -25,8 +26,8 @@ LogStatistics-injectionstatistics-00002
|
||||
#120未更新
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable injectionstatistics
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/injectionstatistics
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/injectionstatistics
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -42,8 +43,8 @@ LogStatistics-injectionstatistics-00003
|
||||
#120未更新
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable injectionstatistics
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/injectionstatistics
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/injectionstatistics
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -60,8 +61,8 @@ LogStatistics-injectionstatistics-00004
|
||||
#120未更新
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable injectionstatistics
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/injectionstatistics
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/injectionstatistics
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -78,8 +79,8 @@ LogStatistics-injectionstatistics-00005
|
||||
#120未更新
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable injectionstatistics
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/injectionstatistics
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/injectionstatistics
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -96,8 +97,8 @@ LogStatistics-injectionstatistics-00006
|
||||
#120未更新
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable injectionstatistics
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/injectionstatistics
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/injectionstatistics
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Library DateTime
|
||||
|
||||
*** Test Cases ***
|
||||
Statistics-ip_correlation_domain-00001
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable ip_correlation_domain
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/ip_correlation_domain
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/ip_correlation_domain
|
||||
#开始时间格式Y-M-D h:i:s
|
||||
${startTime} set variable 2020-04-01 16:05:04
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -19,8 +20,8 @@ Statistics-ip_correlation_domain-00001
|
||||
Statistics-ip_correlation_domain-00002
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable ip_correlation_domain
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/ip_correlation_domain
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/ip_correlation_domain
|
||||
#开始时间格式Y-M-D h:i:s
|
||||
${startTime} set variable 2020-04-01 16:05:04
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -31,8 +32,8 @@ Statistics-ip_correlation_domain-00003
|
||||
#最近一小时
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable ip_correlation_domain
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/ip_correlation_domain
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/ip_correlation_domain
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -48,8 +49,8 @@ Statistics-ip_correlation_domain-00004
|
||||
#最近一天
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable ip_correlation_domain
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/ip_correlation_domain
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/ip_correlation_domain
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -65,8 +66,8 @@ Statistics-ip_correlation_domain-00005
|
||||
#最近一周(7天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable ip_correlation_domain
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/ip_correlation_domain
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/ip_correlation_domain
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -82,8 +83,8 @@ Statistics-ip_correlation_domain-00006
|
||||
#最近一个月(30天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable ip_correlation_domain
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/ip_correlation_domain
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/ip_correlation_domain
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
@@ -99,8 +100,8 @@ Statistics-ip_correlation_domain-00007
|
||||
#最近一年
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable ip_correlation_domain
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/ip_correlation_domain
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/ip_correlation_domain
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
${Time} get current date
|
||||
${endTime}= add time to date ${Time} -00:05:00
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Test Cases ***
|
||||
LogStatistics-topn-00001
|
||||
#131已通过
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable topn
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/topn/domain
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/topn/domain
|
||||
#开始时间格式Y-M-D h:i:s
|
||||
${startTime} set variable 2020-04-26 18:38:07
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Library DateTime
|
||||
|
||||
*** Test Cases ***
|
||||
Statistics-traffic-00001
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable traffic
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/statisticsbyunit
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/statisticsbyunit
|
||||
#统计类型: bytes:字节数 packets:包数 sessions:连接数 如不指定,则统计全部 statisticsUnit=${statisticUnit}
|
||||
${statisticUnit} set variable bytes
|
||||
#开始时间格式Y-M-D h:i:s
|
||||
@@ -22,8 +23,8 @@ Statistics-traffic-00001
|
||||
Statistics-traffic-00002
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable traffic
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/statisticsbyunit
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/statisticsbyunit
|
||||
#开始时间格式Y-M-D h:i:s
|
||||
${startTime} set variable 2020-04-26 13:36:35
|
||||
${endTime} set variable 2020-04-26 23:04:56
|
||||
@@ -33,8 +34,8 @@ Statistics-traffic-00003
|
||||
#最近一小时
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable traffic
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/statisticsbyunit
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/statisticsbyunit
|
||||
#统计类型: bytes:字节数 packets:包数 sessions:连接数 如不指定,则统计全部 statisticsUnit=${statisticUnit}
|
||||
${statisticUnit} set variable bytes
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -53,8 +54,8 @@ Statistics-traffic-00004
|
||||
#最近一天
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable traffic
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/statisticsbyunit
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/statisticsbyunit
|
||||
#统计类型: bytes:字节数 packets:包数 sessions:连接数 如不指定,则统计全部 statisticsUnit=${statisticUnit}
|
||||
${statisticUnit} set variable bytes
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -73,8 +74,8 @@ Statistics-traffic-00005
|
||||
#最近一周(7天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable traffic
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/statisticsbyunit
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/statisticsbyunit
|
||||
#统计类型: bytes:字节数 packets:包数 sessions:连接数 如不指定,则统计全部 statisticsUnit=${statisticUnit}
|
||||
${statisticUnit} set variable bytes
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -93,8 +94,8 @@ Statistics-traffic-00006
|
||||
#最近一个月(30天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable traffic
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/statisticsbyunit
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/statisticsbyunit
|
||||
#统计类型: bytes:字节数 packets:包数 sessions:连接数 如不指定,则统计全部 statisticsUnit=${statisticUnit}
|
||||
${statisticUnit} set variable bytes
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
@@ -113,8 +114,8 @@ Statistics-traffic-00007
|
||||
#最近一年(365天)
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable traffic
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/traffic/statisticsbyunit
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/traffic/statisticsbyunit
|
||||
#统计类型: bytes:字节数 packets:包数 sessions:连接数 如不指定,则统计全部 statisticsUnit=${statisticUnit}
|
||||
${statisticUnit} set variable bytes
|
||||
#结束时间格式Y-M-D h:i:s
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
*** Settings ***
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Test Cases ***
|
||||
Statistics-url-00001
|
||||
#apiName,请求大数据时,用于区分每个接口的sql
|
||||
${apiName} set variable url
|
||||
#请求地址 例如:/report/domain/recommend
|
||||
${url} set variable /report/url/recommend
|
||||
#请求地址 例如:/${version}/report/domain/recommend
|
||||
${url} set variable /${version}/report/url/recommend
|
||||
#统计时间, \ 查询最近24小时数据;例如当前时间为2020-03-26 15:14:00, 查询时间应设为推前1小时的整点,实际传入参数为 "2020-03-26 14:00:00" \ 响应参数说明
|
||||
${statisticTime} set variable 2020-04-27 14:00:00
|
||||
GetApi ${apiName} ${url} statisticTime=${statisticTime}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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/trend
|
||||
${url} /${version}/report/policyevent/hit/trend
|
||||
|
||||
*** Test Cases ***
|
||||
LogStatistics-Trend-00001
|
||||
|
||||
0
01-TestCase/tsg_bfapi/offline_stat_report/.gitkeep
Normal file
0
01-TestCase/tsg_bfapi/offline_stat_report/.gitkeep
Normal file
@@ -0,0 +1,87 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${reportId} ${report_url} ${chartId} ${chart_url} ${datasetId} ${dataset_url} ${resultId} ${result_url}
|
||||
Force Tags tsg_bf_api chartlibrary_create report
|
||||
Library OperatingSystem
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/offline_stat_report/ApiRequest1.robot
|
||||
|
||||
*** Variables ***
|
||||
${dataset_url} /report/dataset
|
||||
${datasetId} ${EMPTY}
|
||||
${reportId} ${EMPTY}
|
||||
${report_url} /report/offlinejob
|
||||
${chartId} ${EMPTY}
|
||||
${chart_url} /report/chart
|
||||
${result_url} /report/offlinejob/result
|
||||
${resultId} ${EMPTY}
|
||||
*** Test Cases ***
|
||||
Chart_Library_Lien-001
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Lien-001
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Lien图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"line","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Client IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
Chart_Library_Area-002
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Area-002
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"proxy_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Area图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"area","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Client IP","type":"Line Down","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
Chart_Library_Pie-003
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Pie-003
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Pie图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"pie","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
Chart_Library_Bra-004
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Bra-004
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Bra图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"bar","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
Chart_Library_Table-005
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Table-005
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,普通
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
Chart_Library_Table-006
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Table-006
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,下钻
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
|
||||
|
||||
|
||||
102
01-TestCase/tsg_bfapi/offline_stat_report/ChartLibraryEdit.robot
Normal file
102
01-TestCase/tsg_bfapi/offline_stat_report/ChartLibraryEdit.robot
Normal file
@@ -0,0 +1,102 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${reportId} ${report_url} ${chartId} ${chart_url} ${datasetId} ${dataset_url} ${resultId} ${result_url}
|
||||
Force Tags tsg_bf_api chartlibrary_create report
|
||||
Library OperatingSystem
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/offline_stat_report/ApiRequest1.robot
|
||||
|
||||
*** Variables ***
|
||||
${dataset_url} /report/dataset
|
||||
${datasetId} ${EMPTY}
|
||||
${reportId} ${EMPTY}
|
||||
${report_url} /report/offlinejob
|
||||
${chartId} ${EMPTY}
|
||||
${chart_url} /report/chart
|
||||
${result_url} /report/offlinejob/result
|
||||
${resultId} ${EMPTY}
|
||||
*** Test Cases ***
|
||||
Chart_Library_Lien-001
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Lien-001
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Lien图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"line","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Client IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${chart_url} {"list":{"id":${chartId},"name":"${name}","description":"","datasetId":${datasetId},"chartType":"line","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Client IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
|
||||
Chart_Library_Area-002
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Area-002
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"proxy_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Area图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"area","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Client IP","type":"Line Down","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${chart_url} {"list":{"id":${chartId},"name":"${name}","description":"","datasetId":${datasetId},"chartType":"area","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Client IP","type":"Line Down","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
|
||||
Chart_Library_Pie-003
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Pie-003
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Pie图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"pie","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${chart_url} {"list":{"id":${chartId},"name":"${name}","description":"","datasetId":${datasetId},"chartType":"pie","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
|
||||
Chart_Library_Bra-004
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Bra-004
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Bra图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"bar","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${chart_url} {"list":{"id":${chartId},"name":"${name}","description":"","datasetId":${datasetId},"chartType":"bar","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
|
||||
Chart_Library_Table-005
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Table-005
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,普通
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${chart_url} {"list":{"id":${chartId},"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
|
||||
Chart_Library_Table-006
|
||||
#新建DataSet
|
||||
${name} Set Variable Chart_Library_Table-005
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,下钻
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${chart_url} {"list":{"id":${chartId},"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
@@ -0,0 +1,70 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${reportId} ${report_url} ${chartId} ${chart_url} ${datasetId} ${dataset_url} ${resultId} ${result_url}
|
||||
Force Tags tsg_bf_api dataset_edit report
|
||||
Library OperatingSystem
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/offline_stat_report/ApiRequest1.robot
|
||||
|
||||
*** Variables ***
|
||||
${dataset_url} /report/dataset
|
||||
${datasetId} ${EMPTY}
|
||||
${reportId} ${EMPTY}
|
||||
${report_url} /report/offlinejob
|
||||
${chartId} ${EMPTY}
|
||||
${chart_url} /report/chart
|
||||
${result_url} /report/offlinejob/result
|
||||
${resultId} ${EMPTY}
|
||||
*** Test Cases ***
|
||||
Security_Event_Dataset-001
|
||||
#新建Security_Even_Logs_DataSet(所有可以选择的项都添加到dataset中,Filter选择All)
|
||||
${name} Set Variable Security Event-DataSet-001
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","filterConnector":"and","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_policy_id"},{"name":"common_action"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"ssl_sni"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_c2s_pkt_num","expression":"sum","label":"Packets Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_pkt_num","expression":"sum","label":"Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num","expression":"sum","label":"Bytes Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_byte_num","expression":"sum","label":"Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_policy_id","expression":"","label":"Policy ID"},{"name":"common_action","expression":"","label":"Action"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"ssl_sni","expression":"","label":"SNI"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_policy_id","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_action","expression":"=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_c2s_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_c2s_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_content_type","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"ssl_sni","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_pinningst","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"ssl_intercept_state","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
|
||||
Security_Event_Dataset-002
|
||||
#新建Security_Even_Logs_DataSet(所有可以选择的项都添加到dataset中,Filter选择Any of the Following Conditions)
|
||||
${name} Set Variable Security Event-DataSet-002
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","filterConnector":"or","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_policy_id"},{"name":"common_action"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"ssl_sni"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_c2s_pkt_num","expression":"sum","label":"Packets Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_pkt_num","expression":"sum","label":"Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num","expression":"sum","label":"Bytes Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_byte_num","expression":"sum","label":"Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_policy_id","expression":"","label":"Policy ID"},{"name":"common_action","expression":"","label":"Action"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"ssl_sni","expression":"","label":"SNI"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_policy_id","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_action","expression":"=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_c2s_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_c2s_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_content_type","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"ssl_sni","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_pinningst","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"ssl_intercept_state","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
Proxy_Event_Dataset-003
|
||||
#新建Proxy_Event_Dataset(所有可以选择的项都添加到dataset中,Filter选择All)
|
||||
${name} Set Variable Proxy_Event_Dataset-003
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"proxy_event_log","filterConnector":"and","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_policy_id"},{"name":"common_sub_action"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"http_url"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_policy_id","expression":"","label":"Policy ID"},{"name":"common_sub_action","expression":"","label":"Sub Action"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"http_url","expression":"","label":"URL"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_policy_id","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_sub_action","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_url","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_content_type","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"}]}} #根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
Proxy_Event_Dataset-004
|
||||
#新建Proxy_Event_Dataset(所有可以选择的项都添加到dataset中,Filter选择Any of the Following Conditions)
|
||||
${name} Set Variable Proxy_Event_Dataset-004
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"proxy_event_log","filterConnector":"or","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_policy_id"},{"name":"common_sub_action"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"http_url"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_policy_id","expression":"","label":"Policy ID"},{"name":"common_sub_action","expression":"","label":"Sub Action"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"http_url","expression":"","label":"URL"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_policy_id","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_sub_action","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_url","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_content_type","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"}]}} #根据name查询出该Dataset的id
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
Session_Records_Dataset-005
|
||||
#新建Session_Records_Dataset(所有可以选择的项都添加到dataset中,Filter选择All)
|
||||
${name} Set Variable Session_Records_Dataset-005
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_c2s_pkt_num","expression":"sum","label":"Packets Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_pkt_num","expression":"sum","label":"Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num","expression":"sum","label":"Bytes Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_byte_num","expression":"sum","label":"Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_c2s_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_c2s_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_sni","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_pinningst","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"ssl_intercept_state","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}} #根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
Session_Records_Dataset-006
|
||||
#新建Session_Records_Dataset(所有可以选择的项都添加到dataset中,Filter选择Any of the Following Conditions)
|
||||
${name} Set Variable Session_Records_Dataset-006
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"or","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_c2s_pkt_num","expression":"sum","label":"Packets Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_pkt_num","expression":"sum","label":"Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num","expression":"sum","label":"Bytes Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_byte_num","expression":"sum","label":"Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_c2s_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_c2s_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_sni","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_pinningst","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"ssl_intercept_state","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}} #根据name查询出该Dataset的id
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
Radius_Dataset-007
|
||||
#新建Radius_Dataset(所有可以选择的项都添加到dataset中,Filter选择All)
|
||||
${name} Set Variable Radius_Dataset-007
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"radius_record_log","filterConnector":"and","groupColumnList":[{"name":"radius_nas_ip"},{"name":"radius_framed_ip"},{"name":"common_subscriber_id"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"radius_event_timestamp","expression":"min","label":"Event Timestamp","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"radius_nas_ip","expression":"","label":"Nas IP"},{"name":"radius_framed_ip","expression":"","label":"Framed IP"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"radius_framed_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"radius_packet_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"radius_acct_session_id","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"radius_acct_multi_session_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"radius_acct_status_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}} #根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
Radius_Dataset-008
|
||||
#新建Radius_Dataset(所有可以选择的项都添加到dataset中,Filter选择Any of the Following Conditions)
|
||||
${name} Set Variable Radius_Dataset-008
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"radius_record_log","filterConnector":"or","groupColumnList":[{"name":"radius_nas_ip"},{"name":"radius_framed_ip"},{"name":"common_subscriber_id"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"radius_event_timestamp","expression":"min","label":"Event Timestamp","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"radius_nas_ip","expression":"","label":"Nas IP"},{"name":"radius_framed_ip","expression":"","label":"Framed IP"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"radius_framed_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"radius_packet_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"radius_acct_session_id","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"radius_acct_multi_session_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"radius_acct_status_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}} #根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
54
01-TestCase/tsg_bfapi/offline_stat_report/DataSetEdit.robot
Normal file
54
01-TestCase/tsg_bfapi/offline_stat_report/DataSetEdit.robot
Normal file
@@ -0,0 +1,54 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${reportId} ${report_url} ${chartId} ${chart_url} ${datasetId} ${dataset_url} ${resultId} ${result_url}
|
||||
Force Tags tsg_bf_api dataset_create report
|
||||
Library OperatingSystem
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/offline_stat_report/ApiRequest1.robot
|
||||
|
||||
*** Variables ***
|
||||
${dataset_url} /report/dataset
|
||||
${datasetId} ${EMPTY}
|
||||
${reportId} ${EMPTY}
|
||||
${report_url} /report/offlinejob
|
||||
${chartId} ${EMPTY}
|
||||
${chart_url} /report/chart
|
||||
${result_url} /report/offlinejob/result
|
||||
${resultId} ${EMPTY}
|
||||
*** Test Cases ***
|
||||
Security _Event_Dataset_Edit-001
|
||||
#新建Security_Even_Logs_DataSet(所有可以选择的项都添加到dataset中,Filter选择Any of the Following Conditions)
|
||||
${name} Set Variable Security _Event_Dataset_Edit-001
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","filterConnector":"or","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_policy_id"},{"name":"common_action"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"ssl_sni"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_c2s_pkt_num","expression":"sum","label":"Packets Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_pkt_num","expression":"sum","label":"Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num","expression":"sum","label":"Bytes Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_byte_num","expression":"sum","label":"Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_policy_id","expression":"","label":"Policy ID"},{"name":"common_action","expression":"","label":"Action"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"ssl_sni","expression":"","label":"SNI"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_policy_id","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_action","expression":"=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_c2s_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_c2s_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_content_type","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"ssl_sni","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_pinningst","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"ssl_intercept_state","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${dataset_url} {"list":{"id":${datasetId},"isInitialize":0,"name":"${name}","logType":"security_event_log","filterConnector":"or","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_policy_id"},{"name":"common_action"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"ssl_sni"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_c2s_pkt_num","expression":"sum","label":"Packets Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_pkt_num","expression":"sum","label":"Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num","expression":"sum","label":"Bytes Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_byte_num","expression":"sum","label":"Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_policy_id","expression":"","label":"Policy ID"},{"name":"common_action","expression":"","label":"Action"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"ssl_sni","expression":"","label":"SNI"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_policy_id","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_action","expression":"=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_c2s_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_c2s_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_content_type","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"ssl_sni","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_pinningst","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"ssl_intercept_state","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}}
|
||||
Proxy_Event_Dataset_Edit-002
|
||||
#新建Proxy_Event_Dataset(所有可以选择的项都添加到dataset中,Filter选择Any of the Following Conditions)
|
||||
${name} Set Variable Proxy_Event_Dataset_Edit-002
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"proxy_event_log","filterConnector":"or","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_policy_id"},{"name":"common_sub_action"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"http_url"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_policy_id","expression":"","label":"Policy ID"},{"name":"common_sub_action","expression":"","label":"Sub Action"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"http_url","expression":"","label":"URL"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_policy_id","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_sub_action","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_url","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_content_type","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"}]}} #根据name查询出该Dataset的id
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${dataset_url} {"list":{"id":${datasetId},"isInitialize":0,"name":"${name}","logType":"proxy_event_log","filterConnector":"and","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_policy_id"},{"name":"common_sub_action"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"http_url"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_policy_id","expression":"","label":"Policy ID"},{"name":"common_sub_action","expression":"","label":"Sub Action"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"http_url","expression":"","label":"URL"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_policy_id","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_sub_action","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_url","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"http_content_type","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"}]}}
|
||||
Session_Records_Dataset-003
|
||||
#新建Session_Records_Dataset(所有可以选择的项都添加到dataset中,Filter选择Any of the Following Conditions)
|
||||
${name} Set Variable Session_Records_Dataset-Edit-003
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"or","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_c2s_pkt_num","expression":"sum","label":"Packets Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_pkt_num","expression":"sum","label":"Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num","expression":"sum","label":"Bytes Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_byte_num","expression":"sum","label":"Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_c2s_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_c2s_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_sni","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_pinningst","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"ssl_intercept_state","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${dataset_url} {"list":{"id":${datasetId},"isInitialize":0,"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_server_ip"},{"name":"common_client_ip"},{"name":"common_sled_ip"},{"name":"common_server_location"},{"name":"common_subscriber_id"},{"name":"http_domain"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_c2s_pkt_num","expression":"sum","label":"Packets Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_pkt_num","expression":"sum","label":"Packets Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_c2s_byte_num","expression":"sum","label":"Bytes Sent","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_s2c_byte_num","expression":"sum","label":"Bytes Received","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"","label":"Server IP"},{"name":"common_client_ip","expression":"","label":"Client IP"},{"name":"common_sled_ip","expression":"","label":"Sled IP"},{"name":"common_server_location","expression":"","label":"Server Location"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"http_domain","expression":"","label":"Domain"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"},{"name":"common_server_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_client_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_server_port","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_server_location","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_c2s_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_pkt_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_c2s_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"common_s2c_byte_num","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"http_domain","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_sni","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"ssl_pinningst","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"ssl_intercept_state","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}} #根据name查询出该Dataset的id
|
||||
Radius_Dataset-004
|
||||
#新建Radius_Dataset(所有可以选择的项都添加到dataset中,Filter选择Any of the Following Conditions)
|
||||
${name} Set Variable Radius_Dataset-Edit-003
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"radius_record_log","filterConnector":"or","groupColumnList":[{"name":"radius_nas_ip"},{"name":"radius_framed_ip"},{"name":"common_subscriber_id"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"radius_event_timestamp","expression":"min","label":"Event Timestamp","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"radius_nas_ip","expression":"","label":"Nas IP"},{"name":"radius_framed_ip","expression":"","label":"Framed IP"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"radius_framed_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"radius_packet_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"radius_acct_session_id","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"radius_acct_multi_session_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"radius_acct_status_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据id进行对该Dataset的修改
|
||||
Put-Request ${dataset_url} {"list":{"id":${datasetId},"isInitialize":0,"name":"${name}","logType":"radius_record_log","filterConnector":"and","groupColumnList":[{"name":"radius_nas_ip"},{"name":"radius_framed_ip"},{"name":"common_subscriber_id"},{"name":"common_recv_time"}],"queryColumnList":[{"name":"radius_event_timestamp","expression":"min","label":"Event Timestamp","expressionList":[{"label":"sum","value":"sum"},{"label":"min","value":"min"},{"label":"max","value":"max"},{"label":"avg","value":"avg"},{"label":"count","value":"count"}]},{"name":"radius_nas_ip","expression":"","label":"Nas IP"},{"name":"radius_framed_ip","expression":"","label":"Framed IP"},{"name":"common_subscriber_id","expression":"","label":"Subscriber ID"},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[{"name":"radius_framed_ip","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"common_subscriber_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"radius_packet_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"},{"name":"radius_acct_session_id","expression":"notEmpty","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":[],"type":"string"},{"name":"radius_acct_multi_session_id","expression":"!=","expressionList":["=","!=","Prefix","Suffix","Sub","notEmpty"],"value":["0"],"type":"string"},{"name":"radius_acct_status_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[0],"type":"int"}]}}
|
||||
|
||||
136
01-TestCase/tsg_bfapi/offline_stat_report/ReportCreate.robot
Normal file
136
01-TestCase/tsg_bfapi/offline_stat_report/ReportCreate.robot
Normal file
@@ -0,0 +1,136 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${reportId} ${report_url} ${chartId} ${chart_url} ${datasetId} ${dataset_url} ${resultId} ${result_url}
|
||||
Force Tags tsg_bf_api chartlibrary_create report
|
||||
Library OperatingSystem
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/offline_stat_report/ApiRequest1.robot
|
||||
|
||||
*** Variables ***
|
||||
${dataset_url} /report/dataset
|
||||
${datasetId} ${EMPTY}
|
||||
${reportId} ${EMPTY}
|
||||
${report_url} /report/offlinejob
|
||||
${chartId} ${EMPTY}
|
||||
${chart_url} /report/chart
|
||||
${result_url} /report/offlinejob/result
|
||||
${resultId} ${EMPTY}
|
||||
*** Test Cases ***
|
||||
Report_Create_Today_Line-001
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Create_Today_Line-001
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Lien图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"line","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Client IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为Today,图表引用Line。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"last","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"minute"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
Report_Create_Yesterday_Area-002
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Create_Yesterday_Area-002
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"proxy_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Area图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"area","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Client IP","type":"Line Down","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为yesterday,图表引用Area。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":5,"timeUnit":"hour","disabled":false}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
|
||||
Report_Create_This_Pie-003
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Create_This_Pie-003
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Pie图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"pie","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为This,图表引用Pie。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"this","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"week"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
|
||||
Report_Create_Last_Bra-004
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Create_Last_Bra-004
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Bra图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"bar","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为last,图表引用Bra。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"last","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"day"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
|
||||
Report_Create_Customize_Table-005
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Create_Customize_Table-005
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,普通
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为customize,图表引用Table。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"customize","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"2020-06-15 00:00:00","endTime":"2020-06-17 00:00:00","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
|
||||
Report_Create_Mail-006
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Create_Mail-006
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,下钻
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为this,图表引用Table。发送邮件
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"this","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":1,"noticeMethod":1,"receiver":"check@test.com","startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"day"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
|
||||
Report_Create_Ftp-007
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Create_Ftp-007
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,下钻
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为this,图表引用Table。发送邮件
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":1,"noticeMethod":2,"receiver":[{"server":"192.168.40.204","port":"21","user":"wxs","password":"111111","directory":"/"}],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
|
||||
154
01-TestCase/tsg_bfapi/offline_stat_report/ReportEdit.robot
Normal file
154
01-TestCase/tsg_bfapi/offline_stat_report/ReportEdit.robot
Normal file
@@ -0,0 +1,154 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${reportId} ${report_url} ${chartId} ${chart_url} ${datasetId} ${dataset_url} ${resultId} ${result_url}
|
||||
Force Tags tsg_bf_api chartlibrary_create report
|
||||
Library OperatingSystem
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/offline_stat_report/ApiRequest1.robot
|
||||
|
||||
*** Variables ***
|
||||
${dataset_url} /report/dataset
|
||||
${datasetId} ${EMPTY}
|
||||
${reportId} ${EMPTY}
|
||||
${report_url} /report/offlinejob
|
||||
${chartId} ${EMPTY}
|
||||
${chart_url} /report/chart
|
||||
${result_url} /report/offlinejob/result
|
||||
${resultId} ${EMPTY}
|
||||
*** Test Cases ***
|
||||
Report_Edit_Today_Line-001
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Edit_Today_Line-001
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Lien图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"line","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Client IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为Today,图表引用Line。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"last","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"minute"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#根据查询出的Report的id对该report进行修改
|
||||
Post-Request ${report_url} {"reportJobList":{"jobId":${reportId},"rangeType":"last","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"minute"}}
|
||||
|
||||
|
||||
|
||||
Report_Edit_Yesterday_Area-002
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Edit_Yesterday_Area-002
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"proxy_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Area图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"area","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Client IP","type":"Line Down","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为yesterday,图表引用Area。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":5,"timeUnit":"hour","disabled":false}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#根据查询出的Report的id对该report进行修改
|
||||
Post-Request ${report_url} {"reportJobList":{"jobId":${reportId},"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":5,"timeUnit":"hour","disabled":false}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[]}}
|
||||
|
||||
Report_Edit_This_Pie-003
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Edit_This_Pie-003
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Pie图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"pie","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为This,图表引用Pie。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"this","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"week"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#根据查询出的Report的id对该report进行修改
|
||||
Post-Request ${report_url} {"reportJobList":{"jobId":${reportId},"rangeType":"this","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"week"}}
|
||||
|
||||
Report_Edit_Last_Bra-004
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Edit_Last_Bra-004
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Bra图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"bar","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为last,图表引用Bra。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"last","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"day"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#根据查询出的Report的id对该report进行修改
|
||||
Post-Request ${report_url} {"reportJobList":{"jobId":${reportId},"rangeType":"last","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"day"}}
|
||||
|
||||
|
||||
|
||||
Report_Edit_Customize_Table-005
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Edit_Customize_Table-005
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,普通
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为customize,图表引用Table。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"customize","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"2020-06-15 00:00:00","endTime":"2020-06-17 00:00:00","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#根据查询出的Report的id对该report进行修改
|
||||
Post-Request ${report_url} {"reportJobList":{"jobId":${reportId},"rangeType":"customize","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"2020-06-15 00:00:00","endTime":"2020-06-17 00:00:00","filterConnector":"and","filterCondition":[]}}
|
||||
|
||||
Report_Edit_Mail-006
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Edit_Mail-006
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,下钻
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为this,图表引用Table。发送邮件
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"this","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":1,"noticeMethod":1,"receiver":"check@test.com","startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"day"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#根据查询出的Report的id对该report进行修改
|
||||
Post-Request ${report_url} {"reportJobList":{"jobId":${reportId},"rangeType":"this","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":1,"noticeMethod":1,"receiver":"check@test.com","startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"day"}}
|
||||
|
||||
Report_Edit_Ftp-007
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Edit_Ftp-007
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,下钻
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为this,图表引用Table。发送邮件
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":1,"noticeMethod":2,"receiver":[{"server":"192.168.40.204","port":"21","user":"wxs","password":"111111","directory":"/"}],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#根据查询出的Report的id对该report进行修改
|
||||
Post-Request ${report_url} {"reportJobList":{"jobId":${reportId},"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":1,"noticeMethod":2,"receiver":[{"server":"192.168.40.204","port":"21","user":"wxs","password":"111111","directory":"/"}],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[]}}
|
||||
235
01-TestCase/tsg_bfapi/offline_stat_report/ReportResult.robot
Normal file
235
01-TestCase/tsg_bfapi/offline_stat_report/ReportResult.robot
Normal file
@@ -0,0 +1,235 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${reportId} ${report_url} ${chartId} ${chart_url} ${datasetId} ${dataset_url} ${resultId} ${result_url}
|
||||
Force Tags tsg_bf_api chartlibrary_create report
|
||||
Library OperatingSystem
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../../02-Keyword/tsg_bfapi/offline_stat_report/ApiRequest1.robot
|
||||
|
||||
*** Variables ***
|
||||
${dataset_url} /report/dataset
|
||||
${datasetId} ${EMPTY}
|
||||
${reportId} ${EMPTY}
|
||||
${report_url} /report/offlinejob
|
||||
${chartId} ${EMPTY}
|
||||
${chart_url} /report/chart
|
||||
${result_url} /report/offlinejob/result
|
||||
${resultId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Report_Result-001
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Result-001
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"security_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Lien图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"line","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Client IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为Today,图表引用Line。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"last","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"minute"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#查询Report结果的状态,并判断状态结果,如果状态是执行成功,查看report结果内容
|
||||
FOR ${i} IN RANGE 50
|
||||
sleep 10
|
||||
#report执行状态查询
|
||||
${response1} Get-Request ${result_url}?jobId=${reportId}
|
||||
${status} Set Variable ${response1}[data][list][0][status]
|
||||
${resultId} Set Variable ${response1}[data][list][0][resultId]
|
||||
run keyword if "${status}"=="0" log non-execution
|
||||
... ELSE IF "${status}"=="1" log executing
|
||||
... ELSE IF "${status}"=="2" Exit For Loop
|
||||
... ELSE log Exec failure
|
||||
END
|
||||
#Report报表详情查询
|
||||
${response1} Get-Request ${result_url}?resultId=${resultId}&jobId=${reportId}
|
||||
|
||||
Report_Result-002
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Result-002
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"proxy_event_log","filterConnector":"and","groupColumnList":[{"name":"common_recv_time"}],"queryColumnList":[{"name":"common_server_ip","expression":"count","label":"Server IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_client_ip","expression":"count","label":"Client IP","expressionList":[{"label":"count","value":"count"},{"label":"Count Distinct","value":"count_distinct"}]},{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_recv_time","expression":"","label":"Receive Time"}],"filterConditionList":[]}}
|
||||
#根据name查询出该Dataset的id
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Area图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"area","dataTop":0,"orderBy":"","orderDesc":1,"drilldownTop":0,"includeOther":false,"timeline":{"dataBinding":"Receive Time","label":"","format":"Time"},"line":[{"dataBinding":"Server IP","type":"Line Up","format":"Default","legend":""},{"dataBinding":"Client IP","type":"Line Down","format":"Default","legend":""},{"dataBinding":"sessions","type":"Line Up","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为yesterday,图表引用Area。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":5,"timeUnit":"hour","disabled":false}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#查询Report结果的状态,并判断状态结果,如果状态是执行成功,查看report结果内容
|
||||
FOR ${i} IN RANGE 50
|
||||
sleep 10
|
||||
#report执行状态查询
|
||||
${response1} Get-Request ${result_url}?jobId=${reportId}
|
||||
${status} Set Variable ${response1}[data][list][0][status]
|
||||
${resultId} Set Variable ${response1}[data][list][0][resultId]
|
||||
run keyword if "${status}"=="0" log non-execution
|
||||
... ELSE IF "${status}"=="1" log executing
|
||||
... ELSE IF "${status}"=="2" Exit For Loop
|
||||
... ELSE log Exec failure
|
||||
END
|
||||
#Report报表详情查询
|
||||
${response1} Get-Request ${result_url}?resultId=${resultId}&jobId=${reportId}
|
||||
|
||||
Report_Result-003
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Result-003
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Pie图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"pie","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为This,图表引用Pie。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"week"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#查询Report结果的状态,并判断状态结果,如果状态是执行成功,查看report结果内容
|
||||
FOR ${i} IN RANGE 50
|
||||
sleep 10
|
||||
#report执行状态查询
|
||||
${response1} Get-Request ${result_url}?jobId=${reportId}
|
||||
${status} Set Variable ${response1}[data][list][0][status]
|
||||
${resultId} Set Variable ${response1}[data][list][0][resultId]
|
||||
run keyword if "${status}"=="0" log non-execution
|
||||
... ELSE IF "${status}"=="1" log executing
|
||||
... ELSE IF "${status}"=="2" Exit For Loop
|
||||
... ELSE log Exec failure
|
||||
END
|
||||
#Report报表详情查询
|
||||
${response1} Get-Request ${result_url}?resultId=${resultId}&jobId=${reportId}
|
||||
|
||||
Report_Result-004
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Result-004
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,Bra图形表
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"bar","dataTop":0,"orderBy":"","orderDesc":"","includeOther":true,"xAxis":{"dataBinding":"Client IP","label":"Client IP","dataTop":5,"dataType":""},"yAxis":[{"dataBinding":"sessions","format":"Default","legend":""}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为last,图表引用Bra。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"last","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"day"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#查询Report结果的状态,并判断状态结果,如果状态是执行成功,查看report结果内容
|
||||
FOR ${i} IN RANGE 50
|
||||
sleep 10
|
||||
#report执行状态查询
|
||||
${response1} Get-Request ${result_url}?jobId=${reportId}
|
||||
${status} Set Variable ${response1}[data][list][0][status]
|
||||
${resultId} Set Variable ${response1}[data][list][0][resultId]
|
||||
run keyword if "${status}"=="0" log non-execution
|
||||
... ELSE IF "${status}"=="1" log executing
|
||||
... ELSE IF "${status}"=="2" Exit For Loop
|
||||
... ELSE log Exec failure
|
||||
END
|
||||
#Report报表详情查询
|
||||
${response1} Get-Request ${result_url}?resultId=${resultId}&jobId=${reportId}
|
||||
|
||||
Report_Result-005
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Result-005
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,普通
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为customize,图表引用Table。
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"customize","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":0,"noticeMethod":"","receiver":[],"startTime":"2020-06-15 00:00:00","endTime":"2020-06-17 00:00:00","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#查询Report结果的状态,并判断状态结果,如果状态是执行成功,查看report结果内容
|
||||
FOR ${i} IN RANGE 50
|
||||
sleep 10
|
||||
#report执行状态查询
|
||||
${response1} Get-Request ${result_url}?jobId=${reportId}
|
||||
${status} Set Variable ${response1}[data][list][0][status]
|
||||
${resultId} Set Variable ${response1}[data][list][0][resultId]
|
||||
run keyword if "${status}"=="0" log non-execution
|
||||
... ELSE IF "${status}"=="1" log executing
|
||||
... ELSE IF "${status}"=="2" Exit For Loop
|
||||
... ELSE log Exec failure
|
||||
END
|
||||
#Report报表详情查询
|
||||
${response1} Get-Request ${result_url}?resultId=${resultId}&jobId=${reportId}
|
||||
|
||||
Report_Result-006
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Result-006
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,下钻
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为this,图表引用Table。发送邮件
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":1,"noticeMethod":1,"receiver":"check@test.com","startTime":"","endTime":"","filterConnector":"and","filterCondition":[],"rangeUnit":"day"}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#查询Report结果的状态,并判断状态结果,如果状态是执行成功,查看report结果内容
|
||||
FOR ${i} IN RANGE 50
|
||||
sleep 10
|
||||
#report执行状态查询
|
||||
${response1} Get-Request ${result_url}?jobId=${reportId}
|
||||
${status} Set Variable ${response1}[data][list][0][status]
|
||||
${resultId} Set Variable ${response1}[data][list][0][resultId]
|
||||
run keyword if "${status}"=="0" log non-execution
|
||||
... ELSE IF "${status}"=="1" log executing
|
||||
... ELSE IF "${status}"=="2" Exit For Loop
|
||||
... ELSE log Exec failure
|
||||
END
|
||||
#Report报表详情查询
|
||||
${response1} Get-Request ${result_url}?resultId=${resultId}&jobId=${reportId}
|
||||
|
||||
Report_Result-007
|
||||
#新建DataSet
|
||||
${name} Set Variable Report_Result-007
|
||||
Post-Request ${dataset_url} {"list":{"name":"${name}","logType":"connection_record_log","filterConnector":"and","groupColumnList":[{"name":"common_client_ip"}],"queryColumnList":[{"name":"common_log_id","expression":"count","label":"sessions","expressionList":[]},{"name":"common_client_ip","expression":"","label":"Client IP"}],"filterConditionList":[{"name":"common_address_type","expression":"!=","expressionList":["=","!=",">","<",">=","<="],"value":[6],"type":"int"}]}}
|
||||
${response} Get-Request ${dataset_url}?pageSize=20&pageNo=1&id=&name=${name}&logType=&opStartTime=&opEndTime=&opUser=
|
||||
${datasetId} Set Variable ${response}[data][list][0][id]
|
||||
#根据DataSet的id,新建Chart,tableb表,下钻
|
||||
Post-Request ${chart_url} {"list":{"id":null,"name":"${name}","description":"","datasetId":${datasetId},"chartType":"table","dataTop":10,"orderBy":"sessions","orderDesc":0,"drilldownTop":null,"includeOther":false,"tableType":"Regular","columns":[{"title":"Client IP","width":20,"dataBindings":[{"dataType":false,"dataBinding":"Client IP","format":"Default","legend":"","name":"common_client_ip"}]},{"title":"sessions","width":20,"dataBindings":[{"dataType":false,"dataBinding":"sessions","format":"Default","legend":"","name":"common_log_id"}]}]}}
|
||||
#根据name查询出该Chart的id
|
||||
${response1} Get-Request ${chart_url}?pageSize=20&pageNo=1&id=&name=${name}&opUser=
|
||||
${chartId} Set Variable ${response1}[data][list][0][id]
|
||||
#新建Report,时间计划为this,图表引用Table。发送邮件
|
||||
Post-Request ${report_url} {"reportJobList":{"rangeType":"yesterday","rangeInterval":1,"jobName":"${name}","scheduleId":"","chartList":[{"chartId":${chartId},"timeGranulartiy":1,"timeUnit":"","disabled":true}],"isNotice":1,"noticeMethod":2,"receiver":[{"server":"192.168.40.204","port":"21","user":"wxs","password":"111111","directory":"/"}],"startTime":"","endTime":"","filterConnector":"and","filterCondition":[]}}
|
||||
#查询Report的id
|
||||
${response1} Get-Request ${report_url}?pageSize=20&pageNo=1&jobIds=&jobName=${name}&opStartTime=&opEndTime=&opUser=&scheduleId=
|
||||
${reportId} Set Variable ${response1}[data][list][0][jobId]
|
||||
#查询Report结果的状态,并判断状态结果,如果状态是执行成功,查看report结果内容
|
||||
FOR ${i} IN RANGE 50
|
||||
sleep 10
|
||||
#report执行状态查询
|
||||
${response1} Get-Request ${result_url}?jobId=${reportId}
|
||||
${status} Set Variable ${response1}[data][list][0][status]
|
||||
${resultId} Set Variable ${response1}[data][list][0][resultId]
|
||||
run keyword if "${status}"=="0" log non-execution
|
||||
... ELSE IF "${status}"=="1" log executing
|
||||
... ELSE IF "${status}"=="2" Exit For Loop
|
||||
... ELSE log Exec failure
|
||||
END
|
||||
#Report报表详情查询
|
||||
${response1} Get-Request ${result_url}?resultId=${resultId}&jobId=${reportId}
|
||||
@@ -1,50 +0,0 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_bf_api Clear_All_Policys
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url1} /policy/profile/keyringobj
|
||||
${url2} /policy/profile/trustedcacertobj
|
||||
${url3} /policy/profile/responsepages
|
||||
${url4} /policy/profile/hijackfiles
|
||||
${url5} /policy/profile/insertscripts
|
||||
${url6} /policy/profile/trafficmirror
|
||||
|
||||
*** Test Cases ***
|
||||
Keyring Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url1} ${reqData}
|
||||
|
||||
Trusted Cert Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url2} ${reqData}
|
||||
|
||||
Response Pages Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url3} ${reqData}
|
||||
|
||||
Hijack Files Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url4} ${reqData}
|
||||
|
||||
Insert Scripts Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url5} ${reqData}
|
||||
|
||||
Traffic Mirror Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url6} ${reqData}
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Response_Pages
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/decryption
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Decryption_ADD_001
|
||||
|
||||
Comment 全串{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{"dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1},"protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1},"certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
|
||||
Comment "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
Comment "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
|
||||
Comment dynamic_bypass
|
||||
Comment 拦截排除参数对象
|
||||
Comment ev_cert Integer 是 ON/OFF,缺省OFF,1表示ON,0表示OFF
|
||||
Comment cert_transparency Integer 是 ON/OFF,缺省OFF,1表示ON,0表示OFF
|
||||
Comment mutual_authentication Integer 是 ON/OFF,缺省ON,1表示ON,0表示OFF
|
||||
Comment cert_pinning Integer 是 Blocl/Bypass,缺省Block,1表示Block,0表示Bypass
|
||||
Comment protocol_errors Integer 是 ON/OFF,缺省ON,1表示ON,0表示OFF
|
||||
Comment protocol_version Object 是 协议版本对象
|
||||
Comment min Integer 否 如果mirror_client=1,则此参数可为空
|
||||
Comment max Integer 否 如果mirror_client=1,则此参数可为空
|
||||
Comment mirror_client Integer 是 ON/OFF,缺省ON,1表示ON,0表示OFF
|
||||
Comment allow_http2 Integer 是 1表示ON,0表示OFF
|
||||
Comment certificate_checks Object 是 证书检查参数对象
|
||||
Comment approachObject 是 certificateChecksObj对象参数
|
||||
Comment cn Integer 是 approach对象参数,ON/OFF,缺省ON, 1表示ON,0表示OFF
|
||||
Comment issuer Integer 是 approach对象参数,ON/OFF,缺省ON, 1表示ON,0表示OFF
|
||||
Comment self-signed Integer 是 approach对象参数, ON/OFF,缺省ON, 1表示ON,0表示OFF
|
||||
Comment expiration Integer 是 approach对象参数,ON/OFF,缺省ON, 1表示ON,0表示OFF
|
||||
Comment fail_action String 是 certificateChecksObj对象参数,值为: fail-close pass-through
|
||||
Comment isValid Integer 是 是否有效
|
||||
Comment isInitialize Integer 否 0:非内置,缺省 1:内置
|
||||
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
|
||||
${data} Create List ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
|
||||
# 修改
|
||||
${dynamic_bypass}="dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":0,"cert_pinning":0,"protocol_errors":0}
|
||||
${protocol_version}="protocol_version":{"min":"ssl3","max":"tls13","mirror_client":0,"allow_http2":0}
|
||||
${certificate_checks}="certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"pass-through"}
|
||||
${requestbody}={"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_edit","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":0,"isInitialize":0,"profileDesc":""}]}
|
||||
@{data} set variable ${requestbody}
|
||||
UpdatePolicyFile2 ${url} ${reqData_edit} @{data}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Hijack_Files
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/hijackfiles
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Hijack Files Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile2 ${url} hijack_files/ Create-Hijack Files-test-3.html hijack
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} Hijack Files-files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
|
||||
|
||||
@@ -1,283 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_adc Security_Policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/hijackfiles
|
||||
${profileId} ${EMPTY}
|
||||
*** Keywords ***
|
||||
ProfileComman
|
||||
[Arguments] ${objectedit} ${type}
|
||||
${default_json} ${default_files} ${default_url} Run Keyword If "${type}"=="hijack" Set Variable ${setting_proxy_profiles_hijack} hijack_files/ /policy/profile/hijackfiles
|
||||
... ELSE IF Run Keyword If "${type}"=="insert" Set Variable ${setting_proxy_profiles_insert} insert_files/ /policy/profile/insertfiles
|
||||
... ELSE Set Variable a b c
|
||||
|
||||
${objectDict} Jsoneditmanu ${default_json} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${default_url} ${default_files} ${objectDict}
|
||||
[Return] ${response}
|
||||
*** Test Cases ***
|
||||
Hijack_file_24_type-test
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=Hijack_file_24_type-00000 contentName=Create-Hijack Files-test-0.apk contentType=application/vnd.android.package-archive
|
||||
${response} ProfileComman ${objectedit} hijack
|
||||
|
||||
Hijack_file_24_type-00000
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=Hijack_file_24_type-00000 contentName=Create-Hijack Files-test-0.apk contentType=application/vnd.android.package-archive
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00001
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-1.exe contentType=application/x-msdos-program
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00002
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-2.gif contentType=image/gif
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00003
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-3.html contentType=text/html
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00004
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-4.jpeg contentType=image/jpeg
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00005
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-5.png contentType=image/png
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00005-1
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-5.png contentType=application/x-png
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00006
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-6.svg contentType=image/svg%2Bxml
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00007
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-7.rpm contentType=audio/x-pn-realaudio-plugin
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00008
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-8.dmg contentType=application/x-apple-diskimage
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00009
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-9.js contentType=application/x-javascript
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00010
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-10.rar contentType=application/octet-stream
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00011
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-11.zip contentType=application/x-zip-compressed
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00012
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-12.doc contentType=application/msword
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00013
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-13.docx contentType=application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00014
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-14.json contentType=application/json
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00015
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-15.xml contentType=text/xml
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00016
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-16.pdf contentType=application/pdf
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00017
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-17.xls contentType=application/vnd.ms-excel
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00017-1
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-17.xls contentType=application/x-xls
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00018
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-18.xlsx contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00019
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-19.ppt contentType=application/vnd.ms-powerpoint
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00019-1
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-19.ppt contentType=application/x-ppt
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00020
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-20.pptx contentType=application/vnd.openxmlformats-officedocument.presentationml.presentation
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00021
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-21.odt contentType=application/vnd.oasis.opendocument.text
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00022
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-22.css contentType=text/css
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00023
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-23.csv contentType=text/comma-separated-values
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
|
||||
Hijack_file_24_type-00024
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-24.plain contentType=text/plain
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ ${objectDict}
|
||||
@@ -1,31 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Insert_Scripts
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/insertscripts
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Insert Scripts Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile2 ${url} insert_files/ Create-Insert Scripts-test-1.js insert
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
# 修改
|
||||
${reqHeader_edit} Set Variable {"isValid":1,"format":"css","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} Insert Scripts-files/ Create-Insert Scripts-test.css ${reqHeader_edit}
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_bf_api Cached_Intermediate_Certificates
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/exch/intermediacert
|
||||
|
||||
*** Test Cases ***
|
||||
Intermedia Cert Policy case
|
||||
|
||||
# 查询1
|
||||
${suffix_quary} Catenate SEPARATOR=& certId=269 sni=nationalbank.kz
|
||||
QueryPolicyFile ${url} ${suffix_quary}
|
||||
|
||||
# 查询2
|
||||
${suffix_quary} Catenate SEPARATOR=& certIds=263,265 sni=dw-online.ksosoft
|
||||
QueryPolicyFile ${url} ${suffix_quary}
|
||||
|
||||
# 启用/暂停
|
||||
${certId} QueryPolicyFile2 ${url} isValid=1
|
||||
${certIds} Create List ${certId}
|
||||
${data} Set Variable {"opAction":"disable","certIds":${certIds}}
|
||||
UpdatePolicyFile2 ${url} ${data}
|
||||
${data2} Set Variable {"opAction":"enable","certIds":${certIds}}
|
||||
UpdatePolicyFile2 ${url} ${data2}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} keyringIds ${keyringId}
|
||||
Force Tags tsg_bf_api Decryption_Keyrings
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/keyringobj
|
||||
${keyringId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Keyring Policy File case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/root/ mesalab-ca-cert.pem mesalab-ca-key.pem
|
||||
|
||||
# 查询
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
${keyringName} Get From Dictionary ${response} keyringName
|
||||
QueryPolicyFile ${url} keyringId=${keyringId}&keyringName=${keyringName}
|
||||
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"opAction":"update","returnData":1,"keyringName":"test_edit","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":"${keyringId}","includeRoot":0}
|
||||
UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Response_Pages
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/responsepages
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Response Pages Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile2 ${url} response_pages_files/ Create-Response Pages-test-1.html resPages
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"format":"html","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} Response pages-files/ Create-Response Pages-test.html ${header_edit}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_bf_api Traffic_Mirror_Profiles
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/trafficmirror
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Traffic Mirror Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile3 ${url}
|
||||
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
|
||||
# 修改
|
||||
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
|
||||
UpdatePolicyFile2 ${url} ${reqData_edit}
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} certIds ${certId}
|
||||
Force Tags tsg_bf_api Trusted_Certificate_Authorities
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/trustedcacertobj
|
||||
${certId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Trusted Cert Policy CRUD case
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile ${url} keyrings/root/ tango-ca-trust-ca-cer.pem
|
||||
|
||||
# 查询
|
||||
${certId} Get From Dictionary ${response} certId
|
||||
${certName} Get From Dictionary ${response} certName
|
||||
QueryPolicyFile ${url} certId=${certId}&certName=${certName}
|
||||
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"opAction":"update","certName":"test_edit","certId":"${certId}","returnData":1}
|
||||
UpdatePolicyFile ${url} Keyrings/Intermediate/ tang-ca-v3-intermediate-01-cer.pem ${header_edit}
|
||||
|
||||
255
01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot
Normal file
255
01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot
Normal file
@@ -0,0 +1,255 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObjectAndProfile ${policyIds} ${objectIds} ${profiles}
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_object/Policy.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
*** Variables ***
|
||||
@{profiles}
|
||||
*** Test Cases ***
|
||||
Policy-Get-v1-00001
|
||||
${policy} Create Dictionary policyType=tsg_security action=deny
|
||||
... pageNo=1 pageSize=10
|
||||
${rescode} ${response} QueryPolicies ${policy} v1
|
||||
${policyIds} Create List
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Log ${rescode} ${response}
|
||||
Policy-Get-v2-00001
|
||||
${policy} Create Dictionary policyType=tsg_security action=deny
|
||||
... pageNo=1 pageSize=10
|
||||
${rescode} ${response} QueryPolicies ${policy} v2
|
||||
${policyIds} Create List
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Log ${rescode} ${response}
|
||||
Policy-Post-v1-00001
|
||||
${policy} Create Dictionary policyId=1 policyType=tsg_security
|
||||
... policyName=wx-policyName1 action=allow doBlacklist=0
|
||||
... doLog=0 isValid=1 effectiveRange={}
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v1
|
||||
Log ${rescode} ${policyIds} ${objectIds}
|
||||
Policy-Post-v2-00001
|
||||
${policy} Create Dictionary policyId=1 policyType=tsg_security
|
||||
... policyName=wx-policyName1 action=allow doBlacklist=0
|
||||
... doLog=0 isValid=1 effectiveRange={}
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
|
||||
Log ${rescode} ${policyIds} ${objectIds}
|
||||
Policy-Post-v1-00002
|
||||
${policy} Create Dictionary policyId=1 policyType=tsg_security
|
||||
... policyName=wx-policyName1 action=allow doBlacklist=0
|
||||
... doLog=0 isValid=1 effectiveRange={}
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
|
||||
${policy1} Create Dictionary policyId=2 policyType=tsg_security
|
||||
... policyName=wx-policyName2 action=allow doBlacklist=0
|
||||
... doLog=0 isValid=1
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
|
||||
${policy2} Create Dictionary policyId=3 policyType=tsg_security
|
||||
... policyName=wx-policyName3 action=allow doBlacklist=0
|
||||
... doLog=0 isValid=0
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
@{policyList} Create List ${policy} ${policy1} ${policy2}
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policyList} v1
|
||||
Log ${rescode} ${policyIds} ${objectIds}
|
||||
Policy-Post-v2-00002
|
||||
${policy} Create Dictionary policyId=1 policyType=tsg_security
|
||||
... policyName=wx-policyName1 action=allow doBlacklist=0
|
||||
... doLog=0 isValid=1 effectiveRange={}
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
|
||||
${policy1} Create Dictionary policyId=2 policyType=tsg_security
|
||||
... policyName=wx-policyName2 action=allow doBlacklist=0
|
||||
... doLog=0 isValid=1
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
|
||||
${policy2} Create Dictionary policyId=3 policyType=tsg_security
|
||||
... policyName=wx-policyName3 action=allow doBlacklist=0
|
||||
... doLog=0 isValid=0
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
@{policyList} Create List ${policy} ${policy1} ${policy2}
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policyList} v2
|
||||
Log ${rescode} ${policyIds} ${objectIds}
|
||||
Policy-Post-v1-00003
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*baidu.com
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId}
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_SecurityPolicy-v1-00003 policyType=tsg_security
|
||||
... policyDesc=autotest userTags=
|
||||
... action=deny effectiveRange={}
|
||||
... userRegion={"protocol":"SSL","method":"drop"}
|
||||
... referenceObject=${objectId}|TSG_FIELD_SSL_CN&TSG_FIELD_SSL_SAN
|
||||
... isValid=${1} appObjectIdArray=3
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v1
|
||||
Log ${rescode} ${policyIds} ${objectIds}
|
||||
Policy-Post-v2-00004
|
||||
#${testClentID} ${testClentSubID}
|
||||
Comment 创建fqdn
|
||||
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*baidu.com
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId}
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_SecurityPolicy-v2-00004 policyType=tsg_security
|
||||
... policyDesc=autotest
|
||||
... action=deny #effectiveRange={}
|
||||
... userRegion={"protocol":"SSL","method":"drop"}
|
||||
... filterList=${objectId}:TSG_FIELD_SSL_CN
|
||||
... isValid=${1} appIdObjects=3
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
|
||||
Log ${rescode} ${policyIds} ${objectIds}
|
||||
Policy-Post-v2-00005
|
||||
Comment 创建IP
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1}
|
||||
... isInitialize=0
|
||||
... addItemList=range|192.168.41.68|192.168.41.68|0/0
|
||||
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId1}
|
||||
Log To Console Create IP Object
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com
|
||||
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId2},${objectIds}
|
||||
Log To Console Create url Object
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_SecurityPolicy-v2-00005 policyType=tsg_security
|
||||
... policyDesc=wx-autotest
|
||||
... action=deny effectiveRange={}
|
||||
... userRegion={"protocol":"HTTP","method":"drop"}
|
||||
... source=${objectId1}|TSG_SECURITY_SOURCE_ADDR
|
||||
... destination=${objectId2}|TSG_FIELD_HTTP_URL
|
||||
... isValid=${1} appIdObjects=2
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
|
||||
Log ${rescode} ${policyIds} ${objectIds}
|
||||
Policy-Post-v2-00006
|
||||
[Tags] reflection
|
||||
${caseName} set variable WX_ActiveDefencePolicy-Reflection-V2-00006
|
||||
${target_ip} set variable 10.3.22.139
|
||||
Comment claimed_src_ip_profile_id
|
||||
${response} BasePostRequest /v1/policy/profile/reflector body={"opAction":"add","returnData":1,"reflectorList":[{"profileName":"autotest","addrType":4,"ipList":["10.3.22.11"],"reflectorType":"dns","isValid":1,"profileDesc":"autotest"}]}
|
||||
${reflector_profile_id} Set Variable ${response['data']['list'][0]['profileId']}
|
||||
${response} BasePostRequest /v1/policy/profile/reflector/payload body={"opAction":"add","returnData":1,"reflectorList":[{"profileName":"autotest","reflectorType":"dns","payload":"zasBAAABAAAAAAAABHRlc3QDY29tAAD/AAE=","isValid":1,"profileDesc":""}]}
|
||||
#${response} BasePostRequest /policy/profile/reflector/payload body={"opAction":"add","returnData":1,"reflectorList":[{"profileName":"autotest","reflectorPayload":"dns","payload":"zasBAAABAAAAAAAABHRlc3QDY29tAAD/AAE=","isValid":1,"profileDesc":""}]}
|
||||
${payload_profile_id} Set Variable ${response['data']['list'][0]['profileId']}
|
||||
Comment 创建策略reflection
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=active_defence
|
||||
... policyDesc=${caseName}
|
||||
... action=activeDefence
|
||||
... userRegion={"method":"reflection","reflector_type":"DNS","target_ip":"${target_ip}","target_port":1234,"rate_pps":1,"payload_profile_id":${payload_profile_id},"reflector_profile_id":${reflector_profile_id}}
|
||||
... isValid=1
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policyDict} v2
|
||||
${profile} Create Dictionary typeUrl=reflector profileIds=${reflector_profile_id}
|
||||
${profile1} Create Dictionary typeUrl=reflector/payload profileIds=${payload_profile_id}
|
||||
Append To List ${profiles} ${profile} ${profile1}
|
||||
${objectIds} Set Variable ${EMPTY}
|
||||
Log ${rescode} ${policyIds} ${objectIds}
|
||||
Policy-Post-v2-00007
|
||||
Comment 创建IP
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1}
|
||||
... isInitialize=0
|
||||
... addItemList=range|192.168.41.68|192.168.41.68|0/0
|
||||
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId1}
|
||||
Log To Console Create IP Object1
|
||||
Comment 创建IP1
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1}
|
||||
... isInitialize=0
|
||||
... addItemList=range|192.168.41.67|192.168.41.67|0/0
|
||||
${rescode} ${objectId2} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId2}
|
||||
Log To Console Create IP Object2
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com
|
||||
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId3},${objectIds}
|
||||
Log To Console Create url Object3
|
||||
Comment 创建url1
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*google.com.com
|
||||
${rescode} ${objectId4} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId4},${objectIds}
|
||||
Log To Console Create url Object4
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00007 policyType=tsg_security
|
||||
... policyDesc=wx-autotest
|
||||
... action=deny effectiveRange={}
|
||||
... userRegion={"protocol":"HTTP","method":"drop"}
|
||||
... source=${objectId1}|TSG_SECURITY_SOURCE_ADDR
|
||||
... destination=${objectId3}|TSG_FIELD_HTTP_URL
|
||||
... isValid=${1} appIdObjects=2
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
|
||||
Log ${rescode}
|
||||
${updatePolicyId} Set Variable ${policyIds}[0][policyIds][0]
|
||||
Comment 更新安全策略
|
||||
${policy} Create Dictionary policyName=WX_UpdatePolicy-v2-00007 policyType=tsg_security
|
||||
... policyDesc=wx-autotest policyId=${updatePolicyId}
|
||||
... action=monitor
|
||||
... userRegion={"protocol":"HTTP","traffic_forward":{"enable":1}}
|
||||
... source=${objectId2}|TSG_SECURITY_SOURCE_ADDR
|
||||
... destination=${objectId4}|TSG_FIELD_HTTP_URL
|
||||
... isValid=${1} appIdObjects=2
|
||||
${rescode} UpdatePolicies 1 ${policy} v2 update
|
||||
Policy-Post-v2-00008
|
||||
Comment 创建IP
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1}
|
||||
... isInitialize=0
|
||||
... addItemList=range|192.168.41.68|192.168.41.68|0/0
|
||||
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId1}
|
||||
Log To Console Create IP Object1
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com
|
||||
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId3},${objectIds}
|
||||
Log To Console Create url Object3
|
||||
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00008 policyType=tsg_security
|
||||
... policyDesc=wx-autotest
|
||||
... action=deny effectiveRange={}
|
||||
... userRegion={"protocol":"HTTP","method":"drop"}
|
||||
... source=${objectId1}|TSG_SECURITY_SOURCE_ADDR
|
||||
... destination=${objectId3}|TSG_FIELD_HTTP_URL
|
||||
... isValid=${1} appIdObjects=2
|
||||
${policy1} Copy Dictionary ${policy} true
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
|
||||
Log ${rescode}
|
||||
${updatePolicyId} Set Variable ${policyIds}[0][policyIds][0]
|
||||
Comment 更新安全策略
|
||||
Set To Dictionary ${policy1} policyId=${updatePolicyId}
|
||||
${rescode} UpdatePolicies 1 ${policy1} v2 disable
|
||||
Policy-Post-v2-00009
|
||||
Comment 创建IP
|
||||
${objectDict} Create Dictionary objectType=ip isValid=${1}
|
||||
... isInitialize=0
|
||||
... addItemList=range|192.168.41.68|192.168.41.68|0/0
|
||||
${rescode} ${objectId1} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId1}
|
||||
Log To Console Create IP Object1
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*baidu.com
|
||||
${rescode} ${objectId3} AddObject2 ${1} ${objectDict}
|
||||
${objectIds} Set Variable ${objectId3},${objectIds}
|
||||
Log To Console Create url Object3
|
||||
|
||||
Comment 创建安全策略
|
||||
${policy} Create Dictionary policyName=WX_AddPolicy-v2-00009 policyType=tsg_security
|
||||
... policyDesc=wx-autotest
|
||||
... action=deny effectiveRange={}
|
||||
... userRegion={"protocol":"HTTP","method":"drop"}
|
||||
... source=${objectId1}|TSG_SECURITY_SOURCE_ADDR
|
||||
... destination=${objectId3}|TSG_FIELD_HTTP_URL
|
||||
... isValid=${0} appIdObjects=2
|
||||
${policy1} Copy Dictionary ${policy} true
|
||||
${rescode} ${policyIds} AddPolicies 1 ${policy} v2
|
||||
Log ${rescode}
|
||||
${updatePolicyId} Set Variable ${policyIds}[0][policyIds][0]
|
||||
Comment 更新安全策略
|
||||
Set To Dictionary ${policy1} policyId=${updatePolicyId}
|
||||
${rescode} UpdatePolicies 1 ${policy1} v2 enable
|
||||
67
01-TestCase/tsg_bfapi/setting/Claimedsrcip.robot
Normal file
67
01-TestCase/tsg_bfapi/setting/Claimedsrcip.robot
Normal file
@@ -0,0 +1,67 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_adc Security_Policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /v1/policy/profile/claimedsrcip
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
claimedsrcip-00001
|
||||
#Hijack 需要修改的内容
|
||||
${list} Create List 192.168.0.1/16 192.168.0.2/16 192.168.0.3/24
|
||||
${objectedit} Create Dictionary profileName=12313 addrType=4 ipList=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_claimedsrcip} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "add","returnData": 1,"claimedSrcIpList":[{"profileId":1,"profileName":"1231","addrType":4,"ipList":["192.168.0.1/16","192.168.0.2/16","192.168.0.3/24"],"isValid":1,"profileDesc":""}],"isValid":1,"profileDesc":""}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
claimedsrcip-00002
|
||||
#Hijack 需要修改的内容
|
||||
${list} Create List 192.168.0.1/16 192.168.0.2/16 192.168.0.3/24
|
||||
${objectedit} Create Dictionary profileName=朱brightясный addrType=4 ipList=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_claimedsrcip} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "add","returnData": 1,"claimedSrcIpList":[{"profileId":1,"profileName":"1231","addrType":4,"ipList":["192.168.0.1/16","192.168.0.2/16","192.168.0.3/24"],"isValid":1,"profileDesc":""}],"isValid":1,"profileDesc":""}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
claimedsrcip-00003
|
||||
#Hijack 需要修改的内容
|
||||
${list} Create List 192.168.0.1/16 192.168.0.2/16 192.168.0.3/24
|
||||
${objectedit} Create Dictionary profileName=朱brightясный addrType=4 ipList=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_claimedsrcip} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "add","returnData": 1,"claimedSrcIpList":[{"profileId":1,"profileName":"1231","addrType":4,"ipList":["192.168.0.1/16","192.168.0.2/16","192.168.0.3/24"],"isValid":1,"profileDesc":""}],"isValid":1,"profileDesc":""}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
@@ -1,50 +0,0 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_bf_api Clear_All_Policys
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url1} /policy/profile/keyringobj
|
||||
${url2} /policy/profile/trustedcacertobj
|
||||
${url3} /policy/profile/responsepages
|
||||
${url4} /policy/profile/hijackfiles
|
||||
${url5} /policy/profile/insertscripts
|
||||
${url6} /policy/profile/trafficmirror
|
||||
|
||||
*** Test Cases ***
|
||||
Keyring Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url1} ${reqData}
|
||||
|
||||
Trusted Cert Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url2} ${reqData}
|
||||
|
||||
Response Pages Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url3} ${reqData}
|
||||
|
||||
Hijack Files Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url4} ${reqData}
|
||||
|
||||
Insert Scripts Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url5} ${reqData}
|
||||
|
||||
Traffic Mirror Policy delete all case
|
||||
# 清空所有策略!!!
|
||||
${reqData} Create Dictionary isClear=true
|
||||
DeletePolicyFile ${url6} ${reqData}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/decryption
|
||||
${url} /v1/policy/profile/decryption
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -246,3 +246,19 @@ Decryption_Profile-00014
|
||||
# 修改
|
||||
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
|
||||
UpdatePolicyFile2 ${url} ${reqData_edit}
|
||||
|
||||
Decryption_Profile-00015
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=朱brightясный
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profile_decryption_profile} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreateRequest ${url} ${objectDict}
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"profileName":"zmmtest","profileDesc":"","profileId":"525","isValid":1,"decryption":{"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"fail_action":"fail-close","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1}}}]}
|
||||
UpdatePolicyFile2 ${url} ${reqData_edit}
|
||||
@@ -11,7 +11,7 @@ Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/dnsrecords
|
||||
${url} /v1/policy/profile/dnsrecords
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -80,8 +80,8 @@ Dnsrecords_CNAME_-00003
|
||||
|
||||
Dnsrecords_AAAA_-00004
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=2000:db8:2de::e13
|
||||
${Dict2} Create Dictionary value=2000:db8:2de::e13
|
||||
${Dict1} Create Dictionary value=2000:db8:2de::e13
|
||||
${Dict2} Create Dictionary value=2000:db8:2de::e13
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=AAAA recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
@@ -104,7 +104,7 @@ Dnsrecords_TXT_-00005
|
||||
${Dict1} Create Dictionary value=abc.com
|
||||
${Dict2} Create Dictionary value=edf.com
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=TXT recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
@@ -125,7 +125,7 @@ Dnsrecords_NS_-00006
|
||||
${Dict1} Create Dictionary value=abc.com
|
||||
${Dict2} Create Dictionary value=edf.com
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=NS recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
@@ -146,7 +146,7 @@ Dnsrecords_PTR_-00007
|
||||
${Dict1} Create Dictionary value=abc.com
|
||||
${Dict2} Create Dictionary value=edf.com
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=CNAME recordValues=${list}
|
||||
${objectedit} Create Dictionary recordName=12 recordType=PTR recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
@@ -161,3 +161,24 @@ Dnsrecords_PTR_-00007
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
Dnsrecords_Chinase_English_Russian_-00008
|
||||
#Hijack 需要修改的内容
|
||||
${Dict1} Create Dictionary value=abc.com
|
||||
${Dict2} Create Dictionary value=edf.com
|
||||
${list} Create List ${Dict1} ${Dict2}
|
||||
${objectedit} Create Dictionary recordName=朱brightясный recordType=PTR recordValues=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_dnsrecords} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["recordId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["recordName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable { \ \ \ \ "opAction": "update", \ \ \ \ "returnData": 1, \ \ \ \ "dnsRecordList": [ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "recordId": ${profileId}, \ \ \ \ \ \ \ \ \ \ \ \ "recordName": "12", \ \ \ \ \ \ \ \ \ \ \ \ "recordType": "A", \ \ \ \ \ \ \ \ \ \ \ \ "recordValues": [ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.1" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "value": "192.168.0.2" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "isValid": 1, \ \ \ \ \ \ \ \ \ \ \ \ "profileDesc": "" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${aaa} Evaluate type(${reqHeader_edit} )
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
@@ -11,10 +11,30 @@ Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/hijackfiles
|
||||
${url} /v1/policy/profile/hijackfiles
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Keywords ***
|
||||
ProfileComman
|
||||
[Arguments] ${objectedit} ${type} ${fileName}
|
||||
${default_json} ${default_files} ${default_url} Run Keyword If "${type}"=="hijack" Set Variable ${setting_proxy_profiles_hijack} hijack_files/ /v1/policy/profile/hijackfiles
|
||||
... ELSE IF Run Keyword If "${type}"=="insert" Set Variable ${setting_proxy_profiles_insert} insert_files/ /v1/policy/profile/insertfiles
|
||||
... ELSE Set Variable a b c
|
||||
|
||||
${objectDict} Jsoneditmanu ${default_json} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${default_url} ${default_files} ${fileName} ${objectDict}
|
||||
#${url} ${filePath} ${fileName} ${objectDict}
|
||||
[Return] ${response}
|
||||
*** Test Cases ***
|
||||
Hijack_file_24_type-apk
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=Hijack_file_24_type-apk contentName=Create-Hijack Files-test-0.apk contentType=application/vnd.android.package-archive
|
||||
${response} ProfileComman ${objectedit} hijack Create-Hijack Files-test-0.apk
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
##########################以上为封装示例###################################
|
||||
|
||||
|
||||
Hijack_file_24_type_apk-00000
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-0.apk contentType=application/vnd.android.package-archive
|
||||
@@ -28,8 +48,8 @@ Hijack_file_24_type_apk-00000
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"text/plain","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack_Files-test-24.txt","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack_Files-test-24.txt ${header_edit}
|
||||
#DeletePolicyFile ${url} ${profileId}
|
||||
|
||||
Hijack_file_24_type_exe-00001
|
||||
@@ -45,8 +65,8 @@ Hijack_file_24_type_exe-00001
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"text/plain","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-24.plain","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-24.plain ${header_edit}
|
||||
|
||||
Hijack_file_24_type_gif-00002
|
||||
#Hijack 需要修改的内容
|
||||
@@ -61,8 +81,8 @@ Hijack_file_24_type_gif-00002
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"text/comma-separated-values","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-23.csv","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-23.csv ${header_edit}
|
||||
|
||||
Hijack_file_24_type_html-00003
|
||||
#Hijack 需要修改的内容
|
||||
@@ -77,8 +97,8 @@ Hijack_file_24_type_html-00003
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"text/css","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-22.css","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-22.css ${header_edit}
|
||||
|
||||
Hijack_file_24_type_jpeg-00004
|
||||
#Hijack 需要修改的内容
|
||||
@@ -93,8 +113,8 @@ Hijack_file_24_type_jpeg-00004
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/vnd.oasis.opendocument.text","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-21.odt","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-21.odt ${header_edit}
|
||||
|
||||
Hijack_file_24_type_png-00005
|
||||
#Hijack 需要修改的内容
|
||||
@@ -109,8 +129,8 @@ Hijack_file_24_type_png-00005
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/vnd.openxmlformats-officedocument.presentationml.presentation","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-20.pptx","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-20.pptx ${header_edit}
|
||||
|
||||
Hijack_file_24_type_png-00005-1
|
||||
#Hijack 需要修改的内容
|
||||
@@ -125,8 +145,8 @@ Hijack_file_24_type_png-00005-1
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/x-ppt","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-19.ppt","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-19.ppt ${header_edit}
|
||||
|
||||
Hijack_file_24_type_svg-00006
|
||||
#Hijack 需要修改的内容
|
||||
@@ -141,8 +161,8 @@ Hijack_file_24_type_svg-00006
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/vnd.ms-powerpoint","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-19.ppt","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-19.ppt ${header_edit}
|
||||
|
||||
Hijack_file_24_type_rpm-00007
|
||||
#Hijack 需要修改的内容
|
||||
@@ -157,8 +177,8 @@ Hijack_file_24_type_rpm-00007
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-18.xlsx","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-18.xlsx ${header_edit}
|
||||
|
||||
Hijack_file_24_type_dmg-00008
|
||||
#Hijack 需要修改的内容
|
||||
@@ -173,8 +193,8 @@ Hijack_file_24_type_dmg-00008
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/x-xls","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-17.xls","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-17.xls ${header_edit}
|
||||
|
||||
Hijack_file_24_type_js-00009
|
||||
#Hijack 需要修改的内容
|
||||
@@ -189,8 +209,8 @@ Hijack_file_24_type_js-00009
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/vnd.ms-excel","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-17.xls","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-17.xls ${header_edit}
|
||||
|
||||
Hijack_file_24_type_rar-00010
|
||||
#Hijack 需要修改的内容
|
||||
@@ -205,8 +225,8 @@ Hijack_file_24_type_rar-00010
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/pdf","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-16.pdf","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-16.pdf ${header_edit}
|
||||
|
||||
Hijack_file_24_type_zip-00011
|
||||
#Hijack 需要修改的内容
|
||||
@@ -221,8 +241,8 @@ Hijack_file_24_type_zip-00011
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"text/xml","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-15.xml","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-15.xml ${header_edit}
|
||||
|
||||
Hijack_file_24_type_doc-00012
|
||||
#Hijack 需要修改的内容
|
||||
@@ -237,8 +257,8 @@ Hijack_file_24_type_doc-00012
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/json","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-14.json","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-14.json ${header_edit}
|
||||
|
||||
Hijack_file_24_type_docx-00013
|
||||
#Hijack 需要修改的内容
|
||||
@@ -253,8 +273,8 @@ Hijack_file_24_type_docx-00013
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/vnd.openxmlformats-officedocument.wordprocessingml.document","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-13.docx","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-13.docx ${header_edit}
|
||||
|
||||
Hijack_file_24_type_json-00014
|
||||
#Hijack 需要修改的内容
|
||||
@@ -269,8 +289,8 @@ Hijack_file_24_type_json-00014
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/msword","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-12.doc","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-12.doc ${header_edit}
|
||||
|
||||
Hijack_file_24_type_xml-00015
|
||||
#Hijack 需要修改的内容
|
||||
@@ -285,8 +305,8 @@ Hijack_file_24_type_xml-00015
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/x-zip-compressed","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-11.zip","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-11.zip ${header_edit}
|
||||
|
||||
Hijack_file_24_type_pdf-00016
|
||||
#Hijack 需要修改的内容
|
||||
@@ -301,8 +321,8 @@ Hijack_file_24_type_pdf-00016
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/octet-stream","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-10.rar","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-10.rar ${header_edit}
|
||||
|
||||
Hijack_file_24_type_xls-00017
|
||||
#Hijack 需要修改的内容
|
||||
@@ -317,8 +337,8 @@ Hijack_file_24_type_xls-00017
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/x-javascript","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-9.js","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-9.js ${header_edit}
|
||||
|
||||
Hijack_file_24_type_xls-00017-1
|
||||
#Hijack 需要修改的内容
|
||||
@@ -333,8 +353,8 @@ Hijack_file_24_type_xls-00017-1
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/x-apple-diskimage","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-8.dmg","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-8.dmg ${header_edit}
|
||||
|
||||
Hijack_file_24_type_xlsx-00018
|
||||
#Hijack 需要修改的内容
|
||||
@@ -349,8 +369,8 @@ Hijack_file_24_type_xlsx-00018
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"audio/x-pn-realaudio-plugin","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-7.rpm","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-7.rpm ${header_edit}
|
||||
|
||||
Hijack_file_24_type_ppt-00019
|
||||
#Hijack 需要修改的内容
|
||||
@@ -365,8 +385,8 @@ Hijack_file_24_type_ppt-00019
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/svg%2Bxml","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-6.svg","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-6.svg ${header_edit}
|
||||
|
||||
Hijack_file_24_type_ppt-00019-1
|
||||
#Hijack 需要修改的内容
|
||||
@@ -381,7 +401,7 @@ Hijack_file_24_type_ppt-00019-1
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/x-png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
|
||||
Hijack_file_24_type_pptx-00020
|
||||
@@ -413,8 +433,8 @@ Hijack_file_24_type_odt-00021
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/jpeg","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-4.jpeg","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-4.jpeg ${header_edit}
|
||||
|
||||
Hijack_file_24_type_css-00022
|
||||
#Hijack 需要修改的内容
|
||||
@@ -429,8 +449,8 @@ Hijack_file_24_type_css-00022
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"text/html","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-3.html","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-3.html ${header_edit}
|
||||
|
||||
Hijack_file_24_type_csv-00023
|
||||
#Hijack 需要修改的内容
|
||||
@@ -445,8 +465,8 @@ Hijack_file_24_type_csv-00023
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/gif","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-2.gif","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-2.gif ${header_edit}
|
||||
|
||||
Hijack_file_24_type_plain-00024
|
||||
#Hijack 需要修改的内容
|
||||
@@ -461,8 +481,8 @@ Hijack_file_24_type_plain-00024
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/x-msdos-program","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-1.exe","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-1.exe ${header_edit}
|
||||
|
||||
Hijack_file_24_type_txt-00025
|
||||
#Hijack 需要修改的内容
|
||||
@@ -477,5 +497,21 @@ Hijack_file_24_type_txt-00025
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"image/png","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-5.png","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-5.png ${header_edit}
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/vnd.android.package-archive","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-0.apk","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-0.apk ${header_edit}
|
||||
|
||||
Hijack_file_24_type_Chinase_English_Russian-00026
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=Zhuming%E6%98%8E!%40%23%40%24%25%5E%26(())__%2B%2B%2B%2B%2B(*%26%25%24%5E%25%23%24!~!%40%5E%25%26*()((_%E2%96%89%E2%96%88%E2%96%87%E2%96%86%E2%96%8B%E2%96%8D%E2%96%8E%E2%88%9A%E2%98%9A%E2%98%9A%E3%8F%98%E2%98%9B%E2%88%9A%E2%80%A6%E3%89%BF%E3%80%93%D0%9D%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B9%D0%BA%D0%B0 contentName=Create-Hijack Files-test-24.txt contentType=text/plain
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-24.txt ${objectDict}
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"contentType":"application/vnd.android.package-archive","opAction":"update","profileName":"test_edit","contentName":"Create-Hijack Files-test-0.apk","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} hijack_files/ Create-Hijack Files-test-0.apk ${header_edit}
|
||||
@@ -11,7 +11,7 @@ Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/insertscripts
|
||||
${url} /v1/policy/profile/insertscripts
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -79,3 +79,20 @@ Insert_Scripts_css_after-00004
|
||||
# 修改
|
||||
${reqHeader_edit} Set Variable {"isValid":1,"format":"js","insertOn":"after_page_load \ ","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} insert_files/ Create-Insert Scripts-test-1.js ${reqHeader_edit}
|
||||
|
||||
Insert_Scripts_css_after-00005
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=%E6%9C%B1bright%D1%8F%D1%81%D0%BD%D1%8B%D0%B9 format=css insertOn=""
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_insert} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} insert_files/ Create-Insert Scripts-test.css ${objectDict}
|
||||
log 12313123123123213123213
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${reqHeader_edit} Set Variable {"isValid":1,"format":"js","insertOn":"after_page_load \ ","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} insert_files/ Create-Insert Scripts-test-1.js ${reqHeader_edit}
|
||||
|
||||
@@ -1,27 +1,23 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_bf_api Cached_Intermediate_Certificates
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Force Tags tsg_bf_api Cached_Intermediate_Certificates
|
||||
Library String
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library Collections
|
||||
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/exch/intermediacert
|
||||
${url} /v1/policy/exch/intermediacert
|
||||
|
||||
*** Test Cases ***
|
||||
Intermedia Cert Policy case
|
||||
|
||||
IntermediaCertPolicy-00001
|
||||
# 查询1
|
||||
${suffix_quary} Catenate SEPARATOR=& certId=269 sni=nationalbank.kz
|
||||
QueryPolicyFile ${url} ${suffix_quary}
|
||||
|
||||
QueryPolicyFile ${url} pageNo=1
|
||||
# 查询2
|
||||
${suffix_quary} Catenate SEPARATOR=& certIds=263,265 sni=dw-online.ksosoft
|
||||
${suffix_quary} Catenate SEPARATOR=& pageNo=1 pageSize=20
|
||||
QueryPolicyFile ${url} ${suffix_quary}
|
||||
|
||||
# 启用/暂停
|
||||
${certId} QueryPolicyFile2 ${url} isValid=1
|
||||
${certIds} Create List ${certId}
|
||||
@@ -29,7 +25,17 @@ Intermedia Cert Policy case
|
||||
UpdatePolicyFile2 ${url} ${data}
|
||||
${data2} Set Variable {"opAction":"enable","certIds":${certIds}}
|
||||
UpdatePolicyFile2 ${url} ${data2}
|
||||
|
||||
|
||||
|
||||
|
||||
IntermediaCertPolicy-00002
|
||||
# 查询1
|
||||
QueryPolicyFile ${url} pageNo=1
|
||||
# 查询2
|
||||
${suffix_quary} Catenate SEPARATOR=& pageNo=2 pageSize=30
|
||||
QueryPolicyFile ${url} ${suffix_quary}
|
||||
# 启用/暂停
|
||||
${certId} QueryPolicyFile2 ${url} isValid=1
|
||||
${certIds} Create List ${certId}
|
||||
${data} Set Variable {"opAction":"disable","certIds":${certIds}}
|
||||
UpdatePolicyFile2 ${url} ${data}
|
||||
${data2} Set Variable {"opAction":"enable","certIds":${certIds}}
|
||||
UpdatePolicyFile2 ${url} ${data2}
|
||||
|
||||
@@ -10,7 +10,7 @@ Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/Functional
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/keyringobj
|
||||
${url} /v1/policy/profile/keyringobj
|
||||
${keyringId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -23,7 +23,8 @@ Settings-ProxyProfiles-KeyringFile_root-00001
|
||||
QueryPolicyFile ${url} keyringId=${keyringId}&keyringName=${keyringName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"opAction":"update","returnData":1,"keyringName":"test_edit","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":"${keyringId}","includeRoot":0}
|
||||
UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
#UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
UpdatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
|
||||
Settings-ProxyProfiles-KeyringFile_end-entity-00002
|
||||
# 新增 end-entity
|
||||
@@ -34,15 +35,17 @@ Settings-ProxyProfiles-KeyringFile_end-entity-00002
|
||||
QueryPolicyFile ${url} keyringId=${keyringId}&keyringName=${keyringName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"opAction":"update","returnData":1,"keyringName":"test_edit","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":"${keyringId}","includeRoot":0}
|
||||
UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
#UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
UpdatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
|
||||
Settings-ProxyProfiles-KeyringFile_Intermediate-00003
|
||||
# 新增 end-entity
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/Intermediate/ tang-ca-v3-intermediate-01-cer.pem tang-ca-v3-intermediate-01-key.pem Intermediate
|
||||
${response} CreatePolicyMutipartFile ${url} keyrings/Intermediate/ tang-ca-v3-intermediate-02-cer.pem tang-ca-v3-intermediate-02-key.pem Intermediate
|
||||
# 查询
|
||||
${keyringId} Get From Dictionary ${response} keyringId
|
||||
${keyringName} Get From Dictionary ${response} keyringName
|
||||
QueryPolicyFile ${url} keyringId=${keyringId}&keyringName=${keyringName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"opAction":"update","returnData":1,"keyringName":"test_edit","keyringType":"end-entity","reissueExpiryHour":0,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":"${keyringId}","includeRoot":0}
|
||||
#UpdatePolicyMutipartFile ${url} Keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
UpdatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem tang-ca-v3-www.amazon.cn-key.pem ${header_edit}
|
||||
|
||||
@@ -11,7 +11,7 @@ Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} policy/profile/reflector
|
||||
${url} /v1/policy/profile/reflector
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -26,7 +26,24 @@ reflector-00001
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "update","returnData": 1,"reflectorList":[{"profileId":${profileId} ,"profileName":"12313","addrType":4,"reflectorType":"dns","ipList":["192.168.0.1","192.168.0.2","192.168.0.3"],"isValid":1,"profileDesc":""}]}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
reflector-00002
|
||||
#Hijack 需要修改的内容
|
||||
${list} Create List 192.168.0.1 192.168.0.2 192.168.0.3
|
||||
${objectedit} Create Dictionary profileName=%E6%9C%B1bright%D1%8F%D1%81%D0%BD%D1%8B%D0%B9 reflectorType=DNS ipList=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_reflector} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "update","returnData": 1,"reflectorList":[{"profileId":${profileId} ,"profileName":"12313","addrType":4,"reflectorType":"dns","ipList":["192.168.0.1","192.168.0.2","192.168.0.3"],"isValid":1,"profileDesc":""}]}
|
||||
@@ -11,11 +11,11 @@ Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} policy/profile/reflector/payload
|
||||
${url} /v1/policy/profile/reflector/payload
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
reflector-00001
|
||||
ReflectorPayload-00001
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=12313 reflectorType=dns payload=SSBMT1ZFIFlPVSDmiJHniLHkvaA=
|
||||
Comment 打印需要修改的json内容
|
||||
@@ -25,7 +25,23 @@ reflector-00001
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "update","returnData": 1,"reflectorList":[{"profileId":1,"profileName":"zzzzzzz","reflectorType":"dns","payload":"SSBMT1ZFIFlPVSDmiJHniLHkvaA=","isValid":1,"profileDesc":""}]}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
|
||||
ReflectorPayload-00002
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=朱brightясный reflectorType=dns payload=SSBMT1ZFIFlPVSDmiJHniLHkvaA=
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${settig_proxy_profiles_reflector_payload} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "update","returnData": 1,"reflectorList":[{"profileId":1,"profileName":"zzzzzzz","reflectorType":"dns","payload":"SSBMT1ZFIFlPVSDmiJHniLHkvaA=","isValid":1,"profileDesc":""}]}
|
||||
@@ -17,7 +17,7 @@ Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/responsepages
|
||||
${url} /v1/policy/profile/responsepages
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -36,3 +36,19 @@ Response_page_html-00001
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"format":"html","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} response_pages_files/ Create-Response Pages-test.html ${header_edit}
|
||||
|
||||
Response_page_html-00002
|
||||
#Hijack 需要修改的内容
|
||||
${objectedit} Create Dictionary profileName=%E6%9C%B1bright%D1%8F%D1%81%D0%BD%D1%8B%D0%B9 format=html
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_reponse_page} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} response_pages_files/ Create-Response Pages-test.html ${objectDict}
|
||||
# 查询
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${header_edit} Set Variable {"isValid":1,"format":"html","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
|
||||
UpdatePolicyFile ${url} response_pages_files/ Create-Response Pages-test.html ${header_edit}
|
||||
|
||||
@@ -21,7 +21,7 @@ Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/trafficmirror
|
||||
${url} /v1/policy/profile/trafficmirror
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
@@ -95,3 +95,23 @@ TrafficMirrorPolicy_mac_Multi_object-00004
|
||||
${aaa} Evaluate type(${reqData_edit})
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqData_edit}
|
||||
|
||||
TrafficMirrorPolicy_mac_Multi_object-00005
|
||||
#Hijack 需要修改的内容
|
||||
${list} Create List 13:13:13:13:13:13 13:13:13:13:13:13
|
||||
${objectedit} Create Dictionary profileName=%E6%9C%B1bright%D1%8F%D1%81%D0%BD%D1%8B%D0%B9 addrType=mac addrArray=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_traffic_mirror_profiles} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreateRequest ${url} ${objectDict}
|
||||
# 查询
|
||||
log ${response}
|
||||
${profileId} Get From Dictionary ${response} profileId
|
||||
${profileName} Get From Dictionary ${response} profileName
|
||||
QueryPolicyFile ${url} profileId=${profileId}&profileName=${profileName}
|
||||
# 修改
|
||||
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
|
||||
${aaa} Evaluate type(${reqData_edit})
|
||||
log ${aaa}
|
||||
UpdatePolicyFile2 ${url} ${reqData_edit}
|
||||
|
||||
@@ -18,7 +18,7 @@ Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /policy/profile/trustedcacertobj
|
||||
${url} /v1/policy/profile/trustedcacertobj
|
||||
${certId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_adc Security_Policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} policy/profile/claimedsrcip
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
claimedsrcip-00001
|
||||
#Hijack 需要修改的内容
|
||||
${list} Create List 192.168.0.1/16 192.168.0.2/16 192.168.0.3/24
|
||||
${objectedit} Create Dictionary profileName=12313 addrType=4 ipList=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_claimedsrcip} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "add","returnData": 1,"claimedSrcIpList":[{"profileId":1,"profileName":"1231","addrType":4,"ipList":["192.168.0.1/16","192.168.0.2/16","192.168.0.3/24"],"isValid":1,"profileDesc":""}],"isValid":1,"profileDesc":""}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
@@ -1,33 +0,0 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_adc Security_Policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} policy/profile/redirectdestination
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
claimedsrcip-00001
|
||||
#Hijack 需要修改的内容
|
||||
${list} Create List 192.168.0.1/16 192.168.0.2/16 192.168.0.3/24
|
||||
${objectedit} Create Dictionary profileName=12313 addrType=4 ipList=${list}
|
||||
Comment 打印需要修改的json内容
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_claimedsrcip} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} Post-Request ${url} ${objectDict}
|
||||
#查询
|
||||
${profileId} Set Variable ${response['data']['list'][0]["profileId"]}
|
||||
${profileName} Set Variable ${response['data']['list'][0]["profileName"]}
|
||||
QueryPolicyFile ${url} recordId=${profileId}&profileName=${${profileName} }
|
||||
# 修改
|
||||
log ${profileId}
|
||||
${reqHeader_edit} Set Variable {"opAction": "add","returnData": 1,"claimedSrcIpList":[{"profileId":1,"profileName":"1231","addrType":4,"ipList":["192.168.0.1/16","192.168.0.2/16","192.168.0.3/24"],"isValid":1,"profileDesc":""}],"isValid":1,"profileDesc":""}
|
||||
UpdatePolicyFile2 ${url} ${reqHeader_edit}
|
||||
82
01-TestCase/tsg_bfapi/setting/test.robot
Normal file
82
01-TestCase/tsg_bfapi/setting/test.robot
Normal file
@@ -0,0 +1,82 @@
|
||||
*** Settings ***
|
||||
Test Teardown TeardownDelete ${url} profileIds ${profileId}
|
||||
Force Tags tsg_adc Security_Policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||
Resource ../../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${url} /v1/policy/profile/hijackfiles
|
||||
${profileId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
Hijack_file_24_type-hijack
|
||||
#Hijack
|
||||
${objectedit} Create Dictionary profileName=Hijack_file_24_type-00000 contentName=Create-Hijack Files-test-0.apk contentType=application/vnd.android.package-archive
|
||||
${response} settings ${objectedit} hijack
|
||||
|
||||
Hijack_file_24_type-insert
|
||||
#insert
|
||||
${objectedit} Create Dictionary profileName=zmminserttest format=js insertOn=before_page_load contentName=Create-Insert Scripts-test-1.js
|
||||
${response} settings ${objectedit} insert
|
||||
|
||||
Hijack_file_24_type-response
|
||||
#insert
|
||||
${objectedit} Create Dictionary profileName=zmminserttest format=js insertOn=before_page_load
|
||||
${response} settings ${objectedit} response
|
||||
|
||||
*** Keywords ***
|
||||
ProfileComman1
|
||||
[Arguments] ${objectedit} ${type}
|
||||
${default_json} ${default_files} ${default_url} Run Keyword If "${type}"=="hijack" Set Variable ${setting_proxy_profiles_hijack} hijack_files/ /policy/profile/hijackfiles
|
||||
... ELSE IF Run Keyword If "${type}"=="insert" Set Variable ${setting_proxy_profiles_insert} insert_files/ /policy/profile/insertfiles
|
||||
... ELSE Set Variable a b c
|
||||
${objectDict} Jsoneditmanu ${default_json} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${default_url} ${default_files} ${objectDict}
|
||||
[Return] ${response}
|
||||
|
||||
settings
|
||||
[Arguments] ${dict} ${type}
|
||||
#创建3个列表,代表不同的接口类型
|
||||
@{Interface_file} create list hijack insert
|
||||
@{Interface_post} create list claimedsrcip Reflector
|
||||
@{Interface_ceri} create list keyring TrustedCertPolicy
|
||||
#创建3个返回值用于接口参数
|
||||
${setting_json} catenate SEPARATOR= setting_proxy_profiles_ ${type}
|
||||
log ${setting_json}
|
||||
${setting_file} catenate SEPARATOR= ${type} _files /
|
||||
log ${setting_file}
|
||||
${setting_url} catenate SEPARATOR= /policy/profile/ ${type} files
|
||||
log ${setting_url}
|
||||
${response} Run Keyword If "${type}" in @{Interface_file} Interface_file ${setting_json} ${setting_url} ${setting_file} ${dict}
|
||||
... ELSE IF Run Keyword If ${type}in @{Interface_post} Interface_post ${setting_json} ${setting_url} ${dict}
|
||||
... ELSE IF Run Keyword If ${type}in @{Interface_ceri} Interface_Ceri ${setting_url} ${setting_file} ${dict}
|
||||
log ${response}
|
||||
|
||||
Interface_file
|
||||
[Arguments] ${setting_json} ${setting_url} ${setting_file} ${dict}
|
||||
${file_name} Set Variable ${dict}[contentName]
|
||||
${objectDict} Jsoneditmanu ${${setting_json}} ${dict}
|
||||
${response} CreatePolicyFile4 ${setting_url} ${setting_file} ${file_name} ${objectDict}
|
||||
[Return] ${response}
|
||||
|
||||
Interface_post
|
||||
[Arguments] ${setting_json} ${setting_url} ${dict}
|
||||
${objectDict} Jsoneditmanu ${setting_json} ${dict}
|
||||
${response} Post-Request ${setting_url} ${objectDict}
|
||||
[Return] ${response}
|
||||
|
||||
Interface_Ceri
|
||||
[Arguments] ${setting_url} ${setting_file} ${dict}
|
||||
${file_name} Set Variable ${dict}[0]
|
||||
${file1} Set Variable ${dict}[1]
|
||||
${file2} Set Variable ${dict}[2]
|
||||
${TypeCeri} Set Variable ${dict}[3]
|
||||
${response} CreatePolicyMutipartFile ${setting_url} ${setting_file} ${file1} ${file2} ${TypeCeri}
|
||||
[Return] ${response}
|
||||
@@ -1,5 +1,5 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-cli Policy EnDisable
|
||||
Force Tags tsg_cli tsg_device EnDisable
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../02-Keyword/tsg_cli/Interface.robot
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
*** Settings ***
|
||||
Test Teardown Clear_Test_Data
|
||||
Force Tags tsg-cli Object ExImport
|
||||
Force Tags tsg_cli tsg_device ExImport
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../02-Keyword/tsg_cli/Interface.robot
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_cli tsg_device OtherCommand
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../02-Keyword/tsg_cli/Interface.robot
|
||||
|
||||
*** Test Cases ***
|
||||
Tsg_Help_TestCase
|
||||
[Tags] tsg-cli TsgHelp
|
||||
[Tags] tsg_cli TsgHelp
|
||||
Tsg_Help_Keyword
|
||||
Tsg_Command_Help tsg_policy
|
||||
Tsg_Command_Help tsg_policy_object
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-cli ManipulationPolicy Query
|
||||
Force Tags tsg_cli tsg_device ManipulationPolicy Query
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../02-Keyword/tsg_cli/Interface.robot
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-cli Object Query
|
||||
Resource ../../03-Variable/bifangapivariable.txt
|
||||
Resource ../../02-Keyword/tsg_cli/interface.robot
|
||||
Force Tags tsg_cli tsg_device Object Query
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../02-Keyword/tsg_cli/Interface.robot
|
||||
|
||||
*** Test Cases ***
|
||||
Objects_Query_TestCase
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-cli SecurityPolicy Query
|
||||
Force Tags tsg_cli tsg_device SecurityPolicy Query
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../02-Keyword/tsg_cli/Interface.robot
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-mib query
|
||||
Force Tags tsg_mib tsg_device query
|
||||
Test Setup OpenMibConnection
|
||||
Test Teardown CloseMibConnection
|
||||
Library json
|
||||
|
||||
315
01-TestCase/tsg_oam/OamApi.robot
Normal file
315
01-TestCase/tsg_oam/OamApi.robot
Normal file
@@ -0,0 +1,315 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg_oam tsg_device
|
||||
Library REST
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library OperatingSystem
|
||||
Library Selenium2Library
|
||||
Library RequestsLibrary
|
||||
Library Collections
|
||||
Library REST http://${oamHost}:${oamPort}/
|
||||
*** Variables ***
|
||||
${url} chassis-daji-00001
|
||||
${profileId} ${EMPTY}
|
||||
*** Keywords ***
|
||||
OamGetRequest
|
||||
[Arguments] ${requestUri} ${data}
|
||||
${headers} set variable {"Content-Type":"application/json"}
|
||||
create session api http://${oamHost}:${oamPort}/ ${headers}
|
||||
${response} Get Request api ${requestUri} data=${data}
|
||||
log return data =${response}
|
||||
Should Be Equal As Strings ${response.status_code} 200
|
||||
${response} to json ${response.content}
|
||||
${rescode} Set Variable ${response}[code]
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
[Return] ${response}
|
||||
OamPostRequest
|
||||
[Arguments] ${requestUri} ${data}
|
||||
${headers} set variable {"Content-Type":"application/json"}
|
||||
create session api http://${oamHost}:${oamPort}/ ${headers}
|
||||
${response}= Post Request api ${requestUri} data=${data}
|
||||
log return data =${response}
|
||||
Should Be Equal As Strings ${response.status_code} 200
|
||||
${response} to json ${response.content}
|
||||
${rescode} Set Variable ${response}[code]
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
[Return] ${response}
|
||||
OamDeleteRequest
|
||||
[Arguments] ${requestUri} ${data}
|
||||
${headers} set variable {"Content-Type":"application/json"}
|
||||
create session api http://${oamHost}:${oamPort}/ ${headers}
|
||||
${response}= Delete Request api ${requestUri} data=${data}
|
||||
log return data =${response}
|
||||
Should Be Equal As Strings ${response.status_code} 200
|
||||
${response} to json ${response.content}
|
||||
${rescode} Set Variable ${response}[code]
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
${datalist} Get From Dictionary ${response}[data] list
|
||||
${len} Get Length ${datalist}
|
||||
FOR ${var} IN RANGE ${len}
|
||||
Should Contain ${datalist}[${var}][result] success
|
||||
END
|
||||
[Return] ${response}
|
||||
*** Test Cases ***
|
||||
writestarttime
|
||||
${starttime} Get Time
|
||||
Append To File ${path}/OamApi_file.txt ${starttime}----------------------------------------------
|
||||
|
||||
chassis-danji-00165
|
||||
#获取单个板卡的信息
|
||||
#${caseName} set variable chassis-danji-00001
|
||||
Comment chassis-danji-00165
|
||||
${response} OamGetRequest /tsgoam/cm/chassis/192.168.40.165 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 165:${response}
|
||||
|
||||
chassis-danji-00170
|
||||
${response} OamGetRequest /tsgoam/cm/chassis/192.168.40.170 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 170:${response}
|
||||
chassis-danji-00175
|
||||
${response} OamGetRequest /tsgoam/cm/chassis/192.168.40.175 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 175:${response}
|
||||
chassis-danji-0025
|
||||
${response} OamGetRequest /tsgoam/cm/chassis/192.168.40.25 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
fru-sled-00001-165
|
||||
#获取单个板卡的FRU信息 获取单个板卡的FRU信息
|
||||
#${caseName} set variable chassis-danji-00001
|
||||
Comment fru-sled-00001
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.165/0 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 165:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.165/1 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 165:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.165/2 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 165:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.165/3 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 165:${response}
|
||||
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.165/100 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 165:${response}
|
||||
fru-sled-00002-170
|
||||
#获取单个板卡的FRU信息 获取单个板卡的FRU信息
|
||||
#${caseName} set variable chassis-danji-00001
|
||||
Comment fru-sled-00002
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.170/100 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 170:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.170/0 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 170:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.170/1 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 170:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.170/2 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 170:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.170/3 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 170:${response}
|
||||
|
||||
fru-sled-00003-175
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.175/100 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 175:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.175/0 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 175:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.175/1 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 175:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.175/2 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 175:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.175/3 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 175:${response}
|
||||
|
||||
fru-sled-00003-25
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.25/100 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.25/0 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.25/1 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.25/2 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
${response} OamGetRequest /tsgoam/cm/FRU/192.168.40.25/3 ${EMPTY}
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
|
||||
hostname-sled-00001可以在170xxg-adc03-mxn
|
||||
Comment ntpsrv-sled-00001更新hostname更新板卡CentOS的hostname,需要用户手动重启network service或reboot后才能生效
|
||||
${response} OamPostRequest /tsgoam/cm/hostname/ [{"chassis_ip":"192.168.40.170","sled_id":0,"hostname":"hy-adc03-mxn"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 170:${response}
|
||||
|
||||
${response} OamPostRequest /tsgoam/cm/hostname/ [{"chassis_ip":"192.168.40.170","sled_id":0,"hostname":"xxg-adc03-mxn"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
|
||||
ntpsrv-sled-00001
|
||||
Comment ntpsrv-sled-00001更新ntp server设置设置ntp server,注意调用此方法会同时更新TSG上所有板卡的ntp配置,即将计算板的ntp server指向交换板,将交换板的ntp server指向目标机器。
|
||||
${response} OamPostRequest /tsgoam/cm/ntpsrv/ [{"chassis_ip":"192.168.40.170","ntpsrv_ip":"192.168.40.1"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
softwarereboot-sled-00001
|
||||
Comment softwarereboot-sled-00001 重启板卡软件
|
||||
#${response} OamPostRequest /tsgoam/cm/softwarereboot/ [{"chassis_ip":"192.168.40.170","sled_id":0},{"chassis_ip":"192.168.40.170","sled_id":1},{"chassis_ip":"192.168.40.170","sled_id":2},{"chassis_ip":"192.168.40.170","sled_id":3},,{"chassis_ip":"192.168.40.170","sled_id":100}]
|
||||
#${response} OamPostRequest /tsgoam/cm/softreboot/ [{"chassis_ip":"192.168.40.170","sled_id":0},{"chassis_ip":"192.168.40.170","sled_id":1},{"chassis_ip":"192.168.40.170","sled_id":2},{"chassis_ip":"192.168.40.170","sled_id":3},{"chassis_ip":"192.168.40.170","sled_id":100}]
|
||||
${response} OamPostRequest /tsgoam/cm/softreboot/ [{"chassis_ip":"192.168.40.165","sled_id":3}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
######################################################################
|
||||
alarm-chassis-00001
|
||||
Comment alarm-chassis-00001 获取一个或多个设备的告警列表
|
||||
${response} OamPostRequest /tsgoam/fm/alarms/ [{"chassis_ip":"192.168.40.165","chassis_sn":"CBT2201925000001","where":"component = 'syslog'"},{"chassis_ip":"192.168.40.170","chassis_sn":"CBT2201925000003","where":"component = 'syslog'"},{"chassis_ip":"192.168.40.175","chassis_sn":"CBT2201925000004","where":"component = 'syslog'"},{"chassis_ip":"192.168.40.25","chassis_sn":"CBT2201925000200","where":"component = 'syslog'"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
|
||||
del-alarm-chassis-00001
|
||||
Comment del-alarm-chassis-00001 清除指定告警
|
||||
#${response} OamDeleteRequest /tsgoam/fm/alarms/ [{"alarm_id":"CBT22019250000030000000000255100","chassis_ip":"192.168.40.170","operator":"dongxiaoyan","notes":"auto"}]
|
||||
${response} OamDeleteRequest /tsgoam/fm/alarms/ [{"alarm_id":"CBT22019250000010000000003422719","chassis_ip":"192.168.40.165","operator":"dongxiaoyan","notes":"auto"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
|
||||
status-chassis-00001
|
||||
Comment status-chassis-00001 获取板卡的状态 根据chassis或者sled的alarm数量,计算板卡状态:green, yellow, red。返回改chassis下所有sled的状态和chassis的状态
|
||||
${response} OamPostRequest /tsgoam/fm/status/ [{"chassis_ip":"192.168.40.165","chassis_sn":"CBT2201925000001"},{"chassis_ip":"192.168.40.170","chassis_sn":"CBT2201925000003"},{"chassis_ip":"192.168.40.175","chassis_sn":"CBT2201925000004"},{"chassis_ip":"192.168.40.25","chassis_sn":"CBT2201925000200"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 4:${response}
|
||||
${response} OamPostRequest /tsgoam/fm/status/ [{"chassis_ip":"192.168.40.165","chassis_sn":"CBT2201925000001"},{"chassis_ip":"192.168.40.170","chassis_sn":"CBT2201925000003"},{"chassis_ip":"192.168.40.175","chassis_sn":"CBT2201925000004"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 3:${response}
|
||||
${response} OamPostRequest /tsgoam/fm/status/ [{"chassis_ip":"192.168.40.165","chassis_sn":"CBT2201925000001"},{"chassis_ip":"192.168.40.170","chassis_sn":"CBT2201925000003"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 2:${response}
|
||||
${response} OamPostRequest /tsgoam/fm/status/ [{"chassis_ip":"192.168.40.165","chassis_sn":"CBT2201925000001"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 1:${response}
|
||||
|
||||
threshold-chassis-00001
|
||||
Comment threshold-chassis-00001获取设备counter的threshold值
|
||||
${response} OamPostRequest /tsgoam/fm/threshold/ [{"chassis_ip":"192.168.40.165"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 165:${response}
|
||||
${response} OamPostRequest /tsgoam/fm/threshold/ [{"chassis_ip":"192.168.40.170"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 170:${response}
|
||||
${response} OamPostRequest /tsgoam/fm/threshold/ [{"chassis_ip":"192.168.40.25"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 25:${response}
|
||||
|
||||
${response} OamPostRequest /tsgoam/fm/threshold/ [{"chassis_ip":"192.168.40.165"},{"chassis_ip":"192.168.40.170"},{"chassis_ip":"192.168.40.175"},{"chassis_ip":"192.168.40.25"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log 4:${response}
|
||||
thresholds-chassis-00165
|
||||
Comment thresholds-chassis-00001 设置设备counter的threshold值,覆盖更新传入的值
|
||||
${response} OamPostRequest /tsgoam/fm/thresholds/ [{"chassis_ip":"192.168.40.165","Temp_XL710_82599@CBT2201925000001_mcn2_hardware":[ {"critical+":90.5,"critical-":-10.5}, { "major+":80.5,"major-":-5.5}, { "minor+":70.5, "minor-":0.5} ] }]
|
||||
${responseString} Convert To String ${response}
|
||||
${response} OamPostRequest /tsgoam/fm/threshold/ [{"chassis_ip":"192.168.40.165"}]
|
||||
${responseString} Convert To String ${response}
|
||||
${response} OamPostRequest /tsgoam/fm/thresholds/ [{"chassis_ip":"192.168.40.165","Temp_XL710_82599@CBT2201925000001_mcn2_hardware":[ {"critical+":90.0,"critical-":-10.0}, { "major+":80.0,"major-":-5.0}, { "minor+":70.0, "minor-":0.0} ] }]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log ${response}
|
||||
syn-chassis-00170
|
||||
Comment syn-chassis-00001告警强制同步接口
|
||||
${response} OamPostRequest /tsgoam/fm/syn/ [{"chassis_ip":"192.168.40.165","chassis_sn":"CBT2201925000001"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log ${response}
|
||||
######################################################################
|
||||
oamcore-chassis-00165
|
||||
Comment oamcore-chassis-00001 设置oam_core的运行参数
|
||||
#${response} OamPostRequest /tsgoam/settings/oam_core/ [{"chassis_ip":"192.168.40.165","oam.cluster.server.ip":"192.168.40.2110","datasource.second.username":"root1","datasource.second.password":"1111110","oam.writer.scheduler.interval":"600001","oam.writer.scheduler.ipmi.interval":"1800001","logging.level.com.tsg.oam":"DEBUG"}]
|
||||
#${responseString} Convert To String ${response}
|
||||
#Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
${response} OamPostRequest /tsgoam/settings/oam_core/ [{"chassis_ip":"192.168.40.165","oam.cluster.server.ip":"192.168.40.210","datasource.second.username":"root","datasource.second.password":"111111","oam.writer.scheduler.interval":"60000","oam.writer.scheduler.ipmi.interval":"180000","logging.level.com.tsg.oam":"ERROR"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log ${response}
|
||||
|
||||
oamsnmp-chassis-00165
|
||||
Comment oamsnmp-chassis-00001设置oam_snmp的运行参数
|
||||
${response} OamPostRequest /tsgoam/settings/oam_snmp/ [{"chassis_ip":"192.168.40.165","oam.influx.recentminutes":6,"logging.level.com.oam.snmp":"DEBUG"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
|
||||
${response} OamPostRequest /tsgoam/settings/oam_snmp/ [{"chassis_ip":"192.168.40.165","oam.influx.recentminutes":5,"logging.level.com.oam.snmp":"ERROR"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log ${response}
|
||||
|
||||
oamcliagent-chassis-00170
|
||||
Comment oamcliagent-chassis-00001设置cli_agent的运行参
|
||||
${response} OamPostRequest /tsgoam/settings/cli_agent/ [{"chassis_ip":"192.168.40.165","logging.level.com.oam.agent":"DEBUG"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
|
||||
${response} OamPostRequest /tsgoam/settings/cli_agent/ [{"chassis_ip":"192.168.40.165","logging.level.com.oam.agent":"ERROR"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log ${response}
|
||||
|
||||
oamcli-chassis-00001
|
||||
Comment oamcli-chassis-00001设置cli的运行参数
|
||||
${response} OamPostRequest /tsgoam/settings/cli/ [{"chassis_ip":"192.168.40.165","cli.rest.root":"http://192.168.40.4:80821/v1","logging.level.com.cs.oam.cli":"DEBUG"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
${response} OamPostRequest /tsgoam/settings/cli/ [{"chassis_ip":"192.168.40.165","cli.rest.root":"http://192.168.40.4:8082/v1","logging.level.com.cs.oam.cli":"ERROR"}]
|
||||
${responseString} Convert To String ${response}
|
||||
Append To File ${path}/OamApi_file.txt ${responseString}
|
||||
Log ${response}
|
||||
|
||||
writeENDtime
|
||||
${endtime} Get Time
|
||||
Append To File ${path}/OamApi_file.txt ${endtime}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
86
01-TestCase/tsg_ui/ui_accounts/Accountscase.robot
Normal file
86
01-TestCase/tsg_ui/ui_accounts/Accountscase.robot
Normal file
@@ -0,0 +1,86 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-ui accounts
|
||||
Resource ../../../02-Keyword/tsg_ui/accounts/Accountspages.robot
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_ui/accounts/Accounts.robot
|
||||
|
||||
*** Test Cases ***
|
||||
create-user-001
|
||||
#新建Accounts
|
||||
CreatePage 0000 ssjjyy 111111
|
||||
#验证新建是否成功
|
||||
Ui-User-Search-Name 0000
|
||||
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[4]/div/div/span/span
|
||||
log ${name}
|
||||
Should Be Equal As Strings ${name} 0000
|
||||
#删除对象
|
||||
User-Delete
|
||||
|
||||
create-user-002
|
||||
#新建Accounts
|
||||
CreatePage-null ${EMPTY} ${EMPTY} ${EMPTY}
|
||||
|
||||
|
||||
create-user-003
|
||||
#新建Accounts
|
||||
CreatePage 111111111111111111111111111111111 ${EMPTY} ${EMPTY}
|
||||
|
||||
|
||||
create-user-004
|
||||
#新建Accounts
|
||||
CreatePage xiaohong kkkkkk aaaa
|
||||
#验证新建是否成功
|
||||
Ui-User-Search-Name xiaohong
|
||||
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[4]/div/div/span/span
|
||||
log ${name}
|
||||
Should Be Equal As Strings ${name} xiaohong
|
||||
#删除对象
|
||||
User-Delete
|
||||
|
||||
create-user-005
|
||||
#新建Accounts
|
||||
CreatePage 小红 小红 a1@й
|
||||
#验证新建是否成功
|
||||
Ui-User-Search-Name 小红
|
||||
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[4]/div/div/span/span
|
||||
log ${name}
|
||||
Should Be Equal As Strings ${name} 小红
|
||||
#删除对象
|
||||
User-Delete
|
||||
|
||||
create-user-006
|
||||
#新建Accounts
|
||||
CreatePage малый малый малый
|
||||
#验证新建是否成功
|
||||
Ui-User-Search-Name малый
|
||||
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[4]/div/div/span/span
|
||||
log ${name}
|
||||
Should Be Equal As Strings ${name} малый
|
||||
#删除对象
|
||||
User-Delete
|
||||
|
||||
edit-user-007
|
||||
#新建Accounts
|
||||
CreatePage 修改 edit 111111
|
||||
#验证新建是否成功
|
||||
Ui-User-Search-Name 修改
|
||||
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[4]/div/div/span/span
|
||||
log ${name}
|
||||
Should Be Equal As Strings ${name} 修改
|
||||
#修改对象
|
||||
User-Edit edit-1
|
||||
#查询修改对象
|
||||
Ui-User-Search-Name edit-1
|
||||
#删除对象
|
||||
User-Delete
|
||||
|
||||
create-user-008
|
||||
#新建Accounts
|
||||
CreatePage @#!&* *^%$ *^%$
|
||||
#验证新建是否成功
|
||||
Ui-User-Search-Name @#!&*
|
||||
${name} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[4]/div/div/span/span
|
||||
log ${name}
|
||||
Should Be Equal As Strings ${name} @#!&*
|
||||
#删除对象
|
||||
User-Delete
|
||||
43
01-TestCase/tsg_ui/ui_audit/Auditcase.robot
Normal file
43
01-TestCase/tsg_ui/ui_audit/Auditcase.robot
Normal file
@@ -0,0 +1,43 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-ui audit
|
||||
Resource ../../../02-Keyword/tsg_ui/audit/Audit.robot
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_ui/Menu.robot
|
||||
|
||||
*** Test Cases ***
|
||||
search-user-001
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
Ui-User-Search-Name
|
||||
|
||||
search-user-002
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
Ui-User-Search
|
||||
|
||||
search-user-003
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
Ui-User-Search-Operator sunjiangyue
|
||||
|
||||
search-user-004
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
Ui-User-Search-Operator @*%&
|
||||
|
||||
search-user-005
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
Ui-User-Search-Operator a1@й
|
||||
|
||||
search-user-006
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
Ui-User-Search-Operator малый
|
||||
|
||||
19
01-TestCase/tsg_ui/ui_ldap/Ldapcase.robot
Normal file
19
01-TestCase/tsg_ui/ui_ldap/Ldapcase.robot
Normal file
@@ -0,0 +1,19 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-ui accounts
|
||||
Resource ../../../02-Keyword/tsg_ui/ldap/Ldappages.robot
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_ui/ldap/Ldap.robot
|
||||
|
||||
*** Test Cases ***
|
||||
create-user-001
|
||||
#界面
|
||||
Ui-login
|
||||
#新建
|
||||
CreatePage test localhost 25 test ou=People,dc=bifang,dc=com uid 111111
|
||||
|
||||
create-user-002
|
||||
#界面
|
||||
Ui-login
|
||||
#新建
|
||||
CreatePage lucy 192.168.40.204 389 cn=root,dc=bifang,dc=com ou=People,dc=bifang,dc=com uid 11221
|
||||
|
||||
42
01-TestCase/tsg_ui/ui_login/Logincase.robot
Normal file
42
01-TestCase/tsg_ui/ui_login/Logincase.robot
Normal file
@@ -0,0 +1,42 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-ui login
|
||||
Resource ../../../02-Keyword/tsg_ui/login/Login.robot
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_ui/Menu.robot
|
||||
|
||||
*** Test Cases ***
|
||||
search-user-001
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
Ui-User-Search-Name
|
||||
|
||||
search-user-002
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
Ui-User-Search
|
||||
|
||||
search-user-003
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
User-Search-Name sunjiangyue
|
||||
|
||||
search-user-004
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
User-Search-Name @*%&
|
||||
|
||||
search-user-005
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
User-Search-Name a1@й
|
||||
|
||||
search-user-006
|
||||
#打开界面
|
||||
Ui-login
|
||||
#查找
|
||||
User-Search-Name малый
|
||||
26
01-TestCase/tsg_ui/ui_mail/Mailcase.robot
Normal file
26
01-TestCase/tsg_ui/ui_mail/Mailcase.robot
Normal file
@@ -0,0 +1,26 @@
|
||||
*** Settings ***
|
||||
Force Tags tsg-ui audit
|
||||
Resource ../../../02-Keyword/tsg_ui/mail/Mail.robot
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_ui/mail/Mailpages.robot
|
||||
|
||||
*** Test Cases ***
|
||||
create-001
|
||||
|
||||
#新建
|
||||
CreatePage 192.168.40.204 25 test yytest@mail.test.com 111111
|
||||
|
||||
create-002
|
||||
|
||||
#新建
|
||||
CreatePage 192.168.40.204 25 测试 test@mail.test.com test
|
||||
|
||||
create-003
|
||||
|
||||
#新建
|
||||
CreatePage 192.168.40.204 25 @*%& test1@mail.test.com @*%&
|
||||
|
||||
create-004
|
||||
|
||||
#新建
|
||||
CreatePage 192.168.40.204 25 малый ttest@mail.test.com малый
|
||||
@@ -17,7 +17,7 @@ ${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/responsepages
|
||||
${profiledId} ${EMPTY}
|
||||
${target_ip} 10.3.22.129
|
||||
${target_ip} 10.3.22.139
|
||||
# 无DHCP,需要手动设置IP,可用地址段: 10.3.22.[129-254], 掩码: 255.255.255.0, DNS服务器: 10.3.22.11。
|
||||
*** Test Cases ***
|
||||
ZDFY_ActiveDefencePolicy-Flood-00001
|
||||
@@ -44,15 +44,38 @@ ZDFY_ActiveDefencePolicy-Flood-00001
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"active_defence","policyIds":[${policyId}]}
|
||||
|
||||
ZDFY_ActiveDefencePolicy-Flood-00002
|
||||
[Tags] flood TwoPolicyOneprofile
|
||||
[Tags] flood
|
||||
|
||||
${caseName} set variable ZDFY_ActiveDefencePolicy-Flood-00002
|
||||
Comment claimed_src_ip_profile_id
|
||||
${response} BasePostRequest /policy/profile/claimedsrcip body={"opAction":"add","returnData":1,"claimedSrcIpList":[{"profileName":"autotest","addrType":4,"ipList":["10.3.22.0/25"],"isValid":1,"profileDesc":"autotest"}]}
|
||||
${claimed_src_ip_profile_id} Set Variable ${response['data']['list'][0]['profileId']}
|
||||
|
||||
Comment 创建带主动策略Flood
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=active_defence
|
||||
... policyDesc=${caseName}
|
||||
... action=activeDefence
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"flood","l4_protocol":"UDP","target_ip":"${target_ip}","target_port":1234,"rate_pps":1,"claimed_src_ip_profile_id":${claimed_src_ip_profile_id}}
|
||||
... referenceObject=
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"active_defence","policyIds":[${policyId}]}
|
||||
ZDFY_ActiveDefencePolicy-Flood-00003
|
||||
[Tags] flood TwoPolicyOneprofile
|
||||
|
||||
${caseName} set variable ZDFY_ActiveDefencePolicy-Flood-00003
|
||||
Comment claimed_src_ip_profile_id
|
||||
${response} BasePostRequest /policy/profile/claimedsrcip body={"opAction":"add","returnData":1,"claimedSrcIpList":[{"profileName":"autotest","addrType":4,"ipList":["10.3.22.0/25"],"isValid":1,"profileDesc":"autotest"}]}
|
||||
${claimed_src_ip_profile_id} Set Variable ${response['data']['list'][0]['profileId']}
|
||||
|
||||
Comment 创建带主动策略Flood
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
@@ -99,7 +122,7 @@ ZDFY_ActiveDefencePolicy-Flood-00002
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} ${policyId} ${response} EditPolicy ${policyDict2Edit} ${1} disable
|
||||
${rescode} ${policyId} ${response} EditPolicy ${policyDict2Edit} disable
|
||||
${policyDictEdit} Create Dictionary
|
||||
... policyId=${policyId2}
|
||||
... policyName=${caseName}
|
||||
@@ -114,8 +137,8 @@ ZDFY_ActiveDefencePolicy-Flood-00002
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} ${policyId} ${response} EditPolicy ${policyDictEdit} ${1} disable
|
||||
${rescode} ${policyId} ${response} EditPolicy ${policyDict2Edit} ${1} enable
|
||||
${rescode} ${policyId} ${response} EditPolicy ${policyDictEdit} disable
|
||||
${rescode} ${policyId} ${response} EditPolicy ${policyDict2Edit} enable
|
||||
|
||||
|
||||
ZDFY_ActiveDefencePolicy-Reflection-00001
|
||||
|
||||
@@ -21,6 +21,8 @@ ZJJ_ProxyPolicy-Hijack-Ssl-00001
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${objectId}
|
||||
${objectDict} Create Dictionary objectId=${objectId} objectType=url isValid=${1} addItemList=*rutube.html
|
||||
${rescode} ${objectId} EditObject ${objectDict} update
|
||||
Comment 创建hijack文件
|
||||
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test.apk hijack {"isValid":1,"contentType":"application/vnd.android.package-archive","opAction":"add","profileName":"test1","contentName":"Create-Hijack Files-test.apk","profileId":null,"returnData":1}
|
||||
${profiledId} Get From Dictionary ${response} profileId
|
||||
|
||||
247
01-TestCase/zjj/ZJJ_ProxyPolciy-SSL注入比率测试.robot
Normal file
247
01-TestCase/zjj/ZJJ_ProxyPolciy-SSL注入比率测试.robot
Normal file
@@ -0,0 +1,247 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags zjj tsg_adc proxy_policy
|
||||
Library OperatingSystem
|
||||
Resource ../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/ApiRequest.robot
|
||||
Resource ../../03-Variable/AllFlowCaseVariable.txt
|
||||
Resource ../../03-Variable/Policy_Objects_Module.txt
|
||||
Library Custometest
|
||||
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/hijackfiles
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
ZJJ_ProxyPolicy-Hijack-Ssl-大注入比率0.25
|
||||
[Tags] selfserver ssl hijack ip+url
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${objectId}
|
||||
Comment 创建hijack文件
|
||||
#${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack-比率 python-3.8.1-amd64.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test1","contentName":"python-3.8.1-amd64.exe","profileId":null,"returnData":1}
|
||||
#${profiledId} Get From Dictionary ${response} profileId
|
||||
${objectedit} Create Dictionary profileName=ZJJ_ProxyPolicy-Hijack-Ssl-025 contentName=KMSTools.exe contentType=application/x-msdos-program
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ KMSTools.exe ${objectDict}
|
||||
# 查询
|
||||
${profiledId} Get From Dictionary ${response} profileId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=ZJJ_SecurityPolicy-Hijack-Ssl-025 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appObjectIdArray=3
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
Comment 创建管控策略
|
||||
${policyDict} Create Dictionary policyName=ZJJ_ProxyPolicy-Hijack-Ssl-025 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#${rescode} ${policyId3} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"dxytest","policyType":"pxy_manipulation","action":"manipulation","userTags":"","doBlacklist":0,"doLog":2,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"},"isValid":1,"objectIds":[],"objectList":[],"scheduleId":[],"source":[{"objectId":${testClentID},"protocolField":"TSG_SECURITY_SOURCE_ADDR"}],"destination":[],"filterList":[{"filter":[{"objectId":${objectId},"protocolField":"TSG_FIELD_HTTP_URL"}]}],"appIdObjects":[2]}}
|
||||
#删除策略
|
||||
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
|
||||
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
|
||||
... ELSE Create List Connected to open.node.com
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
:FOR ${n} IN RANGE 100
|
||||
SystemCommands ${commandstr} ${stringlist}
|
||||
END
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
log 22${logsize}
|
||||
${logsize} Convert to String ${logsize}
|
||||
Append To File ${path}/enforcement_ratio.txt |ZJJ_ProxyPolicy-Hijack-Ssl-注入比率0.25\r\n
|
||||
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
|
||||
Append To File ${path}/enforcement_ratio.txt ZJJ_ProxyPolicy-Hijack-Ssl-注入比率0.25访问100次logsize:|${logsize}
|
||||
Append To File ${path}/enforcement_ratio.txt s:|${s}
|
||||
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
|
||||
ZJJ_ProxyPolicy-Hijack-Ssl-小注入比率0.25
|
||||
[Tags] selfserver ssl hijack ip+url
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${objectId}
|
||||
Comment 创建hijack文件
|
||||
#${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack-比率 python-3.8.1-amd64.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test1","contentName":"python-3.8.1-amd64.exe","profileId":null,"returnData":1}
|
||||
#${profiledId} Get From Dictionary ${response} profileId
|
||||
${objectedit} Create Dictionary profileName=zmmhjacktest contentName=Create-Hijack Files-test-7.rpm contentType=audio/x-pn-realaudio-plugin
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-7.rpm ${objectDict}
|
||||
# 查询
|
||||
${profiledId} Get From Dictionary ${response} profileId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=ZJJ_SecurityPolicy-Hijack-Ssl-025 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appObjectIdArray=3
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
Comment 创建管控策略
|
||||
${policyDict} Create Dictionary policyName=ZJJ_ProxyPolicy-Hijack-Ssl-025 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#${rescode} ${policyId3} AddPolicy {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"dxytest","policyType":"pxy_manipulation","action":"manipulation","userTags":"","doBlacklist":0,"doLog":2,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"},"isValid":1,"objectIds":[],"objectList":[],"scheduleId":[],"source":[{"objectId":${testClentID},"protocolField":"TSG_SECURITY_SOURCE_ADDR"}],"destination":[],"filterList":[{"filter":[{"objectId":${objectId},"protocolField":"TSG_FIELD_HTTP_URL"}]}],"appIdObjects":[2]}}
|
||||
#删除策略
|
||||
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
|
||||
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
|
||||
... ELSE Create List Connected to open.node.com
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
:FOR ${n} IN RANGE 100
|
||||
SystemCommands ${commandstr} ${stringlist}
|
||||
END
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
log 22${logsize}
|
||||
${logsize} Convert to String ${logsize}
|
||||
Append To File ${path}/enforcement_ratio.txt |ZJJ_ProxyPolicy-Hijack-Ssl-注入比率0.25\r\n
|
||||
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
|
||||
Append To File ${path}/enforcement_ratio.txt ZJJ_ProxyPolicy-Hijack-Ssl-注入比率0.25访问100次logsize:|${logsize}
|
||||
Append To File ${path}/enforcement_ratio.txt s:|${s}
|
||||
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
|
||||
|
||||
ZJJ_ProxyPolicy-Insert-Ssl-大注入比率0.25
|
||||
[Tags] selfserver ssl Hijack ip+url
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${objectId}
|
||||
Comment 创建insert文件
|
||||
${objectedit} Create Dictionary profileName=zmminserttest format=js insertOn=before_page_load
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_insert} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 /policy/profile/insertscripts insert_files/ big.js ${objectDict}
|
||||
# 查询
|
||||
${profiledId} Get From Dictionary ${response} profileId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=ZJJ_SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
Comment 创建管控策略
|
||||
${policyDict} Create Dictionary policyName=ZJJ_ProxyPolicy-Insert-SSL-00001 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
|
||||
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
|
||||
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
|
||||
... ELSE Create List Connected to open.node.com
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
:FOR ${n} IN RANGE 10
|
||||
SystemCommands ${commandstr} ${stringlist}
|
||||
END
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
log 22${logsize}
|
||||
${logsize} Convert to String ${logsize}
|
||||
Append To File ${path}/enforcement_ratio.txt |Insert-Ssl-00001\r\n
|
||||
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
|
||||
Append To File ${path}/enforcement_ratio.txt 0.1访问1000次logsize:|${logsize}
|
||||
Append To File ${path}/enforcement_ratio.txt s:|${s}
|
||||
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
|
||||
|
||||
ZJJ_ProxyPolicy-Insert-Ssl-小注入比率0.25
|
||||
[Tags] selfserver ssl Hijack ip+url
|
||||
Comment 创建url
|
||||
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${objectId}
|
||||
Comment 创建insert文件
|
||||
${objectedit} Create Dictionary profileName=zmminserttest format=js insertOn=before_page_load
|
||||
Comment 打印需要修改的json内容
|
||||
log ${objectedit}
|
||||
${objectDict} Jsoneditmanu ${setting_proxy_profiles_insert} ${objectedit}
|
||||
log ${objectDict}
|
||||
${response} CreatePolicyFile4 /policy/profile/insertscripts insert_files/ Create-Insert Scripts-test-1.js ${objectDict}
|
||||
# 查询
|
||||
${profiledId} Get From Dictionary ${response} profileId
|
||||
Comment 创建安全策略
|
||||
${policyDict} Create Dictionary policyName=ZJJ_SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject= isValid=${1} appObjectIdArray=3
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
Comment 创建管控策略
|
||||
${policyDict} Create Dictionary policyName=ZJJ_ProxyPolicy-Insert-SSL-00001 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL
|
||||
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
|
||||
#删除策略
|
||||
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0001.bat
|
||||
... ELSE set variable curl \ -kv \ https://open.node.com/test/rutube/rutube.html
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connected to open.node.com
|
||||
... ELSE Create List Connected to open.node.com
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
:FOR ${n} IN RANGE 10
|
||||
SystemCommands ${commandstr} ${stringlist}
|
||||
END
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId3}
|
||||
${logsize} GetLogCount proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
log 22${logsize}
|
||||
${logsize} Convert to String ${logsize}
|
||||
Append To File ${path}/enforcement_ratio.txt |Insert-Ssl-00001\r\n
|
||||
Append To File ${path}/enforcement_ratio.txt |-starttime:|${starttime}\r\n
|
||||
Append To File ${path}/enforcement_ratio.txt 0.1访问1000次logsize:|${logsize}
|
||||
Append To File ${path}/enforcement_ratio.txt s:|${s}
|
||||
Append To File ${path}/enforcement_ratio.txt endtime:|${endtime}
|
||||
ZDFY_ActiveDefencePolicy-注入比率0.25
|
||||
[Tags] flood
|
||||
|
||||
${caseName} set variable ZDFY_ActiveDefencePolicy-Flood-00001
|
||||
Comment claimed_src_ip_profile_id
|
||||
${response} BasePostRequest /policy/profile/claimedsrcip body={"opAction":"add","returnData":1,"claimedSrcIpList":[{"profileName":"autotest","addrType":4,"ipList":["10.3.22.0/25"],"isValid":1,"profileDesc":"autotest"}]}
|
||||
${claimed_src_ip_profile_id} Set Variable ${response['data']['list'][0]['profileId']}
|
||||
|
||||
Comment 创建带主动策略Flood
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=active_defence
|
||||
... policyDesc=${caseName}
|
||||
... action=activeDefence
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"flood","l4_protocol":"TCP","target_ip":"${target_ip}","target_port":1234,"rate_pps":1,"claimed_src_ip_profile_id":${claimed_src_ip_profile_id}}
|
||||
... referenceObject=
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"active_defence","policyIds":[${policyId}]}
|
||||
99
01-TestCase/zjj/ZJJ_ProxyPolicy-Hijack.robot
Normal file
99
01-TestCase/zjj/ZJJ_ProxyPolicy-Hijack.robot
Normal file
@@ -0,0 +1,99 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags zjj tsg_proxy replace
|
||||
Library OperatingSystem
|
||||
Resource ../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../03-Variable/PolicyObjectDefault.txt
|
||||
Resource ../../02-Keyword/tsg_common/StmpHandle.robot
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library Custometest
|
||||
Library json
|
||||
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/responsepages
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
ZJJ_ProxyPolicy-Replace-Uri-00001
|
||||
[Tags] selfserver
|
||||
|
||||
${caseName} set variable ZJJ_ProxyPolicy-Replace-Uri-00001
|
||||
# 创建对象-IP
|
||||
# addItemList全参数:(为方便说明,将参数值拆分为几部分,其实际值为单条无空格/回车字符串,每部分内代表的各参数不可跳跃。)
|
||||
# [addrType]|[protocol]|[direction]|[isSession]# 第一部分(可省略)
|
||||
# [clientIpFormat]|[clientIp1]|[clientIp2]|[clientPort1/clientPort2]& 第二部分(不可省略)
|
||||
# [serverIpFormat]|[serverIp1]|[serverIp2]|[serverPort1/serverPort2]| 第三部分(可省略)
|
||||
# [isInitialize]|[itemName]|[itemDesc], 第四部分(可省略)
|
||||
# ...
|
||||
Comment 创建目标IP
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=ip
|
||||
... isValid=1
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_IPobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=CIDR|192.168.100.5|32|0/0&${Default_AddItem_ServerIpFormat}|${Default_AddItem_ServerIp1}|${Default_AddItem_ServerIp2}|${Default_AddItem_ServerPort}|${Default_AddItem_IsInitialize}|${Default_AddItem_ItemName}|${Default_AddItem_ItemDesc}
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${objectId}
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=open.node.com/action
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_URL_Id}
|
||||
|
||||
Comment 创建安全策略,针对所有协议,相当于BlackIP
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}_IPobject
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.1,"protocol":"HTTP"}
|
||||
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
#默认客户端条件类型:clientip or clientsubid ${Default_Client_Type}
|
||||
#... userRegion="'method':'replace','rules':[{'search_in':'http_req_uri','find':'find','replace_with':'replace'}],'enforcement_ratio':0.1,'protocol':'HTTP'"
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
#{"objectId":5668,"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":7732,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}
|
||||
#
|
||||
${disablePolciy} set variable {"opAction":"enable","policyList":[{"policyType":"pxy_manipulation","policyId":[${policyId}]}]}
|
||||
EditPolicy ${disablePolciy}
|
||||
Comment 功能端验证SSL验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/zjj/ZJJ_ProxyPolicy-Replace-Uri-00001.bat
|
||||
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=content-type&resBody=Response Body" https://open.node.com/action
|
||||
|
||||
#${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
#... ELSE Create List Tango Secure Gateway CA X-TG-Construct-By: tfe Content-Disposition: filename="openfile.exe" Failed writing body (0 !=
|
||||
Create List Tango Secure Gateway CA X-TG-Construct-By: tfe Content-Disposition: filename="openfile.exe" Failed writing body (0 !=
|
||||
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
#日志验证
|
||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
|
||||
|
||||
#{"opAction":"add","policyList":{"policyId":"","policyName":"dxytest","policyType":"pxy_manipulation","action":"manipulation","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"阿斯蒂","effectiveRange":{"tag_sets":[[]]},"userRegion":{"method":"replace","rules":[{"search_in":"http_req_uri","find":"find","replace_with":"replace"}],"protocol":"HTTP"},"isValid":0,"scheduleId":[],"appObjectIdArray":[2],"referenceObject":[{"objectId":10103,"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":8337,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]},{"objectId":5668,"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":7732,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}}
|
||||
100
01-TestCase/zjj/ZJJ_ProxyPolicy-Insert.robot
Normal file
100
01-TestCase/zjj/ZJJ_ProxyPolicy-Insert.robot
Normal file
@@ -0,0 +1,100 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags zjj tsg_proxy replace
|
||||
Library OperatingSystem
|
||||
Resource ../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../03-Variable/PolicyObjectDefault.txt
|
||||
Resource ../../02-Keyword/tsg_common/StmpHandle.robot
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library Custometest
|
||||
Library json
|
||||
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/responsepages
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
ZJJ_ProxyPolicy-Replace-Uri-00001
|
||||
[Tags] selfserver
|
||||
|
||||
${caseName} set variable ZJJ_ProxyPolicy-Replace-Uri-00001
|
||||
# 创建对象-IP
|
||||
# addItemList全参数:(为方便说明,将参数值拆分为几部分,其实际值为单条无空格/回车字符串,每部分内代表的各参数不可跳跃。)
|
||||
# [addrType]|[protocol]|[direction]|[isSession]# 第一部分(可省略)
|
||||
# [clientIpFormat]|[clientIp1]|[clientIp2]|[clientPort1/clientPort2]& 第二部分(不可省略)
|
||||
# [serverIpFormat]|[serverIp1]|[serverIp2]|[serverPort1/serverPort2]| 第三部分(可省略)
|
||||
# [isInitialize]|[itemName]|[itemDesc], 第四部分(可省略)
|
||||
# ...
|
||||
Comment 创建目标IP
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=ip
|
||||
... isValid=1
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_IPobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=CIDR|192.168.100.5|32|0/0&${Default_AddItem_ServerIpFormat}|${Default_AddItem_ServerIp1}|${Default_AddItem_ServerIp2}|${Default_AddItem_ServerPort}|${Default_AddItem_IsInitialize}|${Default_AddItem_ItemName}|${Default_AddItem_ItemDesc}
|
||||
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set Variable ${objectId}
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=open.node.com/action
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_URL_Id}
|
||||
|
||||
Comment 创建安全策略,针对所有协议,相当于BlackIP
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}_IPobject
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_res_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.1,"protocol":"HTTP"}
|
||||
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
#默认客户端条件类型:clientip or clientsubid ${Default_Client_Type}
|
||||
#... userRegion="'method':'replace','rules':[{'search_in':'http_req_uri','find':'find','replace_with':'replace'}],'enforcement_ratio':0.1,'protocol':'HTTP'"
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
#{"objectId":5668,"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":7732,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}
|
||||
#
|
||||
${disablePolciy} set variable {"opAction":"enable","policyList":[{"policyType":"pxy_manipulation","policyId":[${policyId}]}]}
|
||||
EditPolicy ${disablePolciy}
|
||||
Comment 功能端验证SSL验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/zjj/ZJJ_ProxyPolicy-Replace-Uri-00001.bat
|
||||
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=find&setCookie=set-cookie&contentType=content-type&resBody=Response Body" https://open.node.com/action
|
||||
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
#OpenSSL SSL_connect: Connection was reset in connection to
|
||||
#Send failure: Connection was reset
|
||||
... ELSE Create List OpenSSL SSL_connect: Connection reset by peer in connection to
|
||||
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
#日志验证
|
||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
|
||||
|
||||
#{"opAction":"add","policyList":{"policyId":"","policyName":"dxytest","policyType":"pxy_manipulation","action":"manipulation","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"阿斯蒂","effectiveRange":{"tag_sets":[[]]},"userRegion":{"method":"replace","rules":[{"search_in":"http_req_uri","find":"find","replace_with":"replace"}],"protocol":"HTTP"},"isValid":0,"scheduleId":[],"appObjectIdArray":[2],"referenceObject":[{"objectId":10103,"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":8337,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]},{"objectId":5668,"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":7732,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}}
|
||||
437
01-TestCase/zjj/ZJJ_ProxyPolicy-Redirect-SSL.robot
Normal file
437
01-TestCase/zjj/ZJJ_ProxyPolicy-Redirect-SSL.robot
Normal file
@@ -0,0 +1,437 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags tsg_adc Proxy_Policy
|
||||
Library OperatingSystem
|
||||
Resource ../../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../../03-Variable/AllFlowCaseVariable.txt
|
||||
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
ProxyPolicy-Redirect-ssl-00001
|
||||
[Tags] Redirect IP+FQDN+url
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_lj", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_lj", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*lianjia.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable {"opAction":"add","returnData":1,"policyList":{"policyId":"","policyName":"SecurityPolicy-Intercept-Https-00001","policyType":"tsg_security","action":"intercept","userTags":"${Default_UserTags}","doBlacklist":0,"doLog":1,"policyDesc":"${Default_PolicyDesc} ","effectiveRange":{"tag_sets":[[{"tag":"Location","value":["Almaty"],"ids":[2]},{"tag":"ISP","value":["transtel","tnsplus"],"ids":[5,6]}],[{"tag":"Location","value":["Nursurtan"],"ids":[3]},{"tag":"ISP","value":["ktel-mask","ktel-bng","ktel-mxpe"],"ids":[7,8,9]}]]},"userRegion":{"protocol":"SSL","keyring":1,"dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"protocol_errors":1,"cert_pinning":1},"certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"pass-through"},"protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1},"decrypt_mirror":{"enable":0,"mirror_profile":null}},"referenceObject":[{"objectId":8718,"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":8716,"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":8719,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]},{"objectId":8742,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]}],"isValid":0,"scheduleId":[7],"appObjectIdArray":[3]}}
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_lj", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_lj", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "ershoufang" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://www.bytedance.com/zh", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://www.bytedance.com/zh", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}, \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://www.bytedance.com/zh", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00001.bat
|
||||
#${commandstr} set variable curl -kv https://bj.lianjia.com/ershoufang/
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00001.bat
|
||||
... ELSE set variable curl -kv https://bj.lianjia.com/ershoufang/
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: bj.lianjia.com 302 Found Location: https://www.bytedance.com/zh
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host lianjia.com
|
||||
|
||||
ProxyPolicy-Redirect-ssl-00004
|
||||
[Tags] Redirect IP+FQDN+请求body selfserver
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*open.node.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "action" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建body对象
|
||||
${rescodeip} ${object_body_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"keywords", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_body_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_body_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "123456" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "12312" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_body_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00004", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://live.gushidaoshi.com/rank", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00004", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://live.gushidaoshi.com/rank", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ {"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},\ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00004", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://live.gushidaoshi.com/rank", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00004.bat
|
||||
#${commandstr} set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=123456&setCookie=set-cookie&contentType=content-type&resBody=Response Body" https://open.node.com/action
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00004.bat
|
||||
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=123456&setCookie=set-cookie&contentType=content-type&resBody=Response Body" https://open.node.com/action
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: open.node.com 301 Moved Permanently Location: http://live.gushidaoshi.com/rank
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
|
||||
ProxyPolicy-Redirect-ssl-00005
|
||||
[Tags] Redirect ip+url
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_youtube", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_tt", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "$www.toutiao.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_tt", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_tt", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "www.toutiao.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00005", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://video.cnfol.com/wptzj/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00005", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://video.cnfol.com/wptzj/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00005", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://video.cnfol.com/wptzj/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00005.bat
|
||||
#${commandstr} set variable curl -kv https://www.toutiao.com/ch/news_hot/
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00005.bat
|
||||
... ELSE set variable curl -kv https://www.toutiao.com/ch/news_hot/
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: www.toutiao.com 302 Found Location: http://video.cnfol.com/wptzj/
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.toutiao.com
|
||||
|
||||
ProxyPolicy-Redirect-ssl-00007
|
||||
[Tags] Redirect 请求UA+url
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_gk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_gk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*gamersky.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_gk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_gk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "gamersky.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建UA对象
|
||||
${rescodeip} ${object_UA_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"http_signature","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"jwc_http_UA","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["Mozilla/5.0*"],"isHexbin":0,"district":"User-Agent"}],"updateItemList":[],"deleteItemIds":[]}}
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00007", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://video.cnfol.com/wptzj/", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_UA_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00007", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://video.cnfol.com/wptzj/", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_UA_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00007", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "http://video.cnfol.com/wptzj/", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_UA_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00007.bat
|
||||
#${commandstr} set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.gamersky.com/news/
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00007.bat
|
||||
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.gamersky.com/news/
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: www.gamersky.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 301 Moved Permanently Location: http://video.cnfol.com/wptzj/
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host www.gamersky.com
|
||||
|
||||
ProxyPolicy-Redirect-ssl-00008
|
||||
[Tags] Redirect 应答CT+url
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_nk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_nk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*nationalbank.kz" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_nk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_nk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "nationalbank" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建CT对象
|
||||
${rescodeip} ${object_CT_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"http_signature","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"jwc_http_CT","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["text/html; charse*"],"isHexbin":0,"district":"Content-Type"}],"updateItemList":[],"deleteItemIds":[]}}
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00008", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CT_Id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00008", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CT_Id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00008", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CT_Id},"protocolFields":["TSG_FIELD_HTTP_RES_HDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00008.bat
|
||||
#${commandstr} set variable curl -kv https://nationalbank.kz/
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00008.bat
|
||||
... ELSE set variable curl -kv https://nationalbank.kz/
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: nationalbank.kz 302 Found Location: https://open.douyin.com/platform/
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host nationalbank.kz
|
||||
|
||||
ProxyPolicy-Redirect-ssl-00009
|
||||
[Tags] Redirect 请求body+url selfserver
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*open.node.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "action" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建body对象
|
||||
${rescodeip} ${object_body_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"keywords", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_body_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_body_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "123456" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "12312" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_body_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00009", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00009", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00009", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00009.bat
|
||||
#${commandstr} set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=123456&setCookie=set-cookie&contentType=content-type&resBody=Response Body" https://open.node.com/action
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00009.bat
|
||||
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=123456&setCookie=set-cookie&contentType=content-type&resBody=Response Body" https://open.node.com/action
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: open.node.com 301 Moved Permanently Location: https://open.douyin.com/platform/
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
|
||||
ProxyPolicy-Redirect-ssl-00010
|
||||
[Tags] Redirect IP+cat+url+请求UA+应答CT(英文)
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_youtube", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_tt", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*twitch.tv" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_tt", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_tt", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "directory" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建UA对象
|
||||
${rescodeip} ${object_UA_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"http_signature","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"jwc_http_UA","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["Mozilla/5.0*"],"isHexbin":0,"district":"User-Agent"}],"updateItemList":[],"deleteItemIds":[]}}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
|
||||
#创建CT对象
|
||||
${rescodeip} ${object_CT_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"http_signature","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"jwc_http_CT","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["text/html"],"isHexbin":0,"district":"Content-Type"}],"updateItemList":[],"deleteItemIds":[]}}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00010", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://vk.com/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CT_Id},"protocolFields": ["TSG_FIELD_HTTP_RES_HDR"]},{"objectId":${object_UA_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00010", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://vk.com/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CT_Id},"protocolFields": ["TSG_FIELD_HTTP_RES_HDR"]},{"objectId":${object_UA_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00010", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://vk.com/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_CT_Id},"protocolFields": ["TSG_FIELD_HTTP_RES_HDR"]},{"objectId":${object_UA_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_HDR"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00010.bat
|
||||
#${commandstr} set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.twitch.tv/directory
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00010.bat
|
||||
... ELSE set variable curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.twitch.tv/directory
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: www.twitch.tv User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 302 Found Location: https://vk.com/
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host twitch.tv
|
||||
|
||||
ProxyPolicy-Redirect-ssl-00011
|
||||
[Tags] Redirect IP+FQDN+url(俄文)
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_youtube", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_tt", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*zakon.kz" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_tt", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_tt", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "www.zakon.kz/top_news/" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00011", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://www.nur.kz/", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00011", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://www.nur.kz/", "code": 301,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_FQDN_Id},"protocolFields":["TSG_FIELD_HTTP_HOST"]},{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00011.bat
|
||||
#${commandstr} set variable curl -kv https://www.zakon.kz/top_news/
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00011.bat
|
||||
... ELSE set variable curl -kv https://www.zakon.kz/top_news/
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: www.zakon.kz 301 Moved Permanently Location: https://www.nur.kz/
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host zakon.kz
|
||||
|
||||
ProxyPolicy-Redirect-ssl-00012
|
||||
[Tags] Redirect selfserver 请求body(俄文)+url
|
||||
#创建fqdn
|
||||
${rescodeip} ${object_FQDN_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"fqdn", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_fqdn_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_fqdn_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*open.node.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
log ${object_FQDN_Id}
|
||||
#删除对象
|
||||
${objectids} set Variable ${object_FQDN_Id}
|
||||
#创建安全策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":0, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_SSL_SNI"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"SecurityPolicy-Intercept-Https-00001", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"tsg_security", \ \ \ \ \ \ \ \ \ \ \ \ "action":"intercept", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ \ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"SSL", \ \ \ \ "protocol_version":{"allow_http2":1, \ \ \ \ \ \ \ \ \ \ "min":"ssl3", \ \ \ \ \ \ \ \ \ "max":"tls13", \ \ \ \ \ \ \ \ \ "mirror_client":1}, \ \ \ \ "dynamic_bypass":{"mutual_authentication":1, \ \ \ \ "cert_pinning":1,"cert_transparency":0, \ \ \ \ "protocol_errors":1,"ev_cert":0}, \ \ \ \ "decrypt_mirror":{"enable":0}, \ \ \ \ "certificate_checks":{"fail_action":"pass-through", \ \ \ \ "approach":{"self-signed":1, \ \ \ \ "expiration":1, \ \ \ \ "cn":1, \ \ \ \ "issuer":1}}, \ \ \ \ "keyring":1}, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${object_FQDN_Id}, \ \ \ \ \ \ \ \ "protocolFields":["TSG_FIELD_HTTP_HOST"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[3] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId} AddPolicy ${addPolicyStr}
|
||||
log ${policyId}
|
||||
#删除安全策略
|
||||
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
|
||||
${policyIds} Create List ${policyId1}
|
||||
#创建管控对象url
|
||||
${rescodeip} ${object_url_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"url", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_url_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_url_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "action" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "*jd.com" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
|
||||
#创建body对象
|
||||
${rescodeip} ${object_body_Id} AddObject { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "objectList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "objectType":"keywords", \ \ \ \ \ \ \ \ \ \ \ \ "objectName":"jwc_body_bk", \ \ \ \ \ \ \ \ \ \ \ \ "objectDesc":"jwc_body_bk", \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0, \ \ \ \ \ \ \ \ \ \ \ \ "isExclusion":0, \ \ \ \ \ \ \ \ \ \ \ \ "subObjectIds":[], \ \ \ \ \ \ \ \ \ \ \ \ "addItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "рускйсекс" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemName":"item name", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "itemDesc":"item description", \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "keywordArray":[ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "12312" \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isHexbin":0, \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "isInitialize":0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "updateItemList":[ \ \ \ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ \ \ \ \ "deleteItemIds":[ \ \ \ \ \ \ \ \ \ \ \ \ ] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
#删除对象
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_body_Id}
|
||||
#创建管控策略
|
||||
#${addPolicyStr} set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00009", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${addPolicyStr} run keyword if '${addTestClentIPFlag}'=='1' set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00009", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[{"objectId":${testClentID},"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
... ELSE set variable { \ \ \ \ "opAction":"add", \ \ \ \ "returnData":1, \ \ \ \ "policyList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "policyId":"", \ \ \ \ \ \ \ \ \ \ \ \ "isValid":1, \ \ \ \ \ \ \ \ \ \ \ \ "policyName":"ProxyPolicy-Redirect-Https-00009", \ \ \ \ \ \ \ \ \ \ \ \ "policyType":"pxy_manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "action":"manipulation", \ \ \ \ \ \ \ \ \ \ \ \ "userTags":"", \ \ \ \ \ \ \ \ \ \ \ \ "doBlacklist":0, \ \ \ \ \ \ \ \ \ \ \ \ "doLog":1, \ \ \ \ \ \ \ \ \ \ \ \ "userRegion":{ "method": "redirect", "to": "https://open.douyin.com/platform/", "code": 302,\ \ \ \ \ \ \ \ \ \ \ \ \ "protocol":"HTTP" \ \ \ \ }, \ \ \ \ \ \ \ \ \ \ \ \ "referenceObject":[ \ \ \ \ \ \ \ \ {"objectId":${object_url_Id},"protocolFields": ["TSG_FIELD_HTTP_URL"]},{"objectId":${object_body_Id},"protocolFields":["TSG_FIELD_HTTP_REQ_CONTENT"]}], \ \ \ \ \ \ \ \ \ \ \ \ "scheduleId":[],"appObjectIdArray":[2] \ \ \ \ \ \ \ \ } \ \ \ \ ] }
|
||||
${rescode} ${policyId3} AddPolicy ${addPolicyStr}
|
||||
log ${policyId3}
|
||||
${policyId2} set variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
|
||||
#删除所有策略
|
||||
${policyIds} Create List ${policyId1} ${policyId2}
|
||||
#功能端验证
|
||||
#${commandstr} set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00012.bat
|
||||
#${commandstr} set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=рускйсекс&setCookie=set-cookie&contentType=content-type&resBody=Response Body" https://open.node.com/action
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/ProxyPolicy_Redirect_ssl00012.bat
|
||||
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=рускйсекс&setCookie=set-cookie&contentType=content-type&resBody=Response Body" https://open.node.com/action
|
||||
${stringlist} Create List Tango Secure Gateway CA Host: open.node.com 302 Found Location: https://open.douyin.com/platform/
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
log ${rescode}
|
||||
${s} Convert to String ${policyId3}
|
||||
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
654
01-TestCase/zjj/ZJJ_ProxyPolicy-Replace2.robot
Normal file
654
01-TestCase/zjj/ZJJ_ProxyPolicy-Replace2.robot
Normal file
@@ -0,0 +1,654 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags zjj tsg_proxy replace
|
||||
Library OperatingSystem
|
||||
Resource ../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../03-Variable/PolicyObjectDefault.txt
|
||||
Resource ../../02-Keyword/tsg_common/StmpHandle.robot
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library Custometest
|
||||
Library json
|
||||
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/decryption
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
#添加测试数据
|
||||
ZJJ_ProxyPolicy-131Replace-ResbodyReqbocy-00001
|
||||
[Tags] selfserver SIP+DIP+URL
|
||||
${caseName} set variable ZJJ_ProxyPolicy-131Replace-ResbodyReqbocy-00001
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=www.baidu.com
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set variable ${objectids} ${object_URL_Id}
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$www.baidu.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
#{"opAction":"add","returnData":0,"list":[{"profileName":"dxytest","profileDesc":"","isValid":1,"decryption":{"dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1},"certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"},"protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}}}]}
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
|
||||
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
|
||||
${data} set variable ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
${decryption_profile} Get From Dictionary ${response} profileId
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=intercept
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
|
||||
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
|
||||
... referenceObject=${object_FQDN_Id}|TSG_FIELD_SSL_SNI
|
||||
... isValid=1
|
||||
... appObjectIdArray=${3}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
|
||||
Comment 创建带有比例的替换策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_resp_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.5,"protocol":"HTTP"}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
|
||||
ZJJ_ProxyPolicy-131Replace-ResbodyReqbocy-00002
|
||||
[Tags] selfserver SIP+DIP+URL
|
||||
${caseName} set variable ZJJ_ProxyPolicy-131Replace-ResbodyReqbocy-00002
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=www.jd.com
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_URL_Id}
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$www.jd.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
|
||||
${data} set variable ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
${decryption_profile} Get From Dictionary ${response} profileId
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=intercept
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
|
||||
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
|
||||
... referenceObject=${object_FQDN_Id}|TSG_FIELD_SSL_SNI
|
||||
... isValid=1
|
||||
... appObjectIdArray=${3}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
|
||||
Comment 创建带有比例的替换策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_resp_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":0.9999,"protocol":"HTTP"}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
|
||||
|
||||
#添加测试数据
|
||||
ZJJ_ProxyPolicy-131Redirect-00001
|
||||
[Tags] selfserver SIP+DIP+URL
|
||||
${caseName} set variable ZJJ_ProxyPolicy-131Redirect-00001
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=www.tmall.com
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set variable ${objectids} ${object_URL_Id}
|
||||
|
||||
#创建fqdn
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$www.tmall.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
#{"opAction":"add","returnData":0,"list":[{"profileName":"dxytest","profileDesc":"","isValid":1,"decryption":{"dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1},"certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"},"protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}}}]}
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
|
||||
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
|
||||
${data} set variable ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
${decryption_profile} Get From Dictionary ${response} profileId
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=intercept
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
|
||||
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
|
||||
... referenceObject=${object_FQDN_Id}|TSG_FIELD_SSL_SNI
|
||||
... isValid=1
|
||||
... appObjectIdArray=${3}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
#{"opAction":"add","policyList":{"policyId":"","policyName":"dxytest","policyType":"pxy_manipulation","action":"manipulation",
|
||||
#"userTags":"","doBlacklist":0,"doLog":2,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},
|
||||
#"userRegion":{"method":"redirect","to":"https://zhidao.baidu.com","code":302,"protocol":"HTTP"},
|
||||
#"isValid":0,"scheduleId":[],"appObjectIdArray":[2],"referenceObject":[{"objectId":1192,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]},{"objectId":1194,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}}
|
||||
Comment 创建带有比例的替换策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"redirect","to":"https://zhidao.baidu.com","code":302,"enforcement_ratio":0.5,"protocol":"HTTP"}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
|
||||
ZJJ_ProxyPolicy-131Redirect-00002
|
||||
[Tags] selfserver SIP+DIP+URL
|
||||
${caseName} set variable ZJJ_ProxyPolicy-131Redirect-00002
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=www.vip.com
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_URL_Id}
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$www.vip.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
|
||||
${data} set variable ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
${decryption_profile} Get From Dictionary ${response} profileId
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=intercept
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
|
||||
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
|
||||
... referenceObject=${object_FQDN_Id}|TSG_FIELD_SSL_SNI
|
||||
... isValid=1
|
||||
... appObjectIdArray=${3}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
|
||||
Comment 创建带有比例的替换策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_resp_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":1,"protocol":"HTTP"}
|
||||
... userRegion={"method":"redirect","to":"http://image.baidu.com/","code":301,"enforcement_ratio":0.9999,"protocol":"HTTP"}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
|
||||
|
||||
|
||||
#添加测试数据
|
||||
ZJJ_ProxyPolicy-131Hjack-00001
|
||||
[Tags] selfserver SIP+DIP+URL
|
||||
${caseName} set variable ZJJ_ProxyPolicy-131Hjack-00001
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=www.126.com
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set variable ${objectids} ${object_URL_Id}
|
||||
|
||||
#创建fqdn
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$www.126.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
#{"opAction":"add","returnData":0,"list":[{"profileName":"dxytest","profileDesc":"","isValid":1,"decryption":{"dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1},"certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"},"protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}}}]}
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
|
||||
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
|
||||
${data} set variable ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
${decryption_profile} Get From Dictionary ${response} profileId
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=intercept
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
|
||||
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
|
||||
... referenceObject=${object_FQDN_Id}|TSG_FIELD_SSL_SNI
|
||||
... isValid=1
|
||||
... appObjectIdArray=${3}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
#{"opAction":"add","policyList":{"policyId":"","policyName":"dxytest","policyType":"pxy_manipulation","action":"manipulation","userTags":"","doBlacklist":0,"doLog":2,"policyDesc":"",
|
||||
#"effectiveRange":{"tag_sets":[[]]},
|
||||
#"userRegion":{"method":"hijack","hijack_profile":2,"protocol":"HTTP"}
|
||||
#,"isValid":0,"scheduleId":[],"appObjectIdArray":[2],"referenceObject":[{"objectId":1192,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]},{"objectId":1187,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}}
|
||||
Comment 创建带有比例的替换策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"hijack","hijack_profile":2,"enforcement_ratio":0.5,"protocol":"HTTP"}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
|
||||
ZJJ_ProxyPolicy-131Hjack-00002
|
||||
[Tags] selfserver SIP+DIP+URL
|
||||
${caseName} set variable ZJJ_ProxyPolicy-131Hjack-00002
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=www.jd.com
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set variable ${object_URL_Id}
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$www.jd.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
|
||||
${data} set variable ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
${decryption_profile} Get From Dictionary ${response} profileId
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=intercept
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
|
||||
... referenceObject=${object_FQDN_Id}|TSG_FIELD_SSL_SNI
|
||||
... isValid=1
|
||||
... appObjectIdArray=${3}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
|
||||
Comment 创建带有比例的替换策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_resp_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":1,"protocol":"HTTP"}
|
||||
... userRegion={"method":"hijack","hijack_profile":2,"enforcement_ratio":0.9999,"protocol":"HTTP"}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
#添加测试数据
|
||||
ZJJ_ProxyPolicy-131Insert-00001
|
||||
[Tags] selfserver SIP+DIP+URL
|
||||
${caseName} set variable ZJJ_ProxyPolicy-131Insert-00001
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=www.tmall.com
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set variable ${objectids} ${object_URL_Id}
|
||||
|
||||
#创建fqdn
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$www.tmall.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
#{"opAction":"add","returnData":0,"list":[{"profileName":"dxytest","profileDesc":"","isValid":1,"decryption":{"dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1},"certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"},"protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}}}]}
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileDesc":"autotest_decryption_add","isValid":1,"decryption":{${dynamic_bypass},${certificate_checks},${protocol_version}}}]}
|
||||
#{"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"profileDesc":"autotest"}]}}
|
||||
${data} set variable ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
${decryption_profile} Get From Dictionary ${response} profileId
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=intercept
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"protocol":"SSL","protocol_version":{"allow_http2":1,"min":"ssl3","max":"tls13","mirror_client":1},"dynamic_bypass":{"mutual_authentication":1,"cert_pinning":1,"cert_transparency":0,"protocol_errors":1,"ev_cert":0},"decrypt_mirror":{"enable":0},"certificate_checks":{"fail_action":"pass-through","approach":{"self-signed":1,"expiration":1,"cn":1,"issuer":1}},"keyring":1}
|
||||
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
|
||||
... referenceObject=${object_FQDN_Id}|TSG_FIELD_SSL_SNI
|
||||
... isValid=1
|
||||
... appObjectIdArray=${3}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
#{"opAction":"add","policyList":{"policyId":"","policyName":"dxytest","policyType":"pxy_manipulation","action":"manipulation","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},
|
||||
#"userRegion":{"method":"insert","insert_profile":2,"protocol":"HTTP"}
|
||||
#,"isValid":0,"scheduleId":[],"appObjectIdArray":[2],"referenceObject":[{"objectId":1192,"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":1194,"protocolFields":["TSG_FIELD_HTTP_URL"]}]}}
|
||||
Comment 创建带有比例的替换策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"method":"insert","insert_profile":2,"enforcement_ratio":0.5,"protocol":"HTTP"}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
|
||||
ZJJ_ProxyPolicy-131Insert-00002
|
||||
[Tags] selfserver SIP+DIP+URL
|
||||
${caseName} set variable ZJJ_ProxyPolicy-131Insert-00002
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=www.jd.com
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} set variable ${object_URL_Id}
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$www.jd.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
|
||||
${dynamic_bypass} set variable "dynamic_bypass":{"ev_cert":1,"cert_transparency":1,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1}
|
||||
${protocol_version} set variable "protocol_version":{"min":"","max":"","mirror_client":1,"allow_http2":1}
|
||||
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"fail-close"}
|
||||
${requestbody} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
|
||||
${data} set variable ${requestbody}
|
||||
${response} CreatePolicyFileNoFile ${url} ${data}
|
||||
${decryption_profile} Get From Dictionary ${response} profileId
|
||||
Comment 创建拦截策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=intercept
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"protocol":"SSL","keyring":1,"decryption":${decryption_profile},"decrypt_mirror":{"enable":0,"mirror_profile":null}}
|
||||
... referenceObject=${object_FQDN_Id}|TSG_FIELD_SSL_SNI
|
||||
... isValid=1
|
||||
... appObjectIdArray=${3}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
|
||||
Comment 创建带有比例的替换策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=pxy_manipulation
|
||||
... policyDesc=${Default_PolicyDesc}
|
||||
... action=manipulation
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
#... userRegion={"method":"replace","rules":[{"search_in":"http_req_body","find":"find","replace_with":"replace"},{"search_in":"http_resp_body","find":"replace","replace_with":"replacetest"}],"enforcement_ratio":1,"protocol":"HTTP"}
|
||||
... userRegion={"method":"insert","insert_profile":2,"enforcement_ratio":0.9999,"protocol":"HTTP"}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL
|
||||
... isValid=1
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
|
||||
${s} Convert to String ${policyId}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]} {"policyType":"pxy_manipulation","policyIds":[${policyId}]}
|
||||
142
01-TestCase/zjj/ZJJ_SecurityPolicy_Http2.robot
Normal file
142
01-TestCase/zjj/ZJJ_SecurityPolicy_Http2.robot
Normal file
@@ -0,0 +1,142 @@
|
||||
*** Settings ***
|
||||
Test Teardown DeletePolicyAndObject ${policyIds} ${objectids}
|
||||
Force Tags zjj tsg_proxy replace
|
||||
Library OperatingSystem
|
||||
Resource ../../02-Keyword/tsg_adc/SystemCommand.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/LogVariable.robot
|
||||
Resource ../../03-Variable/PolicyObjectDefault.txt
|
||||
Resource ../../02-Keyword/tsg_common/StmpHandle.robot
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Library Custometest
|
||||
Library json
|
||||
|
||||
*** Variables ***
|
||||
${policyIds} ${EMPTY}
|
||||
${objectids} ${EMPTY}
|
||||
${url} /policy/profile/responsepages
|
||||
${profiledId} ${EMPTY}
|
||||
|
||||
*** Test Cases ***
|
||||
ZJJ_SecurityPolicy-Deny-Http-Alert00001
|
||||
[Tags] ZJJ HttpAlert
|
||||
${caseName} set variable ZJJ_SecurityPolicy-Deny-Http-Alert00001
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=url
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_URLobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=open.node.com/action
|
||||
${rescode} ${object_URL_Id} AddObject2 ${1} ${objectDict}
|
||||
#${objectids} Catenate SEPARATOR=, ${objectids} ${object_URL_Id}
|
||||
${objectids} set Variable ${object_URL_Id}
|
||||
|
||||
#创建url
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=fqdn
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_fqdnobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$open.node.com
|
||||
${rescode} ${object_FQDN_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_FQDN_Id}
|
||||
|
||||
#创建Resheader
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=http_signature
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_http_signatureheaderobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=JSESSIONID=976F28F6C1A5B803B0CDF5FF3E1D2725|Set-Cookie
|
||||
${rescode} ${object_ResH_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ResH_Id}
|
||||
|
||||
#创建ReqHeader
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=http_signature
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_http_signatureheaderobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=$JSESSIONID=976F28F6C1A5B803B0CDF5FF3E1D2725|Cookie
|
||||
${rescode} ${object_ReqH_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ReqH_Id}
|
||||
|
||||
#创建ResBocy
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=keywords
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_http_keywordsobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=创建ResBocy*
|
||||
${rescode} ${object_ResB_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ResB_Id}
|
||||
|
||||
#创建ReqBody
|
||||
${objectDict} Create Dictionary
|
||||
... objectType=keywords
|
||||
... isValid=${1}
|
||||
... objectSubType=${Default_ObjectSubType}
|
||||
... isInitialize=${Default_IsInitialize}
|
||||
... isExclusion=${Default_IsExclusion}
|
||||
... objectName=${caseName}_http_keywordsobject
|
||||
... objectDesc=${Default_ObjectDesc}
|
||||
... subObjectIds=${Default_SubObjectIds}
|
||||
... addItemList=*创建ReqBocy
|
||||
${rescode} ${object_ReqB_Id} AddObject2 ${1} ${objectDict}
|
||||
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ReqB_Id}
|
||||
|
||||
# 新增
|
||||
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
|
||||
${profiledId} Get From Dictionary ${response} profileId
|
||||
Comment 创建Deny策略
|
||||
${policyDict} Create Dictionary
|
||||
... policyName=${caseName}
|
||||
... policyType=tsg_security
|
||||
... policyDesc=${caseName}
|
||||
... action=deny
|
||||
... effectiveRange=${Default_EffectiveRange}
|
||||
... userRegion={"protocol": "HTTP","method":"alert","code":200,"html_profile":${profiledId}}
|
||||
... referenceObject=${object_URL_Id}|TSG_FIELD_HTTP_URL,${object_FQDN_Id}|TSG_FIELD_HTTP_HOST,${object_ReqH_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_ResH_Id}|TSG_FIELD_HTTP_RES_HDR,${object_ReqB_Id}|TSG_FIELD_HTTP_REQ_CONTENT,${object_ResB_Id}|TSG_FIELD_HTTP_RES_CONTENT
|
||||
... appObjectIdArray=${2}
|
||||
... userTags=${Default_UserTags}
|
||||
... doLog=${Default_DoLog}
|
||||
... scheduleId=${Default_ScheduleId}
|
||||
|
||||
${rescode} ${securitypolicyId} AddPolicy2 ${1} ${policyDict}
|
||||
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${securitypolicyId}]}
|
||||
|
||||
Comment 功能端验证HTTP验证
|
||||
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0001.bat
|
||||
... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html
|
||||
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
|
||||
... ELSE Create List Connection reset by peer
|
||||
${starttime} Get Time
|
||||
Sleep ${policyVerificationSleepSeconds}s
|
||||
${rescode} SystemCommands ${commandstr} ${stringlist}
|
||||
Sleep ${policyLogVerificationSleepSeconds}s
|
||||
${endtime} Get Time
|
||||
#日志验证
|
||||
${s} Convert to String ${policyId}
|
||||
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
|
||||
@@ -7,7 +7,7 @@ Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Post-Request
|
||||
[Arguments] ${url} ${data}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
Create Session api http://${host}:${port}/${version} headers=${header}
|
||||
Create Session api http://${host}:${port} headers=${header}
|
||||
${remoteResponse} Post Request api ${url} data=${data} headers=${header}
|
||||
${response} to json ${remoteResponse.content}
|
||||
Should Be Equal As Strings ${remoteResponse.status_code} 200
|
||||
@@ -16,7 +16,7 @@ Post-Request
|
||||
Get-Request
|
||||
[Arguments] ${url}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
Create Session api http://${host}:${port}/${version} headers=${header}
|
||||
Create Session api http://${host}:${port} headers=${header}
|
||||
${remoteResponse} Get Request api ${url} headers=${header}
|
||||
${response} to json ${remoteResponse.content}
|
||||
Should Be Equal As Strings ${remoteResponse.status_code} 200
|
||||
@@ -25,7 +25,7 @@ Get-Request
|
||||
Delete-Request
|
||||
[Arguments] ${url} ${data}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
Create Session api http://${host}:${port}/${version} headers=${header}
|
||||
Create Session api http://${host}:${port} headers=${header}
|
||||
${remoteResponse} Delete Request api ${url} data=${data} headers=${header}
|
||||
${response} to json ${remoteResponse.content}
|
||||
Should Be Equal As Strings ${remoteResponse.status_code} 200
|
||||
@@ -34,7 +34,7 @@ Delete-Request
|
||||
UpFilePostRequest
|
||||
[Arguments] ${url} ${data} ${files} ${fileDesc}
|
||||
${header} Set To Dictionary ${fileDesc} Authorization=${token}
|
||||
Create Session api http://${host}:${port}/${version} headers=${header}
|
||||
Create Session api http://${host}:${port} headers=${header}
|
||||
${remoteResponse} Post Request api ${url} data=${data} files=${files} headers=${header}
|
||||
${response} to json ${remoteResponse.content}
|
||||
Should Be Equal As Strings ${remoteResponse.status_code} 200
|
||||
@@ -43,7 +43,7 @@ UpFilePostRequest
|
||||
UpFilePutRequest
|
||||
[Arguments] ${url} ${data} ${files} ${fileDesc}
|
||||
${header} Set To Dictionary ${fileDesc} Authorization=${token}
|
||||
Create Session api http://${host}:${port}/${version} headers=${header}
|
||||
Create Session api http://${host}:${port} headers=${header}
|
||||
${remoteResponse} Put Request api ${url} params=${data} files=${files} headers=${header}
|
||||
${response} to json ${remoteResponse.content}
|
||||
Should Be Equal As Strings ${remoteResponse.status_code} 200
|
||||
|
||||
@@ -1,12 +1,32 @@
|
||||
*** Settings ***
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library REST http://${host}:${port}/${version}
|
||||
Library REST http://${host}:${port}
|
||||
Library Collections
|
||||
Library RequestsLibrary
|
||||
|
||||
*** Keywords ***
|
||||
ManageApistr
|
||||
[Documentation]
|
||||
... 描述:入口,apistr 为调用api地址
|
||||
... 本关键字的作用是判断地址前有没有加版本号,如果没有加上
|
||||
... policy/compile -> /v1/policy/compile
|
||||
... /policy/compile -> /v1/policy/compile
|
||||
... v1/policy/compile -> /v1/policy/compile
|
||||
... /v1/policy/compile -> /v1/policy/compile
|
||||
[Arguments] ${apistr}
|
||||
${apiStart} Evaluate '${apistr}'[0:1]
|
||||
${apiStart1} Evaluate '${apistr}'[0:2]
|
||||
${apistr} Run Keyword If "${apiStart}"!="/" and "${apiStart}"!="v"
|
||||
... Set Variable /${version}/${apistr}
|
||||
... ELSE IF "${apiStart}"=="/" and "${apiStart1}"!="/v"
|
||||
... Set Variable /${version}${apistr}
|
||||
... ELSE IF "${apiStart}"=="v" Set Variable /${apistr}
|
||||
... ELSE IF "${apiStart1}"=="/v" Set Variable ${apistr}
|
||||
... ELSE Set Variable ${apistr}
|
||||
log ${apistr}
|
||||
[Return] ${apistr}
|
||||
BasePostRequest
|
||||
[Arguments] ${apistr} ${body}
|
||||
[Arguments] ${apistr} ${body}
|
||||
Set Headers {"Authorization":"${token}","Content-Type":"application/json"}
|
||||
log 111111111111111111111111${apistr}
|
||||
&{httpResponse} Post ${apistr} ${body}
|
||||
@@ -16,22 +36,38 @@ BasePostRequest
|
||||
#Array $.data.policyList
|
||||
${response} Set Variable ${httpResponse.body}
|
||||
[Return] ${response}
|
||||
|
||||
BasePostRequestForV2
|
||||
[Arguments] ${requestUri} ${data} ${apiVersion}
|
||||
${headers} set variable {"Authorization":"${token}","Content-Type":"application/json"}
|
||||
create session api http://${host}:${port}/${apiVersion} ${headers}
|
||||
${response}= Post Request api ${requestUri} data=${data}
|
||||
log return data =${response}
|
||||
Should Be Equal As Strings ${response.status_code} 200
|
||||
${response} to json ${response.content}
|
||||
[Return] ${response}
|
||||
BaseGetRequest
|
||||
[Arguments] ${apistr} ${body}
|
||||
Set Headers {"Authorization":"${token}","Content-Type":"application/json"}
|
||||
&{httpResponse} Get ${apistr}?${body}
|
||||
&{httpResponse} Get /${apistr}?${body}
|
||||
#Output response body
|
||||
Object response body
|
||||
#Integer $.code 200
|
||||
#Array $.data.policyList
|
||||
${response} Set Variable ${httpResponse.body}
|
||||
[Return] ${response}
|
||||
|
||||
BaseGetRequestForV2
|
||||
[Arguments] ${requestUri} ${data} ${apiVersion}
|
||||
${headers} set variable {"Authorization":"${token}","Content-Type":"application/json"}
|
||||
create session api http://${host}:${port}/${apiVersion} ${headers}
|
||||
${response}= Get Request api ${requestUri}?${data}
|
||||
log return data =${response}
|
||||
Should Be Equal As Strings ${response.status_code} 200
|
||||
${response} to json ${response.content}
|
||||
[Return] ${response}
|
||||
BaseDeleteRequest
|
||||
[Arguments] ${requestUri} ${data}
|
||||
${headers} set variable {"Authorization":"${token}","Content-Type":"application/json"}
|
||||
create session api http://${host}:${port}/${version} ${headers}
|
||||
create session api http://${host}:${port} ${headers}
|
||||
${response}= Delete Request api ${requestUri} data=${data}
|
||||
log return data =${response}
|
||||
Should Be Equal As Strings ${response.status_code} 200
|
||||
@@ -41,9 +77,16 @@ BaseDeleteRequest
|
||||
BaseEditRequest
|
||||
[Arguments] ${requestUri} ${data}
|
||||
${headers} set variable {"Authorization":"${token}","Content-Type":"application/json"}
|
||||
create session api http://${host}:${port}/${version} ${headers}
|
||||
create session api http://${host}:${port} ${headers}
|
||||
${response}= Put Request api ${requestUri} data=${data}
|
||||
log return data =${response}
|
||||
Should Be Equal As Strings ${response.status_code} 200
|
||||
${response} to json ${response.content}
|
||||
[Return] ${response}
|
||||
BaseEditRequestForV2
|
||||
[Arguments] ${requestUri} ${data} ${apiVersion}
|
||||
${apiStart} Evaluate '${requestUri}'[0:1]
|
||||
${requestUri} Run Keyword If "${apiStart}"=="/" set variable /${apiVersion}${requestUri}
|
||||
... ELSE set variable /${apiVersion}/${requestUri}
|
||||
${response} BaseEditRequest ${requestUri} ${data}
|
||||
[Return] ${response}
|
||||
15
02-Keyword/tsg_bfapi/CommonUtil.robot
Normal file
15
02-Keyword/tsg_bfapi/CommonUtil.robot
Normal file
@@ -0,0 +1,15 @@
|
||||
*** Settings ***
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library DateTime
|
||||
Library String
|
||||
#Library Collections
|
||||
#Library RequestsLibrary
|
||||
|
||||
*** Keywords ***
|
||||
GetLast24HoursStartAndEndTime
|
||||
[Documentation]
|
||||
... 获取当前时间往前一天的开始结束时间,时间格式为:YYY-MM-DD H24:mm:ss
|
||||
${endtime} Get Time
|
||||
${starttime}= Add Time To Date ${endtime} -1 days
|
||||
${starttime} Get Substring ${starttime} 0 19
|
||||
[Return] ${starttime} ${endtime}
|
||||
8
02-Keyword/tsg_bfapi/Filter.robot
Normal file
8
02-Keyword/tsg_bfapi/Filter.robot
Normal file
@@ -0,0 +1,8 @@
|
||||
*** Settings ***
|
||||
Resource PolicyObject.robot
|
||||
|
||||
*** Keywords ***
|
||||
Filter
|
||||
[Arguments] ${file} ${name} ${lowBoundary} ${upBoundary}
|
||||
${rescodeip} ${object_FQDN_Id} AddObject {"opAction": "add","returnData": 1,"objectList": {"objectType": "${file}","isValid": 1,"isInitialize": 0,"isExclusion": 0,"objectName": "${name}","objectDesc": "","subObjectIds": [],"addItemList": [{"itemName": "file_size","lowBoundary":${lowBoundary},"upBoundary":${upBoundary}}]}}
|
||||
|
||||
@@ -10,7 +10,7 @@ Library REST http://${host}:${port}
|
||||
GetLogCondition
|
||||
[Arguments] ${logname} ${startTime} ${endTime} ${client_ip} ${policy_id}
|
||||
Set Headers {"Content-Type":"application/x-www-form-urlencoded","Authorization":"${token}"}
|
||||
&{LogSchemaResponse}= GET /log/schema?logType=${logname}
|
||||
&{LogSchemaResponse}= GET /${version}/log/schema?logType=${logname}
|
||||
log ${logname}
|
||||
#Output Schema response body
|
||||
Object response body
|
||||
@@ -28,14 +28,14 @@ GetLogCondition
|
||||
PostRemoteData
|
||||
[Arguments] ${url} ${data}
|
||||
${header} Create Dictionary Content-Type=application/json Authorization=${token}
|
||||
Create Session api http://${host}:${port}/${version} headers=${header}
|
||||
Create Session api http://${host}:${port} headers=${header}
|
||||
${remoteResponse} Post Request api ${url} data=${data} headers=${header}
|
||||
[Return] ${remoteResponse}
|
||||
|
||||
GetALLLogCondition
|
||||
[Arguments] ${logname} ${startTime} ${endTime} ${client_ip} ${policy_id} ${pageSize} ${pageNo}
|
||||
Set Headers {"Content-Type":"application/x-www-form-urlencoded","Authorization":"${token}"}
|
||||
&{LogSchemaResponse}= GET /log/schema?logType=${logname}
|
||||
&{LogSchemaResponse}= GET /${version}/log/schema?logType=${logname}
|
||||
log ${logname}
|
||||
#Output Schema response body
|
||||
Object response body
|
||||
@@ -53,7 +53,7 @@ GetALLLogCondition
|
||||
GetLogCountConditon
|
||||
[Arguments] ${logname} ${startTime} ${endTime} ${client_ip} ${policy_id} ${pageSize} ${pageNo}
|
||||
Set Headers {"Content-Type":"application/x-www-form-urlencoded","Authorization":"${token}"}
|
||||
&{LogSchemaResponse}= GET /log/schema?logType=${logname}
|
||||
&{LogSchemaResponse}= GET /${version}/log/schema?logType=${logname}
|
||||
log ${logname}
|
||||
#Output Schema response body
|
||||
Object response body
|
||||
|
||||
@@ -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
|
||||
@@ -243,7 +244,7 @@ Recommend
|
||||
Trend
|
||||
[Arguments] ${url} ${startTime} ${endTime} ${logType} ${policyId}
|
||||
${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} headers=${header}
|
||||
${remoteResponse} Get Request api ${url}?policyId=${policyId}&logType=${logType}&startTime=${startTime}&endTime=${endTime} 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
*** Settings ***
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource LogSchema.robot
|
||||
Library REST http://${host}:${port}/${version}
|
||||
Library REST http://${host}:${port}
|
||||
Library RequestsLibrary
|
||||
Library OperatingSystem
|
||||
Library Collections
|
||||
@@ -12,7 +12,7 @@ GetLogList
|
||||
[Arguments] ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} ${parmkey} ${parmvalue}
|
||||
${logCondition} GetLogCondition ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id}
|
||||
log ${logCondition}
|
||||
${LogListResponse} PostRemoteData /log/list ${logCondition}
|
||||
${LogListResponse} PostRemoteData /${version}/log/list ${logCondition}
|
||||
Should Be Equal As Strings ${LogListResponse.status_code} 200
|
||||
${returnData} To Json ${LogListResponse.content}
|
||||
${responseCode} Get From Dictionary ${returnData} code
|
||||
@@ -40,7 +40,7 @@ GetLogListSize
|
||||
[Arguments] ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} ${parmkey} ${parmvalue}
|
||||
${logCondition} GetALLLogCondition ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} 10000 1
|
||||
log ${logCondition}
|
||||
${LogListResponse} PostRemoteData /log/list ${logCondition}
|
||||
${LogListResponse} PostRemoteData /${version}/log/list ${logCondition}
|
||||
Should Be Equal As Strings ${LogListResponse.status_code} 200
|
||||
${returnData} To Json ${LogListResponse.content}
|
||||
${data} Get From Dictionary ${returnData} data
|
||||
@@ -51,7 +51,7 @@ GetLogListSize
|
||||
GetLogCount
|
||||
[Arguments] ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} ${parmkey} ${parmvalue}
|
||||
${logCondition} GetALLLogCondition ${logType} ${startTime} ${endTime} ${client_ip} ${policy_id} 10000 1
|
||||
${LogListResponse} PostRemoteData /log/count ${logCondition}
|
||||
${LogListResponse} PostRemoteData /${version}/log/count ${logCondition}
|
||||
Should Be Equal As Strings ${LogListResponse.status_code} 200
|
||||
${returnData} To Json ${LogListResponse.content}
|
||||
${len} Set Variable ${LogListResponse.json()}[data][total]
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -7,7 +7,7 @@ Resource ../tsg_bfapi/ApiRequest.robot
|
||||
|
||||
*** Keywords ***
|
||||
schema
|
||||
${responsedata} Get-Request log/schema?logType=active_defence_event_log
|
||||
${responsedata} Get-Request /v1/log/schema?logType=active_defence_event_log
|
||||
${responsedata1} Get From Dictionary ${responsedata} data
|
||||
${responsefields} Get From Dictionary ${responsedata1} fields
|
||||
[Return] ${responsedata}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
*** Settings ***
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library REST http://${host}:${port}/${version}
|
||||
Library REST http://${host}:${port}
|
||||
Library Collections
|
||||
Library SSHLibrary
|
||||
Resource PolicyObject.robot
|
||||
@@ -13,7 +13,7 @@ Login
|
||||
[Tags] tsg_adc tsg_bf_api
|
||||
#[Arguments] ${username} ${password} ${authmode} ${authCode} ${ldapId}
|
||||
# 毕方接口用户名密码
|
||||
GET /user/encryptpwd?password=${password}
|
||||
GET /${version}/user/encryptpwd?password=${password}
|
||||
Object response body
|
||||
#OUTPUT response body
|
||||
#${rescode} Integer $.code
|
||||
@@ -33,7 +33,7 @@ Login
|
||||
#getToken##################################################################################
|
||||
#log ${username}
|
||||
#log ${pwdstr}
|
||||
POST /user/login?username=${username}&password=${encodePassword}&authMode=${authmode}
|
||||
POST /${version}/user/login?username=${username}&password=${encodePassword}&authMode=${authmode}
|
||||
Object response body
|
||||
#OUTPUT response body
|
||||
Integer $.code 200
|
||||
@@ -51,7 +51,7 @@ Login
|
||||
|
||||
Logout
|
||||
[Tags] tsg_adc tsg_bf_api
|
||||
POST /user/logout headers=${headers}
|
||||
POST /${version}/user/logout headers=${headers}
|
||||
Object response body
|
||||
Integer $.code 200
|
||||
${rescode} Integer $.code
|
||||
|
||||
@@ -3,7 +3,7 @@ Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Resource ../tsg_common/ManagePolicyBody.robot
|
||||
Resource ../tsg_common/ManageObjectBody.robot
|
||||
Resource ../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
|
||||
Library REST http://${host}:${port}/${version}
|
||||
Library REST http://${host}:${port}
|
||||
Library Collections
|
||||
Library RequestsLibrary
|
||||
Resource Common.robot
|
||||
@@ -52,34 +52,37 @@ AddLocalIPObject
|
||||
|
||||
DelLocalIPObject
|
||||
log to_DelLocalIPObject
|
||||
${response} BaseDeleteRequest /policy/object {"objectIds":[${testClentID}]}
|
||||
${response} BaseDeleteRequest /${version}/policy/object {"objectIds":[${testClentID}]}
|
||||
#${response_code} Get From Dictionary ${response} code
|
||||
#Should Be Equal As Strings ${response} {'code': 200, 'msg': 'Success', 'success': True}
|
||||
SET GLOBAL VARIABLE ${testClentID} ${EMPTY}
|
||||
${response} BaseDeleteRequest /policy/object {"objectIds":[${testClentSubID}]}
|
||||
${response} BaseDeleteRequest /${version}/policy/object {"objectIds":[${testClentSubID}]}
|
||||
SET GLOBAL VARIABLE ${testClentSubID} ${EMPTY}
|
||||
|
||||
AddObject
|
||||
[Arguments] ${body}
|
||||
#addIPobject#################################################################################
|
||||
${response} BasePostRequest /policy/object body=${body}
|
||||
${response} BasePostRequest /${version}/policy/object body=${body}
|
||||
#log ${response}
|
||||
${objectId} Set Variable ${response['data']['objectList'][0]['objectId']}
|
||||
${rescodeReturn} Set Variable ${response['code']}
|
||||
[Return] ${rescodeReturn} ${objectId}
|
||||
|
||||
AddObject2
|
||||
[Arguments] ${returnData} ${policyList}
|
||||
${body} ObjectParamsOpertion ${returnData} ${policyList}
|
||||
[Arguments] ${returnData} ${objectList}
|
||||
${body} ObjectParamsOpertion ${returnData} ${objectList} add
|
||||
|
||||
${response} BasePostRequest /policy/object body=${body}
|
||||
${response} BasePostRequest /${version}/policy/object body=${body}
|
||||
${objectId} Set Variable ${response['data']['objectList'][0]['objectId']}
|
||||
${rescodeReturn} Set Variable ${response['code']}
|
||||
[Return] ${rescodeReturn} ${objectId}
|
||||
|
||||
EditObject
|
||||
[Arguments] @{body}
|
||||
[Return] ${rescode} ${objectId}
|
||||
[Arguments] ${objectList} ${opAction}
|
||||
${body} ObjectParamsOpertion ${0} ${objectList} ${opAction}
|
||||
${response} BaseEditRequest /${version}/policy/object ${body}
|
||||
${rescodeReturn} Set Variable ${response['code']}
|
||||
[Return] ${rescodeReturn}
|
||||
|
||||
DeleteObjectbak
|
||||
[Arguments] ${objectids}
|
||||
@@ -96,14 +99,14 @@ DeleteObjectbak
|
||||
|
||||
AddPolicy
|
||||
[Arguments] ${body}
|
||||
${response} BasePostRequest /policy/compile body=${body}
|
||||
${response} BasePostRequest /${version}/policy/compile body=${body}
|
||||
#log ${response}
|
||||
${policyId} Set Variable ${response['data']['policyList'][0]['policyId']}
|
||||
${rescode} Set Variable ${response['code']}
|
||||
[Return] ${rescode} ${policyId}
|
||||
QueryPolicy
|
||||
[Arguments] ${body}
|
||||
${response} BaseGetRequest /policy/compile body=${body}
|
||||
${response} BaseGetRequest /${version}/policy/compile body=${body}
|
||||
#log ${response}
|
||||
${rescode} Set Variable ${response['code']}
|
||||
[Return] ${rescode} ${response}
|
||||
@@ -111,11 +114,22 @@ AddPolicy2
|
||||
[Arguments] ${returnData} ${policyList}
|
||||
${body} PolicyParamsOpertion ${returnData} ${policyList} add
|
||||
|
||||
${response} BasePostRequest /policy/compile body=${body}
|
||||
${response} BasePostRequest /${version}/policy/compile body=${body}
|
||||
${policyId} Set Variable ${response['data']['policyList'][0]['policyId']}
|
||||
${rescode} Set Variable ${response['code']}
|
||||
[Return] ${rescode} ${policyId}
|
||||
AddPolicy2006
|
||||
[Arguments] ${returnData} ${policyList}
|
||||
${objectDict} Jsoneditmanu ${policyall} ${policyList}
|
||||
#${body} Convert To String ${objectDict}
|
||||
${body} json.Dumps ${objectDict}
|
||||
#${body} PolicyParamsOpertion ${returnData} ${policyList} add
|
||||
|
||||
${response} BasePostRequest /${version}/policy/compile body=${body}
|
||||
${policyId} Set Variable ${response['data']['policyList'][0]['policyId']}
|
||||
${rescode} Set Variable ${response['code']}
|
||||
[Return] ${rescode} ${policyId}
|
||||
|
||||
EditPolicy
|
||||
[Arguments] ${policyList} ${opAction}
|
||||
|
||||
@@ -124,14 +138,14 @@ EditPolicy
|
||||
#disable:表示停用,只修改isValid属性为0
|
||||
#enable:表示启用,只修改isValid属性为1
|
||||
${body} PolicyParamsOpertion ${0} ${policyList} ${opAction}
|
||||
${response} BaseEditRequest /policy/compile ${body}
|
||||
${response} BaseEditRequest /${version}/policy/compile ${body}
|
||||
${rescode} Set Variable ${response['code']}
|
||||
[Return] ${rescode} ${response}
|
||||
|
||||
DeletePolicybak
|
||||
[Arguments] ${policyids}
|
||||
${body} String {"policyType":"tsg_security","policyIds":[${policyids}]}
|
||||
DELETE /policy/compile body=${body} headers=${headers}
|
||||
DELETE /${version}/policy/compile body=${body} headers=${headers}
|
||||
Object response body
|
||||
log DeletePolicy
|
||||
Output response body
|
||||
@@ -143,7 +157,7 @@ DeletePolicy
|
||||
[Arguments] ${body}
|
||||
#删除策略
|
||||
log toDeletePolicy_DeletePolicyDeletePolicy
|
||||
${response} BaseDeleteRequest /policy/compile ${body}
|
||||
${response} BaseDeleteRequest /${version}/policy/compile ${body}
|
||||
#{"policyType":"tsg_security","policyIds":[${policyids}]}
|
||||
${response_code} Get From Dictionary ${response} code
|
||||
Should Be Equal As Strings ${response_code} 200
|
||||
@@ -155,7 +169,7 @@ DeleteObject
|
||||
[Arguments] ${objectids}
|
||||
#删除对象
|
||||
log todeleteobj
|
||||
${response} BaseDeleteRequest /policy/object {"objectIds":[${objectids}]}
|
||||
${response} BaseDeleteRequest /${version}/policy/object {"objectIds":[${objectids}]}
|
||||
${response_code} Get From Dictionary ${response} code
|
||||
#log aaaaaaaaaa:${response_code}
|
||||
Should Be Equal As Strings ${response_code} 200
|
||||
@@ -163,7 +177,24 @@ DeleteObject
|
||||
${response} Convert to String ${response}
|
||||
log ${response}
|
||||
#Should Be Equal As Strings ${response} {'code': 200, 'msg': 'Success', 'success': True}
|
||||
|
||||
|
||||
DeleteProfile
|
||||
[Arguments] ${typeUrl} ${profileIds}
|
||||
#删除对象
|
||||
log DeleteProfile
|
||||
${response} BaseDeleteRequest /${version}/policy/profile/${typeUrl} {"profileIds":[${profileIds}]}
|
||||
${response_code} Get From Dictionary ${response} code
|
||||
#log aaaaaaaaaa:${response_code}
|
||||
Should Be Equal As Strings ${response_code} 200
|
||||
#Integer ${response_code} 200
|
||||
${response} Convert to String ${response}
|
||||
log ${response}
|
||||
#Should Be Equal As Strings ${response} {'code': 200, 'msg': 'Success', 'success': True}
|
||||
DeleteProfiles
|
||||
[Arguments] ${profiles}
|
||||
FOR ${profile} IN @{profiles}
|
||||
Run Keyword If "${profile}"!="" and ${profile}!="${EMPTY}" DeleteProfile ${profile}[typeUrl] ${profile}[profileIds]
|
||||
END
|
||||
DeletePolicyAndObject
|
||||
[Arguments] ${policyids} ${objectids}
|
||||
#删除和对象
|
||||
@@ -179,8 +210,29 @@ DeletePolicyAndObject
|
||||
#删除对象
|
||||
log todeleteobj_DeletePolicyAndObject
|
||||
Run Keyword If "${objectids}"=="${EMPTY}" log no obj to del
|
||||
... ELSE DeleteObject ${objectids}
|
||||
|
||||
... ELSE DeleteObject ${objectids}
|
||||
|
||||
DeletePolicyAndObjectAndProfile
|
||||
[Arguments] ${policyids} ${objectids} ${profiles}
|
||||
DeletePolicyAndObject ${policyids} ${objectids}
|
||||
DeleteProfiles ${profiles}
|
||||
DeleteAfterCase
|
||||
[Arguments] ${policyids} ${objectids}
|
||||
Run Keyword If '${testPart}'=='all' or '${testPart}'=='3' DeletePolicyAndObject ${policyids} ${objectids}
|
||||
DeletePolicyAndObject1
|
||||
[Arguments] ${policyids} ${objectids} ${url} ${profiledId}
|
||||
#删除策略
|
||||
log toDeletePolicy_DeletePolicyAndObject
|
||||
${listlenth}= Get Length ${policyids}
|
||||
FOR ${var} IN RANGE ${listlenth}
|
||||
log ${var}
|
||||
DeletePolicy ${policyids}[${var}]
|
||||
END
|
||||
#删除对象
|
||||
log todeleteobj_DeletePolicyAndObject
|
||||
Run Keyword If "${objectids}"=="${EMPTY}" log no obj to del
|
||||
... ELSE DeleteObject ${objectids}
|
||||
#删除文件
|
||||
log todeleteobj_DeletePolicyAndObject
|
||||
Run Keyword If "${profiledId}"=="${EMPTY}" log no file to del
|
||||
... ELSE DeletePolicyFile1 ${url} ${profiledId}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
*** Settings ***
|
||||
Resource ../../03-Variable/BifangApiVariable.txt
|
||||
Library REST http://${host}:${port}/${version}
|
||||
Library REST http://${host}:${port}
|
||||
Library Collections
|
||||
Library RequestsLibrary
|
||||
Resource Common.robot
|
||||
@@ -9,7 +9,7 @@ Resource Common.robot
|
||||
ApiAddTags
|
||||
[Arguments] ${body}
|
||||
#ApiAddTags#################################################################################
|
||||
${response} BasePostRequest /customize/tags body=${body}
|
||||
${response} BasePostRequest /${version}/customize/tags body=${body}
|
||||
#log ${response}
|
||||
${tagId} Set Variable ${response['data']['tagList'][0]['id']}
|
||||
${rescodeReturn} Set Variable ${response['code']}
|
||||
@@ -23,7 +23,7 @@ ApiDeleteTags
|
||||
[Arguments] ${body}
|
||||
#删除策略
|
||||
log toApiDeleteTags
|
||||
${response} BaseDeleteRequest /customize/tags ${body}
|
||||
${response} BaseDeleteRequest /${version}/customize/tags ${body}
|
||||
${response_code} Get From Dictionary ${response} code
|
||||
Should Be Equal As Strings ${response_code} 200
|
||||
${response} Convert to String ${response}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user