313 Commits

Author SHA1 Message Date
gaochengrui
009cee44c2 Update BifangApiVariable.txt 2020-06-30 17:00:02 +08:00
gaochengrui
75c2a38c01 更新文档 2020-06-23 10:18:14 +08:00
gaochengrui
b29fdf0b29 同步到两台服务器 2020-06-23 09:58:01 +08:00
gaochengrui
3ad59e41de 1 2020-06-22 18:32:37 +08:00
gaochengrui
9a6f33a22d 1 2020-06-22 18:31:30 +08:00
gaochengrui
6f13eb5e3c `1 2020-06-22 18:28:54 +08:00
gaochengrui
6adb137468 1 2020-06-22 18:24:03 +08:00
gaochengrui
9b3d88178d 1 2020-06-22 18:01:37 +08:00
gaochengrui
3df6e275af 1 2020-06-22 17:41:52 +08:00
gaochengrui
7f5caeef81 1 2020-06-22 17:39:13 +08:00
gaochengrui
2c9aee7dbd 1 2020-06-22 17:30:07 +08:00
gaochengrui
3df5c2f490 Update docker-compose.yml 2020-06-22 17:05:48 +08:00
gaochengrui
4521e6d3d1 Update docker-compose.yml 2020-06-22 17:05:21 +08:00
gaochengrui
b5e18f6584 Update .gitlab-ci.yml 2020-06-22 17:00:37 +08:00
gaochengrui
1f3013a5cd Update docker-compose.yml 2020-06-22 17:00:04 +08:00
gaochengrui
98805f5688 Update .gitlab-ci.yml 2020-06-22 16:58:46 +08:00
gaochengrui
660cac41de Update .gitlab-ci.yml 2020-06-22 16:57:31 +08:00
gaochengrui
2205378992 Update docker-compose.yml 2020-06-22 16:56:19 +08:00
gaochengrui
cbda2f4247 Update docker-compose.yml 2020-06-22 16:50:43 +08:00
gaochengrui
0ddb38d37a Update docker-compose.yml 2020-06-22 16:46:47 +08:00
gaochengrui
24e8c56184 修改 文件夹名字 2020-06-19 11:42:29 +08:00
gaochengrui
b26fe07caf 更新文档 2020-06-19 11:36:38 +08:00
gaochengrui
513d0ce671 修改文档 2020-06-19 10:45:48 +08:00
gaochengrui
98a37f5ee1 自动化迁移丶集成丶部署文档 2020-06-19 10:30:37 +08:00
gaochengrui
79eee3754d 1 2020-06-19 10:04:28 +08:00
gaochengrui
0704cd2172 1 2020-06-18 18:52:14 +08:00
gaochengrui
a5d909ff29 加入自动集成部署 2020-06-18 18:50:39 +08:00
dongxiaoyan
fc79ac3782 1、添加时间工具关键字
2、调整部分错误
2020-06-18 13:46:16 +08:00
dongxiaoyan
a3f9d64293 修改适应Linux部分调整更正 2020-06-18 12:07:05 +08:00
姬巍川
b439b79e90 由于python2和python3的print打印方法不一致,将打印删除 2020-06-18 11:43:44 +08:00
dongxiaoyan
e49dc6ae44 1、调整示例适应对应关键字调整;
2、调整用例中引用文件错误
2020-06-18 11:37:02 +08:00
dongxiaoyan
578115e865 1、调整版本掺入位置,适应版本变化;
2、调整日志查询时间范围为当前;
3、调整case引用文件路径错误;
2020-06-18 11:19:51 +08:00
dongxiaoyan
0c697853fc 调整版本参数位置,适应将来接口版本变化 2020-06-18 10:37:13 +08:00
dongxiaoyan
969dc7bf1c 目录移动到setting,删除此目录 2020-06-18 10:30:16 +08:00
dongxiaoyan
34c02dec90 linux下对字符串转换的不识别'${str}'.rindex('}') + 1
调整为:${testStr1}      Catenate    '''    ${str}       '''
    ${testIndex3}    Evaluate    ${testStr1}.rindex(

windows、linux下测试通过。
2020-06-18 10:06:08 +08:00
dongxiaoyan
bbc604f568 删除多个地方添加版本号导致的问题 2020-06-17 19:31:54 +08:00
liuyuanfang
d6daa601f0 优化report模块接口关键字 2020-06-17 18:58:40 +08:00
wangxin
a567786cd7 feat:(策略启用停用):优化关键字,策略启用停用只用传policyId,policyType,不处理其他的字典字段 2020-06-17 18:53:58 +08:00
liuyuanfang
2d673f6711 上传Report的增删改查case 2020-06-17 18:45:01 +08:00
liuyuanfang
a7d05c205c 上传Report的增删改查case 2020-06-17 18:44:29 +08:00
liuyuanfang
f1161f84c9 上传Report的增删改查case 2020-06-17 18:44:06 +08:00
liuyuanfang
7418b65cf2 上传Report的增删改查case 2020-06-17 18:43:41 +08:00
liuyuanfang
ab51260399 上传Report的增删改查case 2020-06-17 18:43:13 +08:00
liuyuanfang
a4c9e2bbcd 上传Report的增删改查case 2020-06-17 18:42:56 +08:00
liuyuanfang
82a3fb4945 上传Report的增删改查case 2020-06-17 18:42:24 +08:00
liuyuanfang
20c0e70a39 新建report用例目录 2020-06-17 18:41:04 +08:00
liuyuanfang
e675444a62 优化report的接口关键字 2020-06-17 18:36:18 +08:00
liuyuanfang
1864e8b3cd 上传report接口的keywords 2020-06-17 18:35:11 +08:00
liuyuanfang
c3e18a4586 新建目录offline_stat_report 2020-06-17 18:33:51 +08:00
wangxin
707268f0aa docs:(修正两个keyword说明)policyList修改为policy 2020-06-17 14:12:41 +08:00
wangxin
ca22cc7ba7 feat:(v2策略)支持update,enable,disable 2020-06-16 19:40:59 +08:00
wangxin
e9893ac45d fix:(test case)主动防御测试用例删除profileId 2020-06-16 18:13:05 +08:00
wangxin
8a41c0112b fix:(v2版本策略)1:AddPolicies参数说明
2:v2版本主动防御支持
3:添加主动防御测试用例
2020-06-16 16:52:32 +08:00
dongxiaoyan
b6cd16e91c 从公共部分删除参数版本 2020-06-16 16:43:14 +08:00
dongxiaoyan
a2b1f8e435 从公共参数删除版本路径,修改部分不正确路径引用 2020-06-16 16:42:04 +08:00
wangxin
d49bacc3ac feat:(v2版本接口)v2版本策略查询与策略新增keyword提交 2020-06-16 15:10:02 +08:00
姬巍川
c090a8e543 修改11用例关键字 2020-06-16 14:51:55 +08:00
姬巍川
e968f84c0c 修改删除关键字 2020-06-16 14:49:24 +08:00
姬巍川
75c5a4c6e5 修改删除关键字 2020-06-16 14:39:15 +08:00
姬巍川
d8827dfb8f 修改删除关键字 2020-06-16 11:52:37 +08:00
姬巍川
3b0fbc9477 修改删除关键字 2020-06-16 11:51:59 +08:00
姬巍川
543ea25db2 修改删除关键字 2020-06-16 11:51:25 +08:00
姬巍川
99d3d9b64f 修改删除关键字 2020-06-16 11:50:51 +08:00
姬巍川
07a90e9334 添加删除文件关键字 2020-06-16 11:48:13 +08:00
姬巍川
6a373444a7 添加删除文件关键字 2020-06-16 11:46:40 +08:00
dongxiaoyan
8fad174fc0 删除强制标签,添加keywords标题 2020-06-12 16:29:16 +08:00
dongxiaoyan
ea85769fa8 添加标签 2020-06-12 10:49:15 +08:00
dongxiaoyan
4185f1b2ea 设备管理相关case添加tsg_device标签 2020-06-12 10:46:19 +08:00
dongxiaoyan
b36f413d16 cli相关文件更改大小写适应linux;
添加oam接口
中间件接口更新,添加限流测试
2020-06-11 09:26:43 +08:00
姬巍川
2b35194cdd 关键字发生变化,修改用例 2020-06-09 19:30:25 +08:00
姬巍川
5c454fec1c 去除07用例多余空格 2020-06-09 11:32:06 +08:00
dongxiaoyan
adc3e5abef ProfileComman #此处只是示例,关键字要写到02-Keyword目录不要写在此处 2020-06-09 10:13:04 +08:00
姬巍川
c6c166891f file_size和file_integrity_rate类型关键字 2020-06-07 18:56:43 +08:00
姬巍川
afb1e1a8dd file_size用例 2020-06-07 18:55:10 +08:00
姬巍川
d604fb65e2 file_integrity_rate用例 2020-06-07 18:54:40 +08:00
姬巍川
ad53bddc3a Add new directory 2020-06-07 18:53:50 +08:00
姬巍川
5cfbf79c04 file_size和file_integrity_rate类型关键字 2020-06-07 18:52:35 +08:00
姬巍川
580f9d231d Update Filter.robot 2020-06-07 18:51:47 +08:00
姬巍川
78f1139faf file_size和file_integrity_rate类型关键字 2020-06-07 18:51:21 +08:00
dongxiaoyan
6f245c88ff OAM接口测试 2020-06-04 18:09:44 +08:00
姬巍川
d02ce7623d 补充block阻断类型用例 2020-06-04 11:26:13 +08:00
朱明明
382ee10779 添加 通用关键字(未全部调试) 2020-06-03 23:21:56 +08:00
朱明明
44ab2e5c37 Update reflector.robot 2020-06-03 11:51:12 +08:00
朱明明
cf9d6bd18e Update claimedsrcip.robot 2020-06-03 11:50:43 +08:00
朱明明
671651a625 上传txt文件 2020-06-03 11:42:10 +08:00
朱明明
208b3cf504 添加中英俄测试用例&修改文件名&修改测试用例内容 2020-06-02 19:28:47 +08:00
朱明明
ff0652739c 修改证书关键字,添加证书类型变量 2020-06-02 19:17:49 +08:00
dongxiaoyan
c03a7c9358 提交孙姜月ui-administrator代码,其中create-user-001和create-001两个case存在定位问题。 2020-06-02 11:51:59 +08:00
朱明明
a2cbffc976 Settings 2020-06-01 19:32:46 +08:00
朱明明
8fad91d01b Add new directory 2020-06-01 19:28:52 +08:00
朱明明
3d14162622 修改CreatePolicyFile关键字与添加CreateRequest 2020-06-01 19:25:42 +08:00
朱明明
1060974d23 修改因为传参是list,dict导致json无法替换的bug 2020-06-01 18:14:41 +08:00
朱明明
88bd5b8d27 添加setting的成功初始json 2020-06-01 18:10:53 +08:00
dongxiaoyan
0ab1736a27 提前公共部分关键字,简化case。给朱明明示例,朱明明需要添加测试数据的清除,已经沟通。 2020-06-01 18:07:00 +08:00
dongxiaoyan
af934cf8e7 删除无用的绝对路径引用 2020-06-01 10:36:24 +08:00
dongxiaoyan
fc3b969ce9 Merge branch 'develop' of https://git.mesalab.cn/dongxiaoyan/tsg_autotest.git into develop 2020-05-29 20:18:08 +08:00
dongxiaoyan
7352b6c059 更目录和实际大小写一致 2020-05-29 20:17:44 +08:00
liuyuanfang
4252b9cbc7 提交“Policy Verify”关键字 2020-05-29 18:57:17 +08:00
dongxiaoyan
d958900f8b 修改目录为区分大小写 2020-05-29 17:08:22 +08:00
dongxiaoyan
8e6e71074f 添加正确目录 2020-05-29 17:01:46 +08:00
dongxiaoyan
41aec9ced2 删除错误目录 2020-05-29 16:51:59 +08:00
dongxiaoyan
74753b01d2 删除错误目录,提交正确目录 2020-05-29 16:43:28 +08:00
dongxiaoyan
fbfeca5b60 删除uicase目录 2020-05-29 16:24:28 +08:00
dongxiaoyan
d1cea4a619 删除目录 2020-05-29 16:14:49 +08:00
姬巍川
a2daa3a288 推荐url查询测试用例 2020-05-28 19:34:30 +08:00
liuyuanfang
27a9718c0c 修改Category的case 2020-05-28 18:30:02 +08:00
liuyuanfang
bc52210587 为case添加搜索代码 2020-05-28 17:53:00 +08:00
liuyuanfang
bacfd34392 临时提交 2020-05-28 17:51:15 +08:00
liuyuanfang
fdbb24130e 提交ip关键字,添加post函数 2020-05-28 17:50:45 +08:00
liuyuanfang
7b7f8e85f2 修改ip关键字,添加post参数 2020-05-28 17:49:37 +08:00
dongxiaoyan
f1b3db9c57 删除本系统ip对象时,添加是否存在判断 2020-05-28 17:31:58 +08:00
姬巍川
d400d20a95 命中趋势测试用例 2020-05-28 14:38:56 +08:00
姬巍川
fa0ad0f9f2 时间与计数查询测试用例 2020-05-28 14:38:24 +08:00
姬巍川
2d83bc6b24 添加推荐、趋势、时间和计数关键字 2020-05-28 14:14:12 +08:00
liuyuanfang
912a6c54ae 补充case 2020-05-28 11:32:23 +08:00
liuyuanfang
3890069132 提交修改settings关键字 2020-05-28 11:31:01 +08:00
朱明明
8966353886 因 svg 需要修改content type + 需要转义修改类型 2020-05-28 10:58:12 +08:00
liuyuanfang
40701aea01 上传htm文件 2020-05-27 17:47:22 +08:00
liuyuanfang
6f96d8c654 上传css文件 2020-05-27 17:45:38 +08:00
liuyuanfang
2e50b80d1d 上传js文件 2020-05-27 17:44:15 +08:00
liuyuanfang
7284a6cb23 优化Objects关键字 2020-05-27 17:41:02 +08:00
liuyuanfang
ad5a7728fa 提交修改case 2020-05-27 17:38:05 +08:00
liuyuanfang
11df2b381c 提交修改case 2020-05-27 17:37:46 +08:00
liuyuanfang
74ee1af695 提交修改case 2020-05-27 17:37:10 +08:00
liuyuanfang
96546bc1af 提交修改case 2020-05-27 17:36:46 +08:00
liuyuanfang
672d8842e3 提交修改case 2020-05-27 17:36:28 +08:00
liuyuanfang
edad34e62d 提交修改case 2020-05-27 17:36:08 +08:00
liuyuanfang
7102ae70b7 提交修改case 2020-05-27 17:35:50 +08:00
liuyuanfang
3f54d493ff Delete object-url-case.robot 2020-05-27 17:35:23 +08:00
liuyuanfang
ff1f2ae4ac Delete object-keywords-case.robot 2020-05-27 17:35:18 +08:00
liuyuanfang
1926823772 Delete object-ip-case.robot 2020-05-27 17:35:14 +08:00
liuyuanfang
fa7de05b62 Delete object-fqdn-case.robot 2020-05-27 17:35:08 +08:00
liuyuanfang
b1fff687bf Delete object-account-case.robot 2020-05-27 17:35:03 +08:00
liuyuanfang
a4254072d2 Delete object-Subscriber-ID-case.robot 2020-05-27 17:34:58 +08:00
liuyuanfang
9d6f0858b1 Delete Object-category-case.robot 2020-05-27 17:34:53 +08:00
liuyuanfang
99b9778d21 Replace Object-category-case.robot 2020-05-27 17:34:04 +08:00
liuyuanfang
85de3db2b4 提交修改case 2020-05-27 17:32:57 +08:00
liuyuanfang
9681c4a71d Replace Object-category-case.robot 2020-05-27 17:19:46 +08:00
liuyuanfang
b9f53b7bde Replace Object-HTTPSignature-Case.robot 2020-05-27 17:19:19 +08:00
liuyuanfang
0cd8077f16 Delete Trusted_Certificate_Authorities_case.robot 2020-05-27 17:17:51 +08:00
liuyuanfang
556a990c6f Delete Traffic_Mirror_Profiles_case.robot 2020-05-27 17:17:47 +08:00
liuyuanfang
fee63fcd9d Delete Search_Cached_Intermediate_Certificates_case.robot 2020-05-27 17:17:42 +08:00
liuyuanfang
b42ab15a45 Delete SSL_Decryption_Exclusion_case.robot 2020-05-27 17:17:38 +08:00
liuyuanfang
b99eb5a9b3 Delete Response_Pages_case.robot 2020-05-27 17:17:32 +08:00
liuyuanfang
5831787d1b Delete Insert_Scripts_case.robot 2020-05-27 17:17:27 +08:00
liuyuanfang
b9c41bcfd2 Delete Hijack_Files_case.robot 2020-05-27 17:17:22 +08:00
liuyuanfang
6d23a8a2f7 Delete .gitkeep 2020-05-27 17:17:10 +08:00
liuyuanfang
18103464e4 上传修改后的case 2020-05-27 17:16:53 +08:00
liuyuanfang
408d45001f 上传修改后的case 2020-05-27 17:16:25 +08:00
liuyuanfang
0bbc3b2d44 上传修改后的case 2020-05-27 17:16:02 +08:00
liuyuanfang
6a42b7f4f5 上传修改后的case 2020-05-27 17:15:46 +08:00
liuyuanfang
df4abb091d 上传修改后的case 2020-05-27 17:15:12 +08:00
liuyuanfang
62413cfaa9 上传修改后的case 2020-05-27 17:14:16 +08:00
liuyuanfang
9edfbad87b 上传修改后的case 2020-05-27 17:11:48 +08:00
liuyuanfang
c9c3a554df 修改目录大小写 2020-05-27 17:09:15 +08:00
liuyuanfang
8e07490a81 修改目录大小写 2020-05-27 17:02:57 +08:00
liuyuanfang
8072ec113e 修改目录大小写 2020-05-27 17:00:01 +08:00
朱明明
6b19fc2c75 hijack24种类型文件 2020-05-27 16:52:03 +08:00
朱明明
40361dd5c9 新增 hijack 24种类型新增case 2020-05-27 16:28:42 +08:00
朱明明
b550eb52ec 添加通用文件新增关键字 2020-05-27 16:27:18 +08:00
朱明明
5c246e436a 添加hijack初始化json 2020-05-27 16:25:39 +08:00
yyq
24311d4231 日志统计用例完善 2020-05-27 16:19:37 +08:00
dongxiaoyan
c3158a37ef 删除无用参数 2020-05-26 19:59:56 +08:00
yyq
b84fd34e11 Merge branch 'develop' of https://git.mesalab.cn/dongxiaoyan/tsg_autotest into develop 2020-05-26 19:55:08 +08:00
yyq
854a9add36 统计日志自动化代码 2020-05-26 19:54:19 +08:00
liuyuanfang
58f65fa26e 修改settings的Policy Verify的关键字 2020-05-26 19:48:17 +08:00
liuyuanfang
527d32c491 Replace Decryption_Profile_case.robot 2020-05-26 18:52:42 +08:00
liuyuanfang
1eafa6ba5d Replace Settings.robot 2020-05-26 18:51:48 +08:00
dongxiaoyan
77103b2736 添加命令执行比对包含和不包含两类字符串关键字:SystemCommandReturnCompare
参数说明:要执行的系统命令    命令返回结果要包含的字符串列表    命令返回结果不能包含的字符串列表
2020-05-26 18:38:10 +08:00
dongxiaoyan
6d2ecc6ca3 调整UI退出时,调用删除方法错误,即修改UiLoginAndAaddLocalIP名称为UiLoginAndAddLocalIP 2020-05-26 17:48:17 +08:00
朱明明
6741755396 新增通用对象json修改关键字 2020-05-26 14:45:35 +08:00
朱明明
2793a0b6ed 新增替换json内容关键字 2020-05-26 14:42:12 +08:00
朱明明
dff0aa2090 新增替换json内容关键字 2020-05-26 14:41:02 +08:00
liuyuanfang
55859818b6 上传Decryption_Profile的用例 2020-05-26 11:52:49 +08:00
liuyuanfang
542d053655 提交settings关键字 2020-05-26 11:51:05 +08:00
姬巍川
4e62dd8dd1 命令文件 2020-05-25 19:48:01 +08:00
姬巍川
cd8f68b15b Upload New File 2020-05-25 19:45:40 +08:00
姬巍川
de950718b6 Replace SecurityPolicy_Intercept_SSL003.bat 2020-05-25 19:45:17 +08:00
姬巍川
c6c1599442 Replace SecurityPolicy_Intercept_SSL003.bat 2020-05-25 19:44:59 +08:00
姬巍川
2769ef1ac9 Upload New File 2020-05-25 19:44:13 +08:00
姬巍川
db44d04763 Upload New File 2020-05-25 19:43:45 +08:00
姬巍川
12bb7f5b44 Upload New File 2020-05-25 19:43:33 +08:00
姬巍川
5c1d0de996 Upload New File 2020-05-25 19:43:19 +08:00
姬巍川
1bff03c59e Upload New File 2020-05-25 19:42:44 +08:00
姬巍川
25fecd2c4b Upload New File 2020-05-25 19:41:55 +08:00
姬巍川
b9ff0094ac Upload New File 2020-05-25 19:41:42 +08:00
姬巍川
07564d602c Upload New File 2020-05-25 19:41:12 +08:00
姬巍川
b5c6420d04 Upload New File 2020-05-25 19:40:46 +08:00
姬巍川
4fa6dc027d 拦截ssl属性自动化测试用例 2020-05-25 19:39:37 +08:00
liuyuanfang
e8a75a94cb Delete Response_Pages_case-1.robot 2020-05-25 10:14:01 +08:00
姬巍川
70719998e4 更换目录 2020-05-24 16:24:28 +08:00
姬巍川
d4a099e521 Delete Intercept_SSL_Tests.robot 2020-05-24 16:22:07 +08:00
liuyuanfang
864556c687 优化新增Settings关键字 2020-05-22 21:27:57 +08:00
liuyuanfang
1717e61286 优化objects关键字 2020-05-22 21:26:21 +08:00
liuyuanfang
df1816a30e 上传settings模块case 2020-05-22 21:25:05 +08:00
liuyuanfang
ce15c1fa81 上传settings模块case 2020-05-22 21:24:52 +08:00
liuyuanfang
3aec148091 上传settings模块case 2020-05-22 21:24:23 +08:00
liuyuanfang
9958de351c 上传settings模块case 2020-05-22 21:23:54 +08:00
liuyuanfang
422ead6a27 上传settings模块case 2020-05-22 21:23:27 +08:00
liuyuanfang
b2eaf3aba8 上传settings模块case 2020-05-22 21:23:08 +08:00
liuyuanfang
25c5647270 上传settings模块case 2020-05-22 21:22:45 +08:00
liuyuanfang
d509e6340b 上传settings模块case 2020-05-22 21:22:25 +08:00
liuyuanfang
bbf391895f 上传settings模块case 2020-05-22 21:22:01 +08:00
liuyuanfang
0e0a701ada 新增目录Ui-settings 2020-05-22 21:20:44 +08:00
姬巍川
5746e51f26 添加请求体、应答体and和or关系自动化用例 2020-05-22 19:27:59 +08:00
姬巍川
58695a1eb6 添加请求体、应答体and和or关系自动化用例 2020-05-22 19:00:55 +08:00
姬巍川
27e2587ab6 添加请求体、应答体and和or关系自动化用例 2020-05-22 18:13:07 +08:00
姬巍川
071cceb815 添加请求体、应答体and和or关系自动化用例 2020-05-22 18:11:32 +08:00
姬巍川
c92c29c256 添加请求体、应答体and和or关系自动化用例 2020-05-22 18:08:57 +08:00
姬巍川
8957977994 添加请求体、应答体and和or关系自动化用例 2020-05-22 17:59:00 +08:00
姬巍川
824e91837d 添加请求体、应答体and和or关系自动化用例 2020-05-22 17:57:23 +08:00
姬巍川
b629e91b05 添加请求体and和or关系自动化用例 2020-05-22 17:55:03 +08:00
姬巍川
96a1db6049 添加请求体and和or关系自动化用例 2020-05-22 17:53:06 +08:00
姬巍川
4268d2a803 优化标签 2020-05-22 11:58:40 +08:00
姬巍川
1bc90e7157 优化标签 2020-05-22 11:54:53 +08:00
姬巍川
11eeefb700 优化标签 2020-05-22 11:50:08 +08:00
姬巍川
c211fe89c2 优化标签 2020-05-22 11:43:41 +08:00
姬巍川
3788e08e82 优化标签 2020-05-22 11:37:07 +08:00
姬巍川
d2b395ce20 优化标签 2020-05-22 11:31:14 +08:00
姬巍川
5c1e221c3b 优化标签 2020-05-21 19:50:19 +08:00
姬巍川
7a56cfc09f 优化标签 2020-05-21 19:37:52 +08:00
姬巍川
ebd43f58cd 标签优化 2020-05-21 19:35:11 +08:00
姬巍川
cf26959d27 优化标签 2020-05-21 19:32:23 +08:00
姬巍川
c4b66ae7d9 优化标签 2020-05-21 19:29:38 +08:00
姬巍川
81570782b1 优化标签 2020-05-21 19:26:11 +08:00
姬巍川
cdadf50ddd 优化标签 2020-05-21 19:23:12 +08:00
姬巍川
c772b0139c 优化标签 2020-05-21 19:20:41 +08:00
姬巍川
ef12808d54 证书自动化用例 2020-05-21 19:17:39 +08:00
姬巍川
da2527526a 添加安全策略allow动作mail用例 2020-05-20 19:08:16 +08:00
姬巍川
0f25501a4d 添加安全策略allow动作ftp用例 2020-05-20 19:07:50 +08:00
姬巍川
32013269b2 添加安全策略allow动作dns用例 2020-05-20 19:07:23 +08:00
姬巍川
2b2da4f330 修改23用例无功能端效果问题 2020-05-20 17:55:15 +08:00
姬巍川
e132e6fe4a 修改用例2dns_qname"' does not contain 'toutiao.com'问题 2020-05-20 16:36:38 +08:00
姬巍川
bd5ea2f005 修改验证 2020-05-18 15:38:26 +08:00
姬巍川
eee0a5656e 修改执行命令 2020-05-18 15:37:05 +08:00
姬巍川
bd7fc29e97 修改9用例策略验证 2020-05-18 15:35:40 +08:00
姬巍川
25e63c2999 修改39验证 2020-05-18 15:27:50 +08:00
姬巍川
780958834d 添加修改用例 2020-05-15 19:29:59 +08:00
姬巍川
36e6eac6fb 添加修改用例 2020-05-15 19:22:08 +08:00
姬巍川
e28834faea 添加修改策略 2020-05-15 19:00:43 +08:00
姬巍川
725af89b5e 添加修改策略 2020-05-15 18:42:34 +08:00
姬巍川
b133a2a0c5 添加修改策略 2020-05-15 18:41:42 +08:00
姬巍川
98e0f26590 添加修改策略 2020-05-15 18:40:35 +08:00
姬巍川
877e83508e 添加修改策略 2020-05-15 18:40:01 +08:00
姬巍川
d9affb656d 添加修改策略 2020-05-15 18:39:23 +08:00
姬巍川
928f9ab468 添加修改策略 2020-05-15 18:38:44 +08:00
姬巍川
6209f78123 添加修改策略 2020-05-15 18:37:22 +08:00
姬巍川
a1abfa0ea0 添加修改策略 2020-05-15 18:36:00 +08:00
姬巍川
215f2325e2 添加修改策略 2020-05-15 18:35:04 +08:00
姬巍川
7d0a7d905f 添加修改策略 2020-05-15 18:33:36 +08:00
姬巍川
a6a3150559 添加修改策略 2020-05-15 18:32:50 +08:00
姬巍川
011bd85d7c 添加修改策略 2020-05-15 18:31:35 +08:00
姬巍川
4940d40bd7 添加修改策略 2020-05-15 18:30:24 +08:00
姬巍川
341fef6b25 修改7和8用例策略无法命中问题 2020-05-15 11:30:01 +08:00
姬巍川
3b7fcbd312 Update Insert_Ssl_Tests.robot 2020-05-14 18:55:07 +08:00
姬巍川
76416aa61f 修改错误用例 2020-05-14 18:54:01 +08:00
姬巍川
4b9559e2a5 Upload New File 2020-05-14 18:52:59 +08:00
姬巍川
9e6d5781ed Upload New File 2020-05-14 17:18:29 +08:00
姬巍川
297527a7d8 修改错误用例 2020-05-14 17:17:29 +08:00
姬巍川
cf084d960f 修改对象关系 2020-05-14 16:31:56 +08:00
姬巍川
6631a62cc8 修改对象关系 2020-05-14 16:29:25 +08:00
姬巍川
03af892ecc 修改对象关系 2020-05-14 16:23:40 +08:00
姬巍川
8174fd0096 修改对象关系 2020-05-14 16:22:04 +08:00
姬巍川
e685710564 修改对象关系 2020-05-14 16:17:23 +08:00
姬巍川
7c8bbc0449 修改对象关系 2020-05-14 16:16:00 +08:00
姬巍川
18f96331f1 修改执行命令 2020-05-14 15:29:27 +08:00
姬巍川
e0cf3918ac 修改错误验证 2020-05-14 14:13:32 +08:00
姬巍川
3484569cd3 修改功能验证 2020-05-14 11:04:45 +08:00
姬巍川
4e2723eeef 修改ftp未通过的用例 2020-05-13 19:47:26 +08:00
姬巍川
bf78d75754 Replace Deny_FTP_Tests.robot 2020-05-13 17:27:43 +08:00
姬巍川
2861fd42b1 修改错误用例 2020-05-13 11:15:42 +08:00
姬巍川
0f0c8e0931 修改错误用例 2020-05-12 19:33:05 +08:00
姬巍川
d17463e8f3 修改35无法命中问题 2020-05-12 19:12:04 +08:00
姬巍川
0997ba286d 修改38liunx执行命令 2020-05-12 18:58:40 +08:00
姬巍川
87c3446034 修改liunx执行命令 2020-05-12 15:56:50 +08:00
姬巍川
da6206d3dd 修改21用例功能验证 2020-05-12 14:40:28 +08:00
姬巍川
e73a96649a 修改liunx执行命令 2020-05-12 14:32:43 +08:00
姬巍川
e6e554b9fb 修改21-23功能验证问题 2020-05-11 19:41:59 +08:00
姬巍川
446bf773db 解决1用例日志验证问题 2020-05-11 18:41:42 +08:00
姬巍川
cf756fbdaa Upload New File 2020-05-11 18:31:11 +08:00
姬巍川
fdc66e4cd1 解决23无法命中问题 2020-05-11 18:30:22 +08:00
姬巍川
345ce5e294 修改34liunx命令错误 2020-05-11 17:51:35 +08:00
姬巍川
7c6b010947 修改29日志验证问题 2020-05-11 16:01:47 +08:00
姬巍川
c67a374f0d 修改30和39liunx验证问题 2020-05-11 15:25:37 +08:00
姬巍川
affdad6405 修改url错误 2020-05-11 14:51:10 +08:00
姬巍川
ae838a4695 解决编号1用例日志验证问题 2020-05-11 11:05:27 +08:00
姬巍川
62b729e5bb 修改编号16用例验证问题 2020-05-11 10:59:19 +08:00
姬巍川
037d4929d8 补充ftp自动化测试用例 2020-05-10 17:56:34 +08:00
姬巍川
dcde0159e5 补充mail自动化测试用例 2020-05-10 17:55:40 +08:00
姬巍川
8fd0cd03bd 修改liunx系统验证问题 2020-05-10 17:54:49 +08:00
姬巍川
3895b2097d Update 姬巍川测试文件.txt 2020-05-10 17:03:58 +08:00
姬巍川
106d2a8bbf 修改部分用例liunx验证问题 2020-05-09 19:31:38 +08:00
姬巍川
a630ae5e6e 修改liunx验证问题 2020-05-09 19:29:36 +08:00
姬巍川
b45705e492 因版本导致,修改userRegion内容 2020-05-09 19:27:40 +08:00
姬巍川
13c9c05fb6 完善ssl自动化测试用例 2020-05-09 19:26:02 +08:00
姬巍川
9f78d943a9 完善dns用例 2020-05-09 19:25:12 +08:00
dongxiaoyan
219a44eb60 删除错误字符 2020-05-09 13:35:42 +08:00
dongxiaoyan
5460b8e84e 中间件比率测试 2020-05-09 12:59:36 +08:00
姬巍川
7cd6e0cbc2 完善block和aler用例 2020-05-08 20:13:36 +08:00
姬巍川
30e4d5ddb0 Upload New File 2020-05-08 20:10:22 +08:00
姬巍川
8a1715bde8 Update proxyPolicy-Redirect-HTTP-00023.bat 2020-05-08 20:06:33 +08:00
姬巍川
dbef3700cd 因版本导致,修改userRegion内容 2020-05-08 14:21:02 +08:00
姬巍川
6a875a986c 因版本导致,修改userRegion内容 2020-05-08 14:19:55 +08:00
姬巍川
f7b419cf86 因版本导致,修改userRegion内容 2020-05-08 14:19:32 +08:00
姬巍川
a9ccd2cbe1 因版本导致,修改userRegion内容 2020-05-08 14:18:49 +08:00
姬巍川
99f325ac85 Replace Hijack_Ssl_Tests.robot 2020-05-08 14:17:57 +08:00
姬巍川
06ceb6c256 因版本导致,修改userRegion内容 2020-05-08 14:15:45 +08:00
姬巍川
01efec7927 因版本导致,修改userRegion内容 2020-05-08 14:15:14 +08:00
姬巍川
4077eb1620 因版本导致,修改userRegion内容 2020-05-08 14:14:40 +08:00
姬巍川
4dad8eb12e 因版本导致,修改userRegion内容 2020-05-08 14:13:21 +08:00
dongxiaoyan
f57de338f7 tsg_show返回恢复换行,代码恢复为使用换行截取命令结果 2020-05-08 13:55:18 +08:00
dongxiaoyan
560c6dd61e Merge branch 'develop' of https://git.mesalab.cn/dongxiaoyan/tsg_autotest.git into develop 2020-05-08 13:54:01 +08:00
dongxiaoyan
29ffbbe225 cli命令代码调整为结束换行,恢复tsg_show返回结果使用换行命令截取 2020-05-08 13:51:03 +08:00
231 changed files with 21798 additions and 3104 deletions

64
.gitlab-ci.yml Normal file
View 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

View File

@@ -1,81 +0,0 @@
*** Settings ***
Force Tags tsg-ui objects ip
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
*** Test Cases ***
create-ipv4-range-001
#新建iprange
CreatePage Ip create-ipv4-range-001 ipads=ipv4 ipclient=range ipclienttext1=192.168.1.1 ipclienttext2=192.168.1.1
#验证新建是否成功
ui-object-search-name create-ipv4-range-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv4-cidr-002
#新建iprange
CreatePage Ip create-ipv4-cidr-001 ipads=ipv4 ipclient=cidr ipclienttext1=192.168.1.1 ipclienttext2=24
#验证新建是否成功
ui-object-search-name create-ipv4-cidr-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv4-masks-003
#新建iprange
CreatePage Ip create-ipv4-masks-001 ipads=ipv4 ipclient=masks ipclienttext1=192.168.1.1 ipclienttext2=255.255.255.0
#验证新建是否成功
ui-object-search-name create-ipv4-masks-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv6-range-004
#新建iprange
CreatePage Ip create-ipv6-range-004 ipads=ipv6 ipclient=range ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
#验证新建是否成功
ui-object-search-name create-ipv6-range-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv6-cidr-005
#新建iprange
CreatePage Ip create-ipv6-cidr-005 ipads=ipv6 ipclient=cidr ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=64
#验证新建是否成功
ui-object-search-name create-ipv6-cidr-005
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
create-ipv6-masks-006
#新建iprange
CreatePage Ip create-ipv6-masks-006 ipads=ipv6 ipclient=masks ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=0:0:0:0:0:0:0:0
#验证新建是否成功
ui-object-search-name create-ipv6-masks-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#删除对象
objects-delete
edit-ip-007
#新建iprange
CreatePage Ip create-ipv6-masks-006 ipads=ipv6 ipclient=masks ipclienttext1=0:0:0:0:0:0:0:0 ipclienttext2=0:0:0:0:0:0:0:0
#验证新建是否成功
ui-object-search-name create-ipv6-masks-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
#修改对象
object-edit-ip edit-ip-007 ipv4 range 192.168.100.1 192.168.100.1
#查询修改对象
ui-object-search-name edit-ip-007
#删除对象
objects-delete

View File

@@ -0,0 +1,761 @@
*** Settings ***
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 ../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /v1/policy/profile/decryption
${profileId} ${EMPTY}
*** Test Cases ***
Intercept_SSL_Decryption-00001
[Tags] intercpt-服务器证书校验开关关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Intercept_SSL_Decryption-00002
[Tags] 拦截intercpt-服务器证书校验打开-failclose
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${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"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Intercept_SSL_Decryption-00003
[Tags] 拦截intercpt-服务器证书校验打开-pass-through
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${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":"pass-through"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005.bat
... ELSE set variable curl -kv https://wrong.host.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni wrong.host.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006.bat
... ELSE set variable curl -kv https://untrusted-root.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni untrusted-root.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL004.bat
... ELSE set variable curl -kv https://self-signed.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni self-signed.badssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003.bat
... ELSE set variable curl -kv https://expired.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni expired.badssl.com
Intercept_SSL_Decryption-00004
[Tags] intercpt-EV关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":1,"trusted_root_cert_is_not_installed_on_client":0}
${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"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*myssl.com,*myssl.cn
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003_004.bat
... ELSE set variable curl -kv https://myssl.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni myssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005_007.bat
... ELSE set variable curl -kv https://www.myssl.cn
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni myssl.cn
Intercept_SSL_Decryption-00005
[Tags] intercpt-EV开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":1,"trusted_root_cert_is_not_installed_on_client":0}
${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"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*myssl.com,*myssl.cn
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL003_004.bat
... ELSE set variable curl -kv https://myssl.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni myssl.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL005_007.bat
... ELSE set variable curl -kv https://www.myssl.cn
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni myssl.cn
Intercept_SSL_Decryption-00006
[Tags] 拦截intercpt-CT关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${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"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*vip.com,*jd.com,*mail.ru
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_010.bat
... ELSE set variable curl -kv https://www.vip.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni www.vip.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_007.bat
... ELSE set variable curl -kv https://mail.ru/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mail.ru
Intercept_SSL_Decryption-00007
[Tags] 拦截intercpt-CT开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":1,"protocol_errors":1,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${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"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*vip.com,*jd.com,*mail.ru
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable GlobalSign RSA OV SSL CA 2018
... ELSE set variable GlobalSign RSA OV SSL CA 2018
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_010.bat
... ELSE set variable curl -kv https://www.vip.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Secure Site Pro CA G2
... ELSE set variable Secure Site Pro CA G2
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni www.vip.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_007.bat
... ELSE set variable curl -kv https://mail.ru/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mail.ru
Intercept_SSL_Decryption-00008
[Tags] 拦截intercpt-MA关闭
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":0,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${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"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00008 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL008_9.bat
... ELSE set variable curl -kv https://client.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni client.badssl.com
Intercept_SSL_Decryption-00009
[Tags] 拦截intercpt-MA开启
Comment 创建Decryption Profile
${dynamic_bypass} set variable "dynamic_bypass":{"mutual_authentication":1,"cert_pinning":0,"cert_transparency":0,"protocol_errors":0,"ev_cert":0,"trusted_root_cert_is_not_installed_on_client":0}
${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"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*badssl.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00009 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL008_9.bat
... ELSE set variable curl -kv https://client.badssl.com/
${stringlist} run keyword if '${systemType}'=='Windows' set variable DigiCert SHA2 Secure Server CA
... ELSE set variable DigiCert SHA2 Secure Server CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni client.badssl.com
Intercept_SSL_Decryption-00010
[Tags] 拦截intercpt-协议版本-SSL3
Comment 创建Decryption Profile
${dynamic_bypass} set variable "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}
${protocol_version} set variable "protocol_version":{"min":"ssl3","max":"ssl3","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*newdaynews.ru,*ya.ru,*yandex.ru
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00010 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_10.bat
... ELSE set variable curl -kv https://newdaynews.ru/moskow/665390.html/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni newdaynews.ru
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_11.bat
... ELSE set variable curl -kv https://ya.ru
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni ya.ru
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_12.bat
... ELSE set variable curl -kv https://yandex.ru
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni yandex.ru
Intercept_SSL_Decryption-00011
[Tags] 拦截intercpt-协议版本-TLS1.0
Comment 创建Decryption Profile
${dynamic_bypass} set variable "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}
${protocol_version} set variable "protocol_version":{"min":"tls10","max":"tls10","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*newdaynews.ru,*github.com,*jd.com,*mi.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00011 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_10.bat
... ELSE set variable curl -kv https://newdaynews.ru/moskow/665390.html/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni newdaynews.ru
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011_12.bat
... ELSE set variable curl -kv https://github.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni github.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL009.bat
... ELSE set variable curl -kv https:///www.mi.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mi.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Intercept_SSL_Decryption-00012
[Tags] 拦截intercpt-协议版本-TLS1.1
Comment 创建Decryption Profile
${dynamic_bypass} set variable "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}
${protocol_version} set variable "protocol_version":{"min":"tls11","max":"tls11","mirror_client":0,"allow_http2":0}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*newdaynews.ru,*github.com,*jd.com,*mi.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00012 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL010_10.bat
... ELSE set variable curl -kv https://newdaynews.ru/moskow/665390.html/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni newdaynews.ru
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011_12.bat
... ELSE set variable curl -kv https://github.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni github.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL009.bat
... ELSE set variable curl -kv https:///www.mi.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mi.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Intercept_SSL_Decryption-00013
[Tags] 拦截intercpt-协议版本-TLS1.2
Comment 创建Decryption Profile
${dynamic_bypass} set variable "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}
${protocol_version} set variable "protocol_version":{"min":"tls12","max":"tls12","mirror_client":0,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*jd.com,*taobao.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00013 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_008.bat
... ELSE set variable curl -kv https://coll.jd.com/?e=illegalTopic/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni coll.jd.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011.bat
... ELSE set variable curl -kv https://www.taobao.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni taobao.com
Intercept_SSL_Decryption-00014
[Tags] 拦截intercpt-协议版本-TLS1.3
Comment 创建Decryption Profile
${dynamic_bypass} set variable "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}
${protocol_version} set variable "protocol_version":{"min":"tls13","max":"tls13","mirror_client":0,"allow_http2":1}
${certificate_checks} set variable "certificate_checks":{"approach":{"cn":0,"issuer":0,"self-signed":0,"expiration":0},"fail_action":"fail-close"}
${data} set variable {"opAction":"add","returnData":1,"list":[{"profileName":"autotest_decryption_add","profileId":"","decryption":{${dynamic_bypass},${protocol_version},${certificate_checks}},"isValid":1,"isInitialize":0,"profileDesc":""}]}
${response} CreatePolicyFileNoFile ${url} ${data}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*vip.com,*github.com,*halfrost.com,*mi.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00014 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":${profiledId},"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL006_010.bat
... ELSE set variable curl -kv https://www.vip.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni vip.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL012.bat
... ELSE set variable curl -kv https://halfrost.com/tls1-3_start/
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni halfrost.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL009.bat
... ELSE set variable curl -kv https:///www.mi.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Connection was reset
... ELSE set variable Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni mi.com
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/SecurityPolicy_Intercept_SSL011_12.bat
... ELSE set variable curl -kv https://github.com
${stringlist} run keyword if '${systemType}'=='Windows' set variable Tango Secure Gateway CA
... ELSE set variable Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni github.com

View File

@@ -0,0 +1,196 @@
*** Settings ***
Test Teardown DeleteAfterCase ${policyIds} ${objectids}
Force Tags tsg_adc tsg_security selfserver
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/AllFlowCaseVariable.txt
Resource ../../../02-Keyword/tsg_adc/FileOperation.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library Custometest
Library json
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/responsepages
${profiledId} ${EMPTY}
${dict} ${None}
${caseName} SecurityPolicy-Deny-AllProtol-00001
*** Keywords ***
create-object-policy
[Arguments] @{flag}
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} Run Keyword If '${testPart}'=='all' set Variable ${objectId}
Comment 创建安全策略针对所有协议相当于BlackIP
${policyDict} Create Dictionary
... policyName=${caseName}
... policyType=tsg_security
... policyDesc=${Default_PolicyDesc}
... action=deny
... effectiveRange=${Default_EffectiveRange}
... userRegion=${Default_UserRegion}
... referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR
... isValid=${Default_IsValid}
... appObjectIdArray=2,3,4,5,6
... userTags=${Default_UserTags}
... doLog=2
... scheduleId=${Default_ScheduleId}
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
${policyIds} Run Keyword If '${testPart}'=='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
# 区分执行方式
${value} Run Keyword If ${flag}==[] insert_policyId_to_file ${caseName} ${policyId} ${objectids}
... ELSE Create Dictionary policyId=${policyId} objectId=${objectids}
Set Test Variable ${dict} ${value}
function-test
Run Keyword If '${testPart}'=='all' Sleep ${policyVerificationSleepSeconds}s
${starttime} Get Time
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/${caseName}_HTTP.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime_http} Get Time
${rescode} SystemCommands ${commandstr} ${stringlist}
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_http} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 功能端验证SSL验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/${caseName}_SSL.bat
... ELSE set variable curl -kv https://open.node.com/
${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_ssl} Get Time
${rescode} SystemCommands ${commandstr} ${stringlist}
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_ssl} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#${mail} EmailLogin mail.tsgmail.com 25 dongxiaoyan@mail.tsgmail.com dxy123
${starttime_mail} Get Time
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable dongxiaoyan@mail.tsgmail.com
${邮箱密码} Set Variable dxy123
${邮件主题} Set Variable что- иностранныеsuject
${发送者} Set Variable dongxiaoyan@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["jwctest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["lyftest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明contentчто-иностранныеsuject
${mail} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
should contain ${mail} mail_fail
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_mail} Get Time
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
${starttime_ftp} Get Time
${ftpLogin} FTP_login ftp://192.168.100.5:21 -u"ftp_user:qazXSW@edc" test.txt
should contain ${ftpLogin} ftp_fail
#日志验证
#GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ''
Run Keyword If '${testPart}'=='all' Sleep ${policyLogVerificationSleepSeconds}s
${endtime_ftp} Get Time
${endtime} Get Time
# 区分执行方式
Run Keyword If ${dict}==${None} insert_time_to_file ${caseName} ${starttime} ${endtime}
... ELSE Run Keyword Set To Dictionary ${dict} ${starttime} ${endtime}
log-test
# 日志验证
${obj} Run Keyword If ${dict}==${None} json.Loads ${caseName}
... ELSE Set Variable ${dict}
${policyId} Set Variable ${obj}[policyId]
${s} Convert to String ${policyId}
${objectids} Run Keyword If '${testPart}'!='all' set Variable ${obj}[objectids]
${policyIds} Run Keyword If '${testPart}'!='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
#日志验证
GetLogList security_event_log ${starttime_http} ${endtime_http} ${testClentIP} ${s} http_host open.node.com
${obj}[starttime] ${obj}[endtime]
Comment 功能端验证SSL验证
#日志验证
GetLogList security_event_log ${starttime_ssl} ${endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#日志验证
GetLogList security_event_log ${starttime_mail} ${endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
#日志验证
GetLogList security_event_log ${starttime_ftp} ${endtime_ftp} ${testClentIP} ${s} ftp_account ''
log-test_bak
# 日志验证
${obj} Run Keyword If ${dict}==${None} json.Loads ${caseName}
... ELSE Set Variable ${dict}
${policyId} Set Variable ${obj}[policyId]
${s} Convert to String ${policyId}
${objectids} Run Keyword If '${testPart}'!='all' set Variable ${obj}[objectids]
${policyIds} Run Keyword If '${testPart}'!='all' Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
#日志验证
#GetLogList security_event_log ${starttime_http} ${endtime_http} ${testClentIP} ${s} http_host open.node.com
GetLogList security_event_log ${obj}[starttime_http] ${obj}[endtime_http] ${testClentIP} ${s} http_host open.node.com
${obj}[starttime] ${obj}[endtime]
Comment 功能端验证SSL验证
#日志验证
#GetLogList security_event_log ${starttime_ssl} ${endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
GetLogList security_event_log ${obj}[starttime_ssl} ${obj}[endtime_ssl} ${testClentIP} ${s} ssl_sni open.node.com
Comment 功能端验证DNS验证
Comment 功能端验证MAIL验证
#日志验证
#GetLogList security_event_log ${starttime_mail} ${endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
GetLogList security_event_log ${obj}[starttime_mail} ${obj}[endtime_mail} ${testClentIP} ${s} mail_protocol_type SMTP
Comment 功能端验证FTP验证
#日志验证
#GetLogList security_event_log ${starttime_ftp} ${endtime_ftp} ${testClentIP} ${s} ftp_account ''
GetLogList security_event_log ${obj}[starttime_ftp} ${obj}[endtime_ftp} ${testClentIP} ${s} ftp_account ''
*** Test Cases ***
MultiSecurityPolicy-Deny-AllProtol-00001
[Tags] securitypolciy deny allprotol multistep
#${caseName} set variable SecurityPolicy-Deny-AllProtol-00001
Run Keyword If '${testPart}'=='all' Run Keywords create-object-policy True
... AND function-test
... AND log-test
... ELSE IF ${testPart}==1 Run Keyword create-object-policy
... ELSE IF ${testPart}==2 Run Keyword function-test
... ELSE IF ${testPart}==3 Run Keyword log-test
#{"opAction":"add","policyList":{"policyId":"","policyName":"dxytest","policyType":"tsg_security","action":"deny","userTags":"","doBlacklist":0,"doLog":1,"policyDesc":"","effectiveRange":{"tag_sets":[[]]},"userRegion":{"method":"rst"},"referenceObject":[{"objectId":6926,"protocolFields":["TSG_SECURITY_SOURCE_ADDR"]},{"objectId":6943,"protocolFields":["TSG_SECURITY_DESTINATION_ADDR"]}],"isValid":0,"scheduleId":[],"appObjectIdArray":[2,3,4,5,6]}}

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Allow-Http-00001
[Tags] selfserver ip http allow
[Tags] selfserver ip
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,7 +46,7 @@ ProxyPolicy-Allow-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http allow
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -82,7 +82,7 @@ ProxyPolicy-Allow-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00003
[Tags] selfserver ip+cat右匹配 http allow
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -118,7 +118,7 @@ ProxyPolicy-Allow-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00004
[Tags] selfserver http allow ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -150,7 +150,7 @@ ProxyPolicy-Allow-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00005
[Tags] selfserver http allow ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -182,7 +182,7 @@ ProxyPolicy-Allow-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00006
[Tags] selfserver http allow ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/tengrinews/tengrinews.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -214,7 +214,7 @@ ProxyPolicy-Allow-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00007
[Tags] selfserver http allow ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -246,7 +246,7 @@ ProxyPolicy-Allow-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00008
[Tags] selfserver http allow ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Allow-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00009
[Tags] selfserver http allow ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -318,7 +318,7 @@ ProxyPolicy-Allow-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00010
[Tags] selfserver http allow ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -354,7 +354,7 @@ ProxyPolicy-Allow-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00011
[Tags] selfserver http allow ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ ProxyPolicy-Allow-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00012
[Tags] selfserver http allow ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -426,7 +426,7 @@ ProxyPolicy-Allow-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00013
[Tags] selfserver http allow ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -462,7 +462,7 @@ ProxyPolicy-Allow-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00014
[Tags] selfserver http allow ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -498,7 +498,7 @@ ProxyPolicy-Allow-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00015
[Tags] selfserver http allow ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -534,7 +534,7 @@ ProxyPolicy-Allow-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00016
[Tags] selfserver http allow ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -570,7 +570,7 @@ ProxyPolicy-Allow-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00017
[Tags] selfserver http allow ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -606,7 +606,7 @@ ProxyPolicy-Allow-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00018
[Tags] selfserver http allow ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -642,7 +642,7 @@ ProxyPolicy-Allow-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00019
[Tags] selfserver http allow ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -678,7 +678,7 @@ ProxyPolicy-Allow-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00020
[Tags] selfserver http allow ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -714,7 +714,7 @@ ProxyPolicy-Allow-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00021
[Tags] selfserver 最大组合 http allow
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -760,3 +760,56 @@ ProxyPolicy-Allow-Http-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Http-00022
[Tags] selfserver 修改
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Allow-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|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/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 酒店式公寓
... ELSE Create List 酒店式公寓
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Allow-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0008.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 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 发送POST请求
... ELSE Create List 发送POST请求
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,13 +14,13 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Allow-Ssl-00001
[Tags] selfserver ip ssl allow
[Tags] selfserver ip
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -46,7 +46,7 @@ ProxyPolicy-Allow-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00002
[Tags] selfserver ip+fqdn完整匹配 ssl allow
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -56,7 +56,7 @@ ProxyPolicy-Allow-Ssl-00002
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -82,7 +82,7 @@ ProxyPolicy-Allow-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00003
[Tags] selfserver ip+cat右匹配 ssl allow
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -92,7 +92,7 @@ ProxyPolicy-Allow-Ssl-00003
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -118,13 +118,13 @@ ProxyPolicy-Allow-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00004
[Tags] selfserver ssl allow ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -150,13 +150,13 @@ ProxyPolicy-Allow-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00005
[Tags] selfserver ssl allow ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -182,13 +182,13 @@ ProxyPolicy-Allow-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00006
[Tags] selfserver ssl allow ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -214,13 +214,13 @@ ProxyPolicy-Allow-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00007
[Tags] selfserver ssl allow ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -246,7 +246,7 @@ ProxyPolicy-Allow-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00008
[Tags] selfserver ssl allow ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -256,7 +256,7 @@ ProxyPolicy-Allow-Ssl-00008
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -282,7 +282,7 @@ ProxyPolicy-Allow-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00009
[Tags] selfserver ssl allow ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -292,7 +292,7 @@ ProxyPolicy-Allow-Ssl-00009
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -318,7 +318,7 @@ ProxyPolicy-Allow-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00010
[Tags] selfserver ssl allow ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -328,7 +328,7 @@ ProxyPolicy-Allow-Ssl-00010
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -354,7 +354,7 @@ ProxyPolicy-Allow-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00011
[Tags] selfserver ssl allow ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -364,7 +364,7 @@ ProxyPolicy-Allow-Ssl-00011
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -390,7 +390,7 @@ ProxyPolicy-Allow-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00012
[Tags] selfserver ssl allow ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -400,7 +400,7 @@ ProxyPolicy-Allow-Ssl-00012
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -426,7 +426,7 @@ ProxyPolicy-Allow-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00013
[Tags] selfserver ssl allow ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -436,7 +436,7 @@ ProxyPolicy-Allow-Ssl-00013
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -462,7 +462,7 @@ ProxyPolicy-Allow-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00014
[Tags] selfserver ssl allow ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -472,7 +472,7 @@ ProxyPolicy-Allow-Ssl-00014
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -498,7 +498,7 @@ ProxyPolicy-Allow-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00015
[Tags] selfserver ssl allow ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -508,7 +508,7 @@ ProxyPolicy-Allow-Ssl-00015
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -534,7 +534,7 @@ ProxyPolicy-Allow-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00016
[Tags] selfserver ssl allow ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -544,7 +544,7 @@ ProxyPolicy-Allow-Ssl-00016
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -570,7 +570,7 @@ ProxyPolicy-Allow-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00017
[Tags] selfserver ssl allow ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -580,7 +580,7 @@ ProxyPolicy-Allow-Ssl-00017
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -606,7 +606,7 @@ ProxyPolicy-Allow-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00018
[Tags] selfserver ssl allow ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -616,7 +616,7 @@ ProxyPolicy-Allow-Ssl-00018
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -642,7 +642,7 @@ ProxyPolicy-Allow-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00019
[Tags] selfserver ssl allow ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -652,7 +652,7 @@ ProxyPolicy-Allow-Ssl-00019
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -678,7 +678,7 @@ ProxyPolicy-Allow-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00020
[Tags] selfserver ssl allow ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -688,7 +688,7 @@ ProxyPolicy-Allow-Ssl-00020
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -714,7 +714,7 @@ ProxyPolicy-Allow-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00021
[Tags] selfserver 最大组合 ssl allow
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -735,7 +735,7 @@ ProxyPolicy-Allow-Ssl-00021
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -759,3 +759,56 @@ ProxyPolicy-Allow-Ssl-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Allow-Ssl-00022
[Tags] selfserver 修改
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Allow-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL,${objectId}|TSG_SECURITY_DESTINATION_ADDR
${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-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List twitter Tango Secure Gateway CA
... ELSE Create List twitter Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Allow-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_re_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
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 трейлеры Tango Secure Gateway CA
... ELSE Create List трейлеры Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -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,12 +10,12 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/responsepages
${url} /v1/policy/profile/responsepages
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Deny-Http-00001
[Tags] selfserver ip http deny
[Tags] selfserver ip
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,9 +45,10 @@ 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完整匹配 http deny
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -78,9 +78,10 @@ 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右匹配 http deny
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -110,9 +111,10 @@ 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 http deny ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -144,9 +146,10 @@ 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 http deny ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -178,9 +181,10 @@ 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 http deny ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -210,9 +214,10 @@ 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 http deny ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -245,9 +250,10 @@ 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 http deny ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -279,9 +285,10 @@ 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 http deny ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -313,9 +320,10 @@ 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 http deny ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -345,9 +353,10 @@ 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 http deny ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -380,9 +389,10 @@ 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 http deny ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -412,9 +422,10 @@ 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 http deny ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -444,9 +455,10 @@ 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 http deny ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -478,9 +490,10 @@ 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 http deny ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -510,9 +523,10 @@ 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 http deny ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -542,9 +556,10 @@ 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 http deny ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -574,9 +589,10 @@ 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 http deny ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -608,9 +624,10 @@ 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 http deny ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -640,9 +657,10 @@ 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 http deny ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -672,9 +690,10 @@ 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 http deny ip+请求体字串匹配
[Tags] selfserver ip+请求体字串匹配
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -686,7 +705,7 @@ ProxyPolicy-Deny-Http-00021
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
@@ -694,8 +713,8 @@ ProxyPolicy-Deny-Http-00021
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Извините
... ELSE Create List Извините
${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}
@@ -704,9 +723,10 @@ 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 http deny ip+应答体字串匹配
[Tags] selfserver ip+应答体字串匹配
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -736,9 +756,10 @@ 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 最大组合 http deny
[Tags] selfserver 最大组合
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -784,3 +805,187 @@ 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
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_yd_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","html_profile":${profiledId},"code":404,"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-HTTP-0001.bat
... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","html_profile":${profiledId},"code":404,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
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 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00025 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${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/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${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 ${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+请求体或更新
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,qazx
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00026 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${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/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${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 ${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关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response& Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00027 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${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-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${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 ${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+应答体或关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response,12345
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-HTTP-00028 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${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-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${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 ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}

View File

@@ -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,18 +10,18 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/responsepages
${url} /v1/policy/profile/responsepages
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Deny-Ssl-00001
[Tags] selfserver ip deny ssl
[Tags] selfserver ip
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -46,15 +45,16 @@ 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完整匹配 deny ssl
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -78,15 +78,16 @@ 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右匹配 deny ssl
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -110,15 +111,16 @@ 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 deny ip+url右匹配 ssl
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -144,15 +146,16 @@ 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 deny ip+url字串匹配 ssl
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -178,15 +181,16 @@ 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 deny ip+url完整匹配 ssl
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -210,15 +214,16 @@ 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 deny ip+url左匹配 ssl
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -245,15 +250,16 @@ 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 deny ssl ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -279,15 +285,16 @@ 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 deny ip+请求头字串匹配 ssl
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -313,15 +320,16 @@ 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 deny ip+请求头完整匹配 ssl
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -345,15 +353,16 @@ 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 deny ip+请求头左匹配 ssl
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -380,15 +389,16 @@ 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 deny ip+cookie字串匹配 ssl
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -412,15 +422,16 @@ 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 deny ip+应答头右匹配 ssl
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -444,15 +455,16 @@ 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 deny ip+应答头字串匹配 ssl
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -478,15 +490,16 @@ 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 deny ip+应答头完整匹配 ssl
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -510,15 +523,16 @@ 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 deny ip+应答头左匹配 ssl
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -542,15 +556,16 @@ 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 deny ip+set-cookie右匹配 ssl
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -574,15 +589,16 @@ 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 deny ip+set-cookie字串匹配 ssl
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -608,15 +624,16 @@ 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 deny ip+set-cookie完整匹配 ssl
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -629,7 +646,7 @@ ProxyPolicy-Deny-Ssl-00019
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=yyyyy" https://open.node.com/action
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List qwerty Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List qwerty Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -640,15 +657,16 @@ 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 deny ip+set-cookie左匹配 ssl
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -672,21 +690,22 @@ 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 deny ip+请求体字串匹配 ssl
[Tags] selfserver ip+请求体字串匹配
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Deny-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-SSL-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
@@ -694,8 +713,8 @@ ProxyPolicy-Deny-Ssl-00021
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Извините Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List Извините Tango Secure Gateway CA X-TG-Construct-By
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
@@ -704,15 +723,16 @@ 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 deny ip+应答体字串匹配 ssl
[Tags] selfserver ip+应答体字串匹配
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -726,8 +746,8 @@ ProxyPolicy-Deny-Ssl-00022
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Empty reply from server Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List Connection reset by peer Tango Secure Gateway CA X-TG-Construct-By
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
@@ -736,9 +756,10 @@ 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 最大组合 deny ssl
[Tags] selfserver 最大组合
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -760,7 +781,7 @@ ProxyPolicy-Deny-Ssl-00023
${rescode} ${object_by_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_by_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -774,8 +795,8 @@ ProxyPolicy-Deny-Ssl-00023
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00023.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://open.node.com/test/bytedance/bytedance.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Empty reply from server X-TG-Construct-By
... ELSE Create List Connection reset by peer X-TG-Construct-By
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -784,3 +805,186 @@ 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
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*bytedance.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Deny-Ssl-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"你好,五一","code":403,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_HOST
${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 你好,五一 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 你好,五一 Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Deny-Ssl-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"QAZWSX星期天песни","code":403,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List QAZWSX星期天 песни Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List QAZWSX星期天 песни Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
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 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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=proxyPolicy-Deny-SSL-00025 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${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/ProxyPolicy-Redirect-SSL-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${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+请求体或关系
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,你好明天
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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=proxyPolicy-Deny-SSL-00026 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${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/ProxyPolicy-Redirect-SSL-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${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关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response& Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Deny-ssl-00027 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${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/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${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+应答体或关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response,你好明天
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Deny-ssl-00028 policyType=pxy_manipulation policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${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/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset Tango Secure Gateway CA
... ELSE Create List Connection reset by peer Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
[Teardown] DeletePolicyAndObject1 ${policyIds} ${objectids} ${url} ${EMPTY}

View File

@@ -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,12 +11,12 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/hijackfiles
${url} /v1/policy/profile/hijackfiles
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Hijack-Http-00001
[Tags] selfserver http hijack ip+url
[Tags] selfserver ip+url
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -55,7 +55,7 @@ ProxyPolicy-Hijack-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00002
[Tags] selfserver http hijack ip+fqdn完整匹配+url
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -94,7 +94,7 @@ ProxyPolicy-Hijack-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00003
[Tags] selfserver http hijack ip+cat右匹配+url
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -133,7 +133,7 @@ ProxyPolicy-Hijack-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00004
[Tags] selfserver http hijack ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -168,7 +168,7 @@ ProxyPolicy-Hijack-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00005
[Tags] selfserver http hijack ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -203,7 +203,7 @@ ProxyPolicy-Hijack-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00006
[Tags] selfserver http hijack ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -238,7 +238,7 @@ ProxyPolicy-Hijack-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00007
[Tags] selfserver http hijack ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -273,7 +273,7 @@ ProxyPolicy-Hijack-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00008
[Tags] selfserver http hijack ip+请求头右匹配+url
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -312,7 +312,7 @@ ProxyPolicy-Hijack-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00009
[Tags] selfserver http hijack ip+请求头字串匹配+url
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -351,7 +351,7 @@ ProxyPolicy-Hijack-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00010
[Tags] selfserver http hijack ip+请求头完整匹配+url
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ ProxyPolicy-Hijack-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00011
[Tags] selfserver http hijack ip+请求头左匹配+url
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -429,7 +429,7 @@ ProxyPolicy-Hijack-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00012
[Tags] selfserver http hijack ip+cookie字串匹配+url
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -468,7 +468,7 @@ ProxyPolicy-Hijack-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00013
[Tags] selfserver http hijack ip+应答头右匹配+url
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -507,7 +507,7 @@ ProxyPolicy-Hijack-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00014
[Tags] selfserver http hijack ip+应答头字串匹配+url
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -546,7 +546,7 @@ ProxyPolicy-Hijack-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00015
[Tags] selfserver http hijack ip+应答头完整匹配+url
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -585,7 +585,7 @@ ProxyPolicy-Hijack-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00016
[Tags] selfserver http hijack ip+应答头左匹配+url
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -624,7 +624,7 @@ ProxyPolicy-Hijack-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00017
[Tags] selfserver http hijack ip+set-cookie右匹配+url
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -663,7 +663,7 @@ ProxyPolicy-Hijack-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00018
[Tags] selfserver http hijack ip+set-cookie字串匹配+url
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -702,7 +702,7 @@ ProxyPolicy-Hijack-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00019
[Tags] selfserver http hijack ip+set-cookie完整匹配+url
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -741,7 +741,7 @@ ProxyPolicy-Hijack-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00020
[Tags] selfserver http hijack ip+set-cookie左匹配+url
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -780,7 +780,7 @@ ProxyPolicy-Hijack-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00021
[Tags] selfserver 最大组合 http hijack
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -829,3 +829,59 @@ ProxyPolicy-Hijack-Http-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Http-00022
[Tags] selfserver 修改
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${object_ck_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ck_Id}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Hijack-HTTP-00022 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_REQ_HDR,${object_url_Id}|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-Deny-HTTP-0008.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 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Hijack-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_ck_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
... ELSE Create List b76f:a340:7b1f:f4d0:27f3:8f0e:2db0:2bac
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -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,12 +11,12 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/hijackfiles
${url} /v1/policy/profile/hijackfiles
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Hijack-Ssl-00001
[Tags] selfserver ssl hijack ip+url
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -25,7 +25,7 @@ ProxyPolicy-Hijack-Ssl-00001
${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
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -51,7 +51,7 @@ ProxyPolicy-Hijack-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00002
[Tags] selfserver ssl hijack ip+fqdn完整匹配+url
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -64,7 +64,7 @@ ProxyPolicy-Hijack-Ssl-00002
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -90,7 +90,7 @@ ProxyPolicy-Hijack-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00003
[Tags] selfserver ssl hijack ip+cat右匹配+url
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -103,7 +103,7 @@ ProxyPolicy-Hijack-Ssl-00003
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -129,7 +129,7 @@ ProxyPolicy-Hijack-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00004
[Tags] selfserver ssl hijack ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -138,7 +138,7 @@ ProxyPolicy-Hijack-Ssl-00004
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -164,7 +164,7 @@ ProxyPolicy-Hijack-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00005
[Tags] selfserver ssl hijack ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -173,7 +173,7 @@ ProxyPolicy-Hijack-Ssl-00005
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -199,7 +199,7 @@ ProxyPolicy-Hijack-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00006
[Tags] selfserver ssl hijack ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -208,7 +208,7 @@ ProxyPolicy-Hijack-Ssl-00006
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -234,7 +234,7 @@ ProxyPolicy-Hijack-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00007
[Tags] selfserver ssl hijack ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -243,7 +243,7 @@ ProxyPolicy-Hijack-Ssl-00007
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-2.gif hijack {"isValid":1,"contentType":"image/gif","opAction":"add","profileName":"test6","contentName":"Create-Hijack Files-test-2.gif","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -269,7 +269,7 @@ ProxyPolicy-Hijack-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00008
[Tags] selfserver ssl hijack ip+请求头右匹配+url
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Hijack-Ssl-00008
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -308,7 +308,7 @@ ProxyPolicy-Hijack-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00009
[Tags] selfserver ssl hijack ip+请求头字串匹配+url
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -321,7 +321,7 @@ ProxyPolicy-Hijack-Ssl-00009
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -347,7 +347,7 @@ ProxyPolicy-Hijack-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00010
[Tags] selfserver ssl hijack ip+请求头完整匹配+url
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -360,7 +360,7 @@ ProxyPolicy-Hijack-Ssl-00010
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -386,7 +386,7 @@ ProxyPolicy-Hijack-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00011
[Tags] selfserver ssl hijack ip+请求头左匹配+url
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -399,7 +399,7 @@ ProxyPolicy-Hijack-Ssl-00011
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-1.exe hijack {"isValid":1,"contentType":"application/x-msdos-program","opAction":"add","profileName":"test2","contentName":"Create-Hijack Files-test-1.exe","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -425,7 +425,7 @@ ProxyPolicy-Hijack-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00012
[Tags] selfserver ssl hijack ip+cookie字串匹配+url
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -438,7 +438,7 @@ ProxyPolicy-Hijack-Ssl-00012
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -464,7 +464,7 @@ ProxyPolicy-Hijack-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00013
[Tags] selfserver ssl hijack ip+应答头右匹配+url
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -477,7 +477,7 @@ ProxyPolicy-Hijack-Ssl-00013
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -503,7 +503,7 @@ ProxyPolicy-Hijack-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00014
[Tags] selfserver ssl hijack ip+应答头字串匹配+url
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -516,7 +516,7 @@ ProxyPolicy-Hijack-Ssl-00014
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-2.gif hijack {"isValid":1,"contentType":"image/gif","opAction":"add","profileName":"test6","contentName":"Create-Hijack Files-test-2.gif","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -542,7 +542,7 @@ ProxyPolicy-Hijack-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00015
[Tags] selfserver ssl hijack ip+应答头完整匹配+url
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -555,7 +555,7 @@ ProxyPolicy-Hijack-Ssl-00015
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -581,7 +581,7 @@ ProxyPolicy-Hijack-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00016
[Tags] selfserver ssl hijack ip+应答头左匹配+url
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -594,7 +594,7 @@ ProxyPolicy-Hijack-Ssl-00016
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -620,7 +620,7 @@ ProxyPolicy-Hijack-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00017
[Tags] selfserver ssl hijack ip+set-cookie右匹配+url
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -633,7 +633,7 @@ ProxyPolicy-Hijack-Ssl-00017
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -659,7 +659,7 @@ ProxyPolicy-Hijack-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00018
[Tags] selfserver ssl hijack ip+set-cookie字串匹配+url
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -672,7 +672,7 @@ ProxyPolicy-Hijack-Ssl-00018
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-5.png hijack {"isValid":1,"contentType":"image/png","opAction":"add","profileName":"test4","contentName":"Create-Hijack Files-test-5.png","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -698,7 +698,7 @@ ProxyPolicy-Hijack-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00019
[Tags] selfserver ssl hijack ip+set-cookie完整匹配+url
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -711,7 +711,7 @@ ProxyPolicy-Hijack-Ssl-00019
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-4.jpeg hijack {"isValid":1,"contentType":"image/jpeg","opAction":"add","profileName":"test5","contentName":"Create-Hijack Files-test-4.jpeg","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -737,7 +737,7 @@ ProxyPolicy-Hijack-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00020
[Tags] selfserver ssl hijack ip+set-cookie左匹配+url
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -750,7 +750,7 @@ ProxyPolicy-Hijack-Ssl-00020
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-2.gif hijack {"isValid":1,"contentType":"image/gif","opAction":"add","profileName":"test6","contentName":"Create-Hijack Files-test-2.gif","profileId":null,"returnData":1}
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -776,7 +776,7 @@ ProxyPolicy-Hijack-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00021
[Tags] selfserver 最大组合 ssl hijack
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -800,7 +800,7 @@ ProxyPolicy-Hijack-Ssl-00021
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -824,3 +824,60 @@ ProxyPolicy-Hijack-Ssl-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Hijack-Ssl-00022
[Tags] selfserver 修改
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建hijack文件
${response} CreatePolicyFile2 ${url} ${path}/hijack_files/ Create-Hijack Files-test-3.html hijack
${profiledId} Get From Dictionary ${response} profileId
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Hijack-SSL-00022 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_RES_HDR,${object_url_Id}|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/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Hijack-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"hijack","hijack_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0008.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://open.node.com
@{stringlist} run keyword if '${systemType}'=='Windows' Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 控制小蛇在地图范围内移动 Tango Secure Gateway CA X-TG-Construct-By
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -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,14 +11,14 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/insertscripts
${url} /v1/policy/profile/insertscripts
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Insert-Http-00001
[Tags] selfserver http Insert ip+url
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
@@ -37,8 +37,8 @@ ProxyPolicy-Insert-Http-00001
${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/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv \ http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -51,13 +51,13 @@ ProxyPolicy-Insert-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00002
[Tags] selfserver http Insert ip+fqdn完整匹配+url
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
@@ -76,8 +76,8 @@ ProxyPolicy-Insert-Http-00002
${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/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -90,13 +90,13 @@ ProxyPolicy-Insert-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00003
[Tags] selfserver http Insert ip+cat右匹配+url
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*youtube.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
@@ -115,8 +115,8 @@ ProxyPolicy-Insert-Http-00003
${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-HTTP-0002.bat
... ELSE set variable curl \ http://open.node.com/test/youtube/youtube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -129,9 +129,9 @@ ProxyPolicy-Insert-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00004
[Tags] selfserver http Insert ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
@@ -150,8 +150,8 @@ ProxyPolicy-Insert-Http-00004
${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/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -164,9 +164,9 @@ ProxyPolicy-Insert-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00005
[Tags] selfserver http Insert ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
@@ -185,8 +185,8 @@ ProxyPolicy-Insert-Http-00005
${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/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -199,9 +199,9 @@ ProxyPolicy-Insert-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00006
[Tags] selfserver http Insert ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
@@ -220,8 +220,8 @@ ProxyPolicy-Insert-Http-00006
${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/ProxyPolicy-Redirect-HTTP-0003.bat
... ELSE set variable curl -kv http://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -234,7 +234,7 @@ ProxyPolicy-Insert-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00007
[Tags] selfserver http Insert ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -255,8 +255,8 @@ ProxyPolicy-Insert-Http-00007
${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-HTTP-0002.bat
... ELSE set variable curl \ \ http://open.node.com/test/youtube/youtube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -269,7 +269,7 @@ ProxyPolicy-Insert-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00008
[Tags] selfserver http Insert ip+请求头右匹配+url
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -308,7 +308,7 @@ ProxyPolicy-Insert-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00009
[Tags] selfserver http Insert ip+请求头字串匹配+url
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -347,7 +347,7 @@ ProxyPolicy-Insert-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00010
[Tags] selfserver http Insert ip+请求头完整匹配+url
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -386,7 +386,7 @@ ProxyPolicy-Insert-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00011
[Tags] selfserver http Insert ip+请求头左匹配+url
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -425,13 +425,13 @@ ProxyPolicy-Insert-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00012
[Tags] selfserver http Insert ip+cookie字串匹配+url
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
@@ -450,8 +450,8 @@ ProxyPolicy-Insert-Http-00012
${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/ProxyPolicy-Redirect-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-insert-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -464,7 +464,7 @@ ProxyPolicy-Insert-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00013
[Tags] selfserver http Insert ip+应答头右匹配+url
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -489,8 +489,8 @@ ProxyPolicy-Insert-Http-00013
${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/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -503,7 +503,7 @@ ProxyPolicy-Insert-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00014
[Tags] selfserver http Insert ip+应答头字串匹配+url
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -528,8 +528,8 @@ ProxyPolicy-Insert-Http-00014
${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/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv http://open.node.com/test/xiaozhu/xiaozhu.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -542,9 +542,9 @@ ProxyPolicy-Insert-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00015
[Tags] selfserver http Insert ip+应答头完整匹配+url
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html;charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
@@ -567,8 +567,8 @@ ProxyPolicy-Insert-Http-00015
${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/ProxyPolicy-Redirect-HTTP-0003.bat
... ELSE set variable curl -kv http://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -581,7 +581,7 @@ ProxyPolicy-Insert-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00016
[Tags] selfserver http Insert ip+应答头左匹配+url
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -606,8 +606,8 @@ ProxyPolicy-Insert-Http-00016
${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/ProxyPolicy-Redirect-HTTP-0002.bat
... ELSE set variable curl -kv \ http://open.node.com/test/youtube/youtube.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
@@ -620,7 +620,7 @@ ProxyPolicy-Insert-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00017
[Tags] selfserver http Insert ip+set-cookie右匹配+url
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -659,7 +659,7 @@ ProxyPolicy-Insert-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00018
[Tags] selfserver http Insert ip+set-cookie字串匹配+url
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -698,7 +698,7 @@ ProxyPolicy-Insert-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00019
[Tags] selfserver http Insert ip+set-cookie完整匹配+url
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -737,7 +737,7 @@ ProxyPolicy-Insert-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00020
[Tags] selfserver http Insert ip+set-cookie左匹配+url
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -776,7 +776,7 @@ ProxyPolicy-Insert-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00021
[Tags] selfserver 最大组合 http Insert
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -825,3 +825,59 @@ ProxyPolicy-Insert-Http-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Http-00022
[Tags] selfserver 修改
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_sk_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Insert-HTTP-00022 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_REQ_HDR,${object_url_Id}|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/ProxyPolicy-insert-HTTP-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Insert-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_sk_Id}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!")
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -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,21 +11,21 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/insertscripts
${url} /v1/policy/profile/insertscripts
${profiledId} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Insert-Ssl-00001
[Tags] selfserver ssl Hijack ip+url
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -37,10 +37,10 @@ ProxyPolicy-Insert-Ssl-00001
${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 type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
@@ -51,20 +51,20 @@ ProxyPolicy-Insert-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00002
[Tags] selfserver ssl Insert ip+fqdn完整匹配+url
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -76,8 +76,8 @@ ProxyPolicy-Insert-Ssl-00002
${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
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA \ \ \ Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -90,20 +90,20 @@ ProxyPolicy-Insert-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00003
[Tags] selfserver ssl Insert ip+cat右匹配+url
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*action
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -115,8 +115,8 @@ ProxyPolicy-Insert-Ssl-00003
${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/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -129,16 +129,16 @@ ProxyPolicy-Insert-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00004
[Tags] selfserver ssl Insert ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -150,8 +150,8 @@ ProxyPolicy-Insert-Ssl-00004
${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
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -164,16 +164,16 @@ ProxyPolicy-Insert-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00005
[Tags] selfserver ssl Insert ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -185,8 +185,8 @@ ProxyPolicy-Insert-Ssl-00005
${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-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -199,16 +199,16 @@ ProxyPolicy-Insert-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00006
[Tags] selfserver ssl Insert ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -220,8 +220,8 @@ ProxyPolicy-Insert-Ssl-00006
${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-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -234,7 +234,7 @@ ProxyPolicy-Insert-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00007
[Tags] selfserver ssl Insert ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -243,7 +243,7 @@ ProxyPolicy-Insert-Ssl-00007
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -255,8 +255,8 @@ ProxyPolicy-Insert-Ssl-00007
${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/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
@@ -269,7 +269,7 @@ ProxyPolicy-Insert-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00008
[Tags] selfserver ssl Insert ip+请求头右匹配+url
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Insert-Ssl-00008
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -308,7 +308,7 @@ ProxyPolicy-Insert-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00009
[Tags] selfserver ssl Insert ip+请求头字串匹配+url
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -321,7 +321,7 @@ ProxyPolicy-Insert-Ssl-00009
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -347,7 +347,7 @@ ProxyPolicy-Insert-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00010
[Tags] selfserver ssl Insert ip+请求头完整匹配+url
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -360,7 +360,7 @@ ProxyPolicy-Insert-Ssl-00010
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -386,7 +386,7 @@ ProxyPolicy-Insert-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00011
[Tags] selfserver ssl Insert ip+请求头左匹配+url
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -399,7 +399,7 @@ ProxyPolicy-Insert-Ssl-00011
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -425,20 +425,20 @@ ProxyPolicy-Insert-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00012
[Tags] selfserver ssl Insert ip+cookie字串匹配+url
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -450,8 +450,8 @@ ProxyPolicy-Insert-Ssl-00012
${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/ProxyPolicy-Deny-SSL-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'https://www.baidu.com/' \ https://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-insert-SSL-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'https://www.baidu.com/' \ https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -464,9 +464,9 @@ ProxyPolicy-Insert-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00013
[Tags] selfserver ssl Insert ip+应答头右匹配+url
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
@@ -477,7 +477,7 @@ ProxyPolicy-Insert-Ssl-00013
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -489,8 +489,8 @@ ProxyPolicy-Insert-Ssl-00013
${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
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -503,7 +503,7 @@ ProxyPolicy-Insert-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00014
[Tags] selfserver ssl Insert ip+应答头字串匹配+url
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -516,7 +516,7 @@ ProxyPolicy-Insert-Ssl-00014
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -528,8 +528,8 @@ ProxyPolicy-Insert-Ssl-00014
${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
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -542,9 +542,9 @@ ProxyPolicy-Insert-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00015
[Tags] selfserver ssl Insert ip+应答头完整匹配+url
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html;charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
@@ -555,7 +555,7 @@ ProxyPolicy-Insert-Ssl-00015
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -567,8 +567,8 @@ ProxyPolicy-Insert-Ssl-00015
${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-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -581,7 +581,7 @@ ProxyPolicy-Insert-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00016
[Tags] selfserver ssl Insert ip+应答头左匹配+url
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -594,7 +594,7 @@ ProxyPolicy-Insert-Ssl-00016
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -606,8 +606,8 @@ ProxyPolicy-Insert-Ssl-00016
${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-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -620,7 +620,7 @@ ProxyPolicy-Insert-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00017
[Tags] selfserver ssl Insert ip+set-cookie右匹配+url
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -633,7 +633,7 @@ ProxyPolicy-Insert-Ssl-00017
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -659,7 +659,7 @@ ProxyPolicy-Insert-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00018
[Tags] selfserver ssl Insert ip+set-cookie字串匹配+url
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -672,7 +672,7 @@ ProxyPolicy-Insert-Ssl-00018
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -698,7 +698,7 @@ ProxyPolicy-Insert-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00019
[Tags] selfserver ssl Insert ip+set-cookie完整匹配+url
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -711,7 +711,7 @@ ProxyPolicy-Insert-Ssl-00019
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -724,7 +724,7 @@ ProxyPolicy-Insert-Ssl-00019
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0019.bat
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" https://open.node.com/action
... ELSE set variable curl -kv \ -H "Content-Type:application/x-www-form-urlencoded" \ POST -d "reqBody=test&setCookie=12345678&resBody=Response Body" https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -737,7 +737,7 @@ ProxyPolicy-Insert-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00020
[Tags] selfserver ssl Insert ip+set-cookie左匹配+url
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -750,7 +750,7 @@ ProxyPolicy-Insert-Ssl-00020
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -776,7 +776,7 @@ ProxyPolicy-Insert-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00021
[Tags] selfserver 最大组合 ssl Insert
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -800,7 +800,7 @@ ProxyPolicy-Insert-Ssl-00021
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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}]}
@@ -813,7 +813,7 @@ ProxyPolicy-Insert-Ssl-00021
${policyIds} Create List ${policyId1} ${policyId2}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-SSL-00023.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" -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://open.node.com/action
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" \ POST -d "reqBody=test&setCookie=12345678&resBody=Response Body" -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://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
@@ -824,3 +824,59 @@ ProxyPolicy-Insert-Ssl-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Insert-Ssl-00022
[Tags] selfserver 修改
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建insert文件
${response} CreatePolicyFile2 ${url} ${path}/insert_files/ Create-Insert Scripts-test-1.js insert
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Insert-SSL-00022 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_RES_HDR,${object_url_Id}|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/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Insert-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"insert","insert_profile":${profiledId},"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0008.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://open.node.com
@{stringlist} run keyword if '${systemType}'=='Windows' Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List type="text/javascript" class="RQ_SCRIPT">alert("执行javascript!") X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Monitor-Http-00001
[Tags] selfserver ip http monitor
[Tags] selfserver ip
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,7 +46,7 @@ ProxyPolicy-Monitor-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http monitor
[Tags] selfserver ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -78,7 +78,7 @@ ProxyPolicy-Monitor-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00003
[Tags] selfserver ip+cat右匹配 http monitor
[Tags] selfserver ip+cat右匹配
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -110,7 +110,7 @@ ProxyPolicy-Monitor-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00004
[Tags] selfserver http monitor ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -142,7 +142,7 @@ ProxyPolicy-Monitor-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00005
[Tags] selfserver http monitor ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -174,9 +174,9 @@ ProxyPolicy-Monitor-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00006
[Tags] selfserver http monitor ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/tengrinews/tengrinews.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
@@ -206,7 +206,7 @@ ProxyPolicy-Monitor-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00007
[Tags] selfserver http monitor ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -238,7 +238,7 @@ ProxyPolicy-Monitor-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00008
[Tags] selfserver http monitor ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -270,7 +270,7 @@ ProxyPolicy-Monitor-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00009
[Tags] selfserver http monitor ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -302,7 +302,7 @@ ProxyPolicy-Monitor-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00010
[Tags] selfserver http monitor ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -334,7 +334,7 @@ ProxyPolicy-Monitor-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00011
[Tags] selfserver http monitor ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -366,7 +366,7 @@ ProxyPolicy-Monitor-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00012
[Tags] selfserver http monitor ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -398,7 +398,7 @@ ProxyPolicy-Monitor-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00013
[Tags] selfserver http monitor ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -430,7 +430,7 @@ ProxyPolicy-Monitor-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00014
[Tags] selfserver http monitor ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -462,7 +462,7 @@ ProxyPolicy-Monitor-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00015
[Tags] selfserver http monitor ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -494,7 +494,7 @@ ProxyPolicy-Monitor-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00016
[Tags] selfserver http monitor ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -526,7 +526,7 @@ ProxyPolicy-Monitor-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00017
[Tags] selfserver http monitor ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -558,7 +558,7 @@ ProxyPolicy-Monitor-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00018
[Tags] selfserver http monitor ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -590,7 +590,7 @@ ProxyPolicy-Monitor-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00019
[Tags] selfserver http monitor ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -622,7 +622,7 @@ ProxyPolicy-Monitor-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00020
[Tags] selfserver http monitor ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -654,7 +654,7 @@ ProxyPolicy-Monitor-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00021
[Tags] selfserver http monitor ip+请求体字串匹配
[Tags] selfserver ip+请求体字串匹配
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -666,7 +666,7 @@ ProxyPolicy-Monitor-Http-00021
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${rescode} ${policyId3} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId2} set Variable {"policyType":"pxy_manipulation","policyIds":[${policyId3}]}
@@ -686,7 +686,7 @@ ProxyPolicy-Monitor-Http-00021
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00022
[Tags] selfserver http monitor ip+应答体字串匹配
[Tags] selfserver ip+应答体字串匹配
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -718,7 +718,7 @@ ProxyPolicy-Monitor-Http-00022
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00023
[Tags] selfserver 最大组合 http monitor
[Tags] selfserver 最大组合
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -764,3 +764,179 @@ ProxyPolicy-Monitor-Http-00023
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00024
[Tags] selfserver 修改
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","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-HTTP-0001.bat
... ELSE set variable curl http://open.node.com/test/xiaozhu/xiaozhu.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 酒店式公寓
... ELSE Create List 酒店式公寓
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl \ --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 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 发送POST请求
... ELSE Create List 发送POST请求
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00025
[Tags] selfserver ip+请求体and关系
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00025 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"block","message":"Извините","code":451,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${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/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List jwctest
... ELSE Create List jwctest
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00026
[Tags] selfserver ip+请求体或更新
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,qazx
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00026 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT
${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/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List jwctest
... ELSE Create List jwctest
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00027
[Tags] selfserver ip+应答体and关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response& Body
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00027 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${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-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Response Body
... ELSE Create List Response Body
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Monitor-Http-00028
[Tags] selfserver ip+应答体或关系
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Response,你好明天
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Monitor-HTTP-00028 policyType=pxy_manipulation policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"method":"monitor","protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_CONTENT
${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-Deny-HTTP-0017.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Response Body
... ELSE Create List Response Body
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Redirect-Http-00001
[Tags] selfserver ip http redirect
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,7 +46,7 @@ ProxyPolicy-Redirect-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http redirect
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -82,7 +82,7 @@ ProxyPolicy-Redirect-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00003
[Tags] selfserver ip+cat右匹配 http redirect
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -118,7 +118,7 @@ ProxyPolicy-Redirect-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00004
[Tags] selfserver http redirect ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -150,7 +150,7 @@ ProxyPolicy-Redirect-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00005
[Tags] selfserver http redirect ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -182,7 +182,7 @@ ProxyPolicy-Redirect-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00006
[Tags] selfserver http redirect ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -214,7 +214,7 @@ ProxyPolicy-Redirect-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00007
[Tags] selfserver http redirect ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -246,7 +246,7 @@ ProxyPolicy-Redirect-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00008
[Tags] selfserver http redirect ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Redirect-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00009
[Tags] selfserver http redirect ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -318,7 +318,7 @@ ProxyPolicy-Redirect-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00010
[Tags] selfserver http redirect ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -354,7 +354,7 @@ ProxyPolicy-Redirect-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00011
[Tags] selfserver http redirect ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ ProxyPolicy-Redirect-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00012
[Tags] selfserver http redirect ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -426,7 +426,7 @@ ProxyPolicy-Redirect-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00013
[Tags] selfserver http redirect ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -462,7 +462,7 @@ ProxyPolicy-Redirect-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00014
[Tags] selfserver http redirect ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -498,7 +498,7 @@ ProxyPolicy-Redirect-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00015
[Tags] selfserver http redirect ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -534,7 +534,7 @@ ProxyPolicy-Redirect-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00016
[Tags] selfserver http redirect ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -570,7 +570,7 @@ ProxyPolicy-Redirect-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00017
[Tags] selfserver http redirect ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -606,7 +606,7 @@ ProxyPolicy-Redirect-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00018
[Tags] selfserver http redirect ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -642,7 +642,7 @@ ProxyPolicy-Redirect-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00019
[Tags] selfserver http redirect ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -678,7 +678,7 @@ ProxyPolicy-Redirect-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00020
[Tags] selfserver http redirect ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -714,7 +714,7 @@ ProxyPolicy-Redirect-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00021
[Tags] selfserver http redirect ip+请求体字串匹配
[Tags] selfserver ip+请求体字串匹配+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -750,7 +750,7 @@ ProxyPolicy-Redirect-Http-00021
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00022
[Tags] selfserver 最大组合 http redirect
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -800,3 +800,123 @@ ProxyPolicy-Redirect-Http-00022
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00023
[Tags] selfserver 修改
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${object_yd_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_yd_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-HTTP-00023 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.ziroom.com/","code":301,"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/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv \ http://open.node.com/test/xiaozhu/xiaozhu.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.ziroom.com/ 301 X-TG-Construct-By
... ELSE Create List http://www.ziroom.com/ 301 X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-HTTP-00023 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.icbc.com.cn/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL,${object_yd_Id}|TSG_FIELD_HTTP_RES_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redirect-HTTP-0001.bat
... ELSE set variable curl -kv \ http://open.node.com/test/xiaozhu/xiaozhu.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.icbc.com.cn/ 301 X-TG-Construct-By
... ELSE Create List http://www.icbc.com.cn/ 301 X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00024
[Tags] selfserver ip+请求体and关系+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=jwcte&st12
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|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/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.cmbchina.com/ 301 X-TG-Construct-By
... ELSE Create List http://www.cmbchina.com/ 301 X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Http-00025
[Tags] selfserver ip+请求体或关系+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,yyyyy
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-HTTP-00021 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|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/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.cmbchina.com/ 301 X-TG-Construct-By
... ELSE Create List http://www.cmbchina.com/ 301 X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,13 +14,13 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Redirect-Ssl-00001
[Tags] selfserver ip ssl redirect
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -46,7 +46,7 @@ ProxyPolicy-Redirect-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00002
[Tags] selfserver ip+fqdn完整匹配 ssl redirect
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -56,7 +56,7 @@ ProxyPolicy-Redirect-Ssl-00002
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -82,7 +82,7 @@ ProxyPolicy-Redirect-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00003
[Tags] selfserver ip+cat右匹配 ssl redirect
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -92,7 +92,7 @@ ProxyPolicy-Redirect-Ssl-00003
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -118,13 +118,13 @@ ProxyPolicy-Redirect-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00004
[Tags] selfserver ssl redirect ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -150,13 +150,13 @@ ProxyPolicy-Redirect-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00005
[Tags] selfserver ssl redirect ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -182,13 +182,13 @@ ProxyPolicy-Redirect-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00006
[Tags] selfserver ssl redirect ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -214,13 +214,13 @@ ProxyPolicy-Redirect-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00007
[Tags] selfserver ssl redirect ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -246,7 +246,7 @@ ProxyPolicy-Redirect-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00008
[Tags] selfserver ssl redirect ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -256,7 +256,7 @@ ProxyPolicy-Redirect-Ssl-00008
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -282,7 +282,7 @@ ProxyPolicy-Redirect-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00009
[Tags] selfserver ssl redirect ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -292,7 +292,7 @@ ProxyPolicy-Redirect-Ssl-00009
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -318,7 +318,7 @@ ProxyPolicy-Redirect-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00010
[Tags] selfserver ssl redirect ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -328,7 +328,7 @@ ProxyPolicy-Redirect-Ssl-00010
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -354,7 +354,7 @@ ProxyPolicy-Redirect-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00011
[Tags] selfserver ssl redirect ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -364,7 +364,7 @@ ProxyPolicy-Redirect-Ssl-00011
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -390,7 +390,7 @@ ProxyPolicy-Redirect-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00012
[Tags] selfserver ssl redirect ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -400,7 +400,7 @@ ProxyPolicy-Redirect-Ssl-00012
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -426,7 +426,7 @@ ProxyPolicy-Redirect-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00013
[Tags] selfserver ssl redirect ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -436,7 +436,7 @@ ProxyPolicy-Redirect-Ssl-00013
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -462,7 +462,7 @@ ProxyPolicy-Redirect-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00014
[Tags] selfserver ssl redirect ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -472,7 +472,7 @@ ProxyPolicy-Redirect-Ssl-00014
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -498,7 +498,7 @@ ProxyPolicy-Redirect-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00015
[Tags] selfserver ssl redirect ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -508,7 +508,7 @@ ProxyPolicy-Redirect-Ssl-00015
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -534,7 +534,7 @@ ProxyPolicy-Redirect-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00016
[Tags] selfserver ssl redirect ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -544,7 +544,7 @@ ProxyPolicy-Redirect-Ssl-00016
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -570,7 +570,7 @@ ProxyPolicy-Redirect-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00017
[Tags] selfserver ssl redirect ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -580,7 +580,7 @@ ProxyPolicy-Redirect-Ssl-00017
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -606,7 +606,7 @@ ProxyPolicy-Redirect-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00018
[Tags] selfserver ssl redirect ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -616,7 +616,7 @@ ProxyPolicy-Redirect-Ssl-00018
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -642,7 +642,7 @@ ProxyPolicy-Redirect-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00019
[Tags] selfserver ssl redirect ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -652,7 +652,7 @@ ProxyPolicy-Redirect-Ssl-00019
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -678,7 +678,7 @@ ProxyPolicy-Redirect-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00020
[Tags] selfserver ssl redirect ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -688,7 +688,7 @@ ProxyPolicy-Redirect-Ssl-00020
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -714,7 +714,7 @@ ProxyPolicy-Redirect-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00021
[Tags] selfserver ssl redirect ip+请求体字串匹配
[Tags] selfserver ip+请求体字串匹配+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -724,7 +724,7 @@ ProxyPolicy-Redirect-Ssl-00021
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -750,7 +750,7 @@ ProxyPolicy-Redirect-Ssl-00021
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00022
[Tags] selfserver 最大组合 ssl redirect
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -776,7 +776,7 @@ ProxyPolicy-Redirect-Ssl-00022
${rescode} ${object_by_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_by_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -800,3 +800,127 @@ ProxyPolicy-Redirect-Ssl-00022
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00023
[Tags] selfserver 修改
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Redirect-SSL-00023 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.douyu.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_HDR,${object_url_Id}|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/ProxyPolicy-Deny-SSL-0012.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'https://www.baidu.com/' \ https://open.node.com/test/nationalbank/nationalbank.html
@{stringlist} run keyword if '${systemType}'=='Windows' Create List https://www.douyu.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List https://www.douyu.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Redirect-SSL-00023 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"https://www.sojson.com","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_cat_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-SSL-00017.bat
... ELSE set variable curl -kv https://open.node.com/
@{stringlist} run keyword if '${systemType}'=='Windows' Create List https://www.sojson.com 301 X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List https://www.sojson.com 301 X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00024
[Tags] selfserver ip+请求体and关系+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=jwct&est123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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=proxyPolicy-Redirect-SSL-00024 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|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/ProxyPolicy-Redirect-SSL-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.cmbchina.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List http://www.cmbchina.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Redirect-Ssl-00025
[Tags] selfserver ip+请求体或关系+url
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=jwct,est123
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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=proxyPolicy-Redirect-SSL-00025 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"redirect","to":"http://www.cmbchina.com/","code":301,"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_REQ_CONTENT,${object_url_Id}|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/ProxyPolicy-Redirect-SSL-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv https://open.node.com/action
@{stringlist} run keyword if '${systemType}'=='Windows' Create List http://www.cmbchina.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
... ELSE Create List http://www.cmbchina.com/ 301 X-TG-Construct-By Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Replace-Http-00001
[Tags] selfserver ip http replace
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -46,7 +46,7 @@ ProxyPolicy-Replace-Http-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00002
[Tags] selfserver ip+fqdn完整匹配 http replace
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -82,7 +82,7 @@ ProxyPolicy-Replace-Http-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00003
[Tags] selfserver ip+cat右匹配 http replace
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -118,7 +118,7 @@ ProxyPolicy-Replace-Http-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00004
[Tags] selfserver http replace ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*xiaozhu.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -150,7 +150,7 @@ ProxyPolicy-Replace-Http-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00005
[Tags] selfserver http replace ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -182,7 +182,7 @@ ProxyPolicy-Replace-Http-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00006
[Tags] selfserver http replace ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -214,7 +214,7 @@ ProxyPolicy-Replace-Http-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00007
[Tags] selfserver http replace ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -246,7 +246,7 @@ ProxyPolicy-Replace-Http-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00008
[Tags] selfserver http replace ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -282,7 +282,7 @@ ProxyPolicy-Replace-Http-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00009
[Tags] selfserver http replace ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -318,7 +318,7 @@ ProxyPolicy-Replace-Http-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00010
[Tags] selfserver http replace ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -354,7 +354,7 @@ ProxyPolicy-Replace-Http-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00011
[Tags] selfserver http replace ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ ProxyPolicy-Replace-Http-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00012
[Tags] selfserver http replace ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -426,7 +426,7 @@ ProxyPolicy-Replace-Http-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00013
[Tags] selfserver http replace ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*charset=UTF-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -462,7 +462,7 @@ ProxyPolicy-Replace-Http-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00014
[Tags] selfserver http replace ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -498,7 +498,7 @@ ProxyPolicy-Replace-Http-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00015
[Tags] selfserver http replace ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=utf-8|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -534,7 +534,7 @@ ProxyPolicy-Replace-Http-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00016
[Tags] selfserver http replace ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -570,7 +570,7 @@ ProxyPolicy-Replace-Http-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00017
[Tags] selfserver http replace ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -606,7 +606,7 @@ ProxyPolicy-Replace-Http-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00018
[Tags] selfserver http replace ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -642,7 +642,7 @@ ProxyPolicy-Replace-Http-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00019
[Tags] selfserver http replace ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -678,7 +678,7 @@ ProxyPolicy-Replace-Http-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00020
[Tags] selfserver http replace ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -714,7 +714,7 @@ ProxyPolicy-Replace-Http-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00021
[Tags] selfserver 最大组合 http replace
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -760,3 +760,57 @@ ProxyPolicy-Replace-Http-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Http-00022
[Tags] selfserver 修改
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${object_sk_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_sk_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject= isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyId1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]}
${policyIds} Create List ${policyId1}
Comment 创建管控策略
${policyDict} Create Dictionary policyName=proxyPolicy-Replace-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"replace","rules":[{"search_in":"http_resp_header","find":"html","replace_with":"json"}],"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_RES_HDR,${object_url_Id}|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/ProxyPolicy-Redirect-HTTP-0002.bat
... ELSE set variable curl -kv \ http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List text/json
... ELSE Create List text/json
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Replace-HTTP-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"发送POST请求","replace_with":"лайн"}],"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL,${object_sk_Id}|TSG_FIELD_HTTP_RES_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00017.bat
... ELSE set variable curl -kv http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List лайн
... ELSE Create List лайн
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -14,13 +14,13 @@ ${objectids} ${EMPTY}
*** Test Cases ***
ProxyPolicy-Replace-Ssl-00001
[Tags] selfserver ip ssl replace
[Tags] selfserver ip+url
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -46,7 +46,7 @@ ProxyPolicy-Replace-Ssl-00001
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00002
[Tags] selfserver ip+fqdn完整匹配 ssl replace
[Tags] selfserver ip+fqdn完整匹配+url
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -56,7 +56,7 @@ ProxyPolicy-Replace-Ssl-00002
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -82,7 +82,7 @@ ProxyPolicy-Replace-Ssl-00002
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00003
[Tags] selfserver ip+cat右匹配 ssl replace
[Tags] selfserver ip+cat右匹配+url
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
@@ -92,7 +92,7 @@ ProxyPolicy-Replace-Ssl-00003
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -118,13 +118,13 @@ ProxyPolicy-Replace-Ssl-00003
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00004
[Tags] selfserver ssl replace ip+url右匹配
[Tags] selfserver ip+url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*rutube.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -150,13 +150,13 @@ ProxyPolicy-Replace-Ssl-00004
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00005
[Tags] selfserver ssl replace ip+url字串匹配
[Tags] selfserver ip+url字串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=test
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -182,13 +182,13 @@ ProxyPolicy-Replace-Ssl-00005
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00006
[Tags] selfserver ssl replace ip+url完整匹配
[Tags] selfserver ip+url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/bytedance/bytedance.html
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -214,13 +214,13 @@ ProxyPolicy-Replace-Ssl-00006
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00007
[Tags] selfserver ssl replace ip+url左匹配
[Tags] selfserver ip+url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node*
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -246,7 +246,7 @@ ProxyPolicy-Replace-Ssl-00007
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00008
[Tags] selfserver ssl replace ip+请求头右匹配
[Tags] selfserver ip+请求头右匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -256,7 +256,7 @@ ProxyPolicy-Replace-Ssl-00008
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -282,7 +282,7 @@ ProxyPolicy-Replace-Ssl-00008
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00009
[Tags] selfserver ssl replace ip+请求头字串匹配
[Tags] selfserver ip+请求头字串匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -292,7 +292,7 @@ ProxyPolicy-Replace-Ssl-00009
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -318,7 +318,7 @@ ProxyPolicy-Replace-Ssl-00009
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00010
[Tags] selfserver ssl replace ip+请求头完整匹配
[Tags] selfserver ip+请求头完整匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -328,7 +328,7 @@ ProxyPolicy-Replace-Ssl-00010
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -354,7 +354,7 @@ ProxyPolicy-Replace-Ssl-00010
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00011
[Tags] selfserver ssl replace ip+请求头左匹配
[Tags] selfserver ip+请求头左匹配+url
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -364,7 +364,7 @@ ProxyPolicy-Replace-Ssl-00011
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -390,7 +390,7 @@ ProxyPolicy-Replace-Ssl-00011
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00012
[Tags] selfserver ssl replace ip+cookie字串匹配
[Tags] selfserver ip+cookie字串匹配+url
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -400,7 +400,7 @@ ProxyPolicy-Replace-Ssl-00012
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -426,7 +426,7 @@ ProxyPolicy-Replace-Ssl-00012
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00013
[Tags] selfserver ssl replace ip+应答头右匹配
[Tags] selfserver ip+应答头右匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -436,7 +436,7 @@ ProxyPolicy-Replace-Ssl-00013
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -462,7 +462,7 @@ ProxyPolicy-Replace-Ssl-00013
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00014
[Tags] selfserver ssl replace ip+应答头字串匹配
[Tags] selfserver ip+应答头字串匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -472,7 +472,7 @@ ProxyPolicy-Replace-Ssl-00014
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -498,7 +498,7 @@ ProxyPolicy-Replace-Ssl-00014
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00015
[Tags] selfserver ssl replace ip+应答头完整匹配
[Tags] selfserver ip+应答头完整匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -508,7 +508,7 @@ ProxyPolicy-Replace-Ssl-00015
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -534,7 +534,7 @@ ProxyPolicy-Replace-Ssl-00015
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00016
[Tags] selfserver ssl replace ip+应答头左匹配
[Tags] selfserver ip+应答头左匹配+url
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text/html*|Content-Type
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -544,7 +544,7 @@ ProxyPolicy-Replace-Ssl-00016
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -570,7 +570,7 @@ ProxyPolicy-Replace-Ssl-00016
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00017
[Tags] selfserver ssl replace ip+set-cookie右匹配
[Tags] selfserver ip+set-cookie右匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*HttpOnly|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -580,7 +580,7 @@ ProxyPolicy-Replace-Ssl-00017
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -606,7 +606,7 @@ ProxyPolicy-Replace-Ssl-00017
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00018
[Tags] selfserver ssl replace ip+set-cookie字串匹配
[Tags] selfserver ip+set-cookie字串匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -616,7 +616,7 @@ ProxyPolicy-Replace-Ssl-00018
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -642,7 +642,7 @@ ProxyPolicy-Replace-Ssl-00018
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00019
[Tags] selfserver ssl replace ip+set-cookie完整匹配
[Tags] selfserver ip+set-cookie完整匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -652,7 +652,7 @@ ProxyPolicy-Replace-Ssl-00019
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -678,7 +678,7 @@ ProxyPolicy-Replace-Ssl-00019
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00020
[Tags] selfserver ssl replace ip+set-cookie左匹配
[Tags] selfserver ip+set-cookie左匹配+url
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=JSESSIONID*|Set-Cookie
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -688,7 +688,7 @@ ProxyPolicy-Replace-Ssl-00020
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -714,7 +714,7 @@ ProxyPolicy-Replace-Ssl-00020
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00021
[Tags] selfserver 最大组合 ssl replace
[Tags] selfserver 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -735,7 +735,7 @@ ProxyPolicy-Replace-Ssl-00021
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=charset|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject= isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-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}]}
@@ -759,3 +759,57 @@ ProxyPolicy-Replace-Ssl-00021
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
ProxyPolicy-Replace-Ssl-00022
[Tags] selfserver 修改
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=html|Content-Type
${rescode} ${object_re_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_re_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_rq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_rq_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"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=proxyPolicy-Replace-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"видео","replace_with":"酒店式公寓"}],"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL,${object_re_Id}|TSG_FIELD_HTTP_RES_HDR
${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 酒店式公寓 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 酒店式公寓 Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId3}
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
Comment 修改策略
${policyDict} Create Dictionary policyName=proxyPolicy-Replace-SSL-00022 policyType=pxy_manipulation policyDesc=autotest userTags= action=manipulation effectiveRange= userRegion={"method":"replace","rules":[{"search_in":"http_resp_body","find":"发送POST请求","replace_with":"你好明天"}],"protocol":"HTTP"} isValid=${1} appObjectIdArray=2 referenceObject=${objectId}|TSG_FIELD_HTTP_URL,${object_rq_Id}|TSG_FIELD_HTTP_REQ_HDR policyId=${policyId3}
${rescode} ${policyId3} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Deny-SSL-0008.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://open.node.com
@{stringlist} run keyword if '${systemType}'=='Windows' Create List 你好明天 Tango Secure Gateway CA X-TG-Construct-By
... ELSE Create List 你好明天 Tango Secure Gateway CA X-TG-Construct-By
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${commandstr} @{stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList proxy_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -0,0 +1,35 @@
*** Settings ***
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
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-DNS-00001
[Tags] selfserver monitor dns
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "DNS"} isValid=${1} appObjectIdArray=4
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.yhd.com
... ELSE set variable nslookup -d www.yhd.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List canonical name = www.yhd.com
... ELSE Create List canonical name = www.yhd.com
${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} common_sled_ip 192.168.40.161

View File

@@ -0,0 +1,32 @@
*** Settings ***
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
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-Ftp-00001
[Tags] selfserver monitor ftp
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-FTP-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"FTP"} isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_server_ip 192.168.100.5

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Allow-Http-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-HTTP-00002 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Allow-Http-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-HTTP-00003 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -101,11 +101,11 @@ SecurityPolicy-Allow-Http-00004
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-HTTP-00003 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}

View File

@@ -0,0 +1,45 @@
*** Settings ***
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 ../../../../03-Variable/AllFlowCaseVariable.txt
Library Custometest
Resource ../../../../02-Keyword/tsg_common/StmpHandle.robot
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Allow-Mail-00001
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-Mail-00001 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol":"MAIL"} isValid=${1} appObjectIdArray=5
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable jwctest@mail.tsgmail.com
${邮箱密码} Set Variable jwctest
${邮件主题} Set Variable 123test
${发送者} Set Variable jwctest@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["zmmtest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Allow-SSL-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Allow-SSL-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=allow effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-DNS-00001
[Tags] Selfserver Deny Dns Ip+Fqdn右匹配
[Tags] selfserver dns deny ip+fqdn右匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*yhd.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -26,7 +26,7 @@ SecurityPolicy-Deny-DNS-00001
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.yhd.com
... ELSE set variable nslookup -d www.yhd.com
... ELSE set variable nslookup \ www.yhd.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 超时
... ELSE Create List canonical name = www.yhd.com
${starttime} Get Time
@@ -39,19 +39,19 @@ SecurityPolicy-Deny-DNS-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname yhd.com
SecurityPolicy-Deny-DNS-00002
[Tags] Selfserver Deny Dns Ip+Cat完整匹配
Comment 创建fqdn
[Tags] selfserver Ip+cat完整匹配 dns deny
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$www.toutiao.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"CNAME","value":"www.vip.com","ttl":{"min":300,"max":300}}]}]} isValid=${1} appObjectIdArray=4
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00002 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"CNAME","value":"www.vip.com","ttl":{"min":300,"max":300}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_cat_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.toutiao.com
... ELSE set variable nslookup \ www.toutiao.com
... ELSE set variable nslookup -debug -query=A \ www.toutiao.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List canonical name = www.vip.com
... ELSE Create List canonical name = www.vip.com
${starttime} Get Time
@@ -62,3 +62,204 @@ SecurityPolicy-Deny-DNS-00002
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname toutiao.com
SecurityPolicy-Deny-DNS-00003
[Tags] dns deny selfserver 多Ip+fqdn网站匹配
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.18|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.douban.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00003 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"CNAME","value":"www.taobao.com","ttl":{"min":350,"max":350}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME,${objectId}|TSG_SECURITY_SOURCE_ADDR
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.douban.com
... ELSE set variable nslookup -debug -query=AAAA \ www.douban.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List canonical name = www.taobao.com
... ELSE Create List canonical name = www.taobao.com
${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} dns_qname www.douban.com
SecurityPolicy-Deny-DNS-00004
[Tags] selfserver Ip+cat完整匹配 dns deny
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$www.mgtv.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00004 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"A","value":"192.168.50.18","ttl":{"min":400,"max":400}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_cat_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.mgtv.com
... ELSE set variable nslookup -debug -query=A \ www.mgtv.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18
... ELSE Create List 192.168.50.18
${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} dns_qname www.mgtv.com
SecurityPolicy-Deny-DNS-00005
[Tags] selfserver dns deny ip+fqdn右匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*suning.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"fc00::2:66","ttl":{"min":500,"max":500}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${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
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:66
... ELSE Create List fc00::2:66
${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} dns_qname www.suning.com
SecurityPolicy-Deny-DNS-00006
[Tags] selfserver dns deny Ip+fqdn+cat
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*suning.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_cat_Id}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.mgtv.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"AAAA","answer":[{"atype":"AAAA","value":"fc00::2:66","ttl":{"min":500,"max":500}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.mgtv.com
... ELSE set variable nslookup -debug -query=AAAA \ www.mgtv.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List fc00::2:66
... ELSE Create List fc00::2:66
${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} dns_qname www.mgtv.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"qtype":"A","answer":[{"atype":"A","value":"192.168.50.18","ttl":{"min":400,"max":400}}]}]} referenceObject=${object_cat_Id}|TSG_FIELD_DNS_QNAME isValid=${1} appObjectIdArray=4 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.suning.com
... ELSE set variable nslookup -debug -query=A \ www.suning.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18
... ELSE Create List 192.168.50.18
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} dns_qname www.suning.com
SecurityPolicy-Deny-DNS-00007
[Tags] selfserver dns deny ip+fqdn右匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*suning.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"answer":[{"atype":"AAAA","value":"fc00::2:66","ttl":{"min":300,"max":300}},{"atype":"CNAME","value":"www.zhihu.com","ttl":{"min":300,"max":300}}],"qtype":"AAAA"}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${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
${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
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} dns_qname www.suning.com
SecurityPolicy-Deny-DNS-00008
[Tags] selfserver dns deny ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.zealer.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"answer":[{"atype":"A","value":"192.168.50.18","ttl":{"min":500,"max":500}},{"atype":"CNAME","value":"www.bilibili.com","ttl":{"min":500,"max":500}}],"qtype":"A"}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.zealer.com
... ELSE set variable nslookup -debug -query=A \ www.zealer.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18 www.bilibili.com ttl = 500
... ELSE Create List 192.168.50.18 www.bilibili.com ttl = 500
${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} dns_qname zealer.com
SecurityPolicy-Deny-DNS-00009
[Tags] selfserver dns deny ip+fqdn完整匹配
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$www.douyu.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00009 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"DNS","method":"redirect","resolution":[{"answer":[{"atype":"AAAA","value":"fc00::2:66","ttl":{"min":500,"max":500}},{"atype":"CNAME","value":"www.booking.com","ttl":{"min":500,"max":500}}],"qtype":"AAAA"},{"qtype":"A","answer":[{"atype":"CNAME","value":"www.tuniu.com","ttl":{"min":500,"max":500}},{"atype":"A","value":"192.168.50.18","ttl":{"min":500,"max":500}}]}]} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.douyu.com
... ELSE set variable nslookup -debug -query=A www.douyu.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18 www.tuniu.com ttl = 500 www.booking.com fc00::2:66
... ELSE Create List 192.168.50.18 www.tuniu.com ttl = 500
${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.douyu.com
... ELSE set variable nslookup -debug -query=AAAA www.douyu.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 192.168.50.18 www.tuniu.com ttl = 500 www.booking.com fc00::2:66
... ELSE Create List ttl = 500 www.booking.com fc00::2:66
${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} dns_qname www.douyu.com

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Ftp-00001
[Tags] Selfserver Deny Ftp Account子串匹配
[Tags] selfserver deny ftp account子串匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -36,7 +36,7 @@ SecurityPolicy-Deny-Ftp-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00002
[Tags] Selfserver Deny Ftp Account右匹配
[Tags] selfserver deny ftp account右匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -58,7 +58,7 @@ SecurityPolicy-Deny-Ftp-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00003
[Tags] Selfserver Deny Ftp Account完整匹配
[Tags] selfserver deny ftp account完整匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -80,7 +80,7 @@ SecurityPolicy-Deny-Ftp-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00004
[Tags] Selfserver Deny Ftp Account左匹配
[Tags] selfserver deny ftp account左匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_u*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -102,23 +102,244 @@ SecurityPolicy-Deny-Ftp-00004
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00005
[Tags] Selfserver Deny Ftp Account子串匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_Account_Id}
[Tags] selfserver deny ftp url子串匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=168.100
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appObjectIdArray=6
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_down ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 435814 zmmtext123.txt
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00006
[Tags] selfserver deny ftp url右匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*t.txt
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00007
[Tags] selfserver deny ftp url完整匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$ftp://192.168.100.5/test.txt
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00008
[Tags] selfserver deny ftp url左匹配
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=ftp://192.168.100*
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00009
[Tags] selfserver deny ftp content子串匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文test
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00009 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00010
[Tags] selfserver deny ftp content右匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*test.txt
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00010 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00011
[Tags] selfserver deny ftp content完整匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=$中文test.txt
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00011 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00012
[Tags] selfserver deny ftp content左匹配
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文te*
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00012 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
SecurityPolicy-Deny-Ftp-00013
[Tags] selfserver deny ftp 多ip+修改
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.10|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Account_Id}
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文te*
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00013 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT,${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00013 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_SOURCE_ADDR,${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appObjectIdArray=6 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Deny-Ftp-00014
[Tags] selfserver deny ftp 最大组合
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=168.100
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_url_Id}
Comment 创建content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=中文test
${rescode} ${object_content_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_content_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-FTP-00014 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"FTP","method":"drop"} referenceObject=${object_content_Id}|TSG_FIELD_FTP_CONTENT,${object_url_Id}|TSG_FIELD_FTP_URI isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_url ftp://192.168.100.5/test.txt

View File

@@ -11,12 +11,12 @@ Resource ../../../../03-Variable/AllFlowCaseVariable.txt
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${url} /policy/profile/responsepages
${url} /v1/policy/profile/responsepages
${profiledId} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Http-00001
[Tags] Selfserver Ip Deny Http
[Tags] deny http p selfserver
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -30,7 +30,7 @@ SecurityPolicy-Deny-Http-00001
${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 Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -38,10 +38,10 @@ SecurityPolicy-Deny-Http-00001
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_server_ip 192.168.100.5
SecurityPolicy-Deny-Http-00002
[Tags] Selfserver Deny Http Ip+Fqdn右匹配
[Tags] selfserver deny http ip+fqdn右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -59,7 +59,7 @@ SecurityPolicy-Deny-Http-00002
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -70,7 +70,7 @@ SecurityPolicy-Deny-Http-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00003
[Tags] Selfserver Deny Http Ip+Cat完整匹配
[Tags] selfserver deny http ip+cat完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -99,7 +99,7 @@ SecurityPolicy-Deny-Http-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00004
[Tags] Selfserver Deny Http Ip+Url字串匹配
[Tags] selfserver deny http ip+url字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -128,7 +128,7 @@ SecurityPolicy-Deny-Http-00004
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00005
[Tags] Selfserver Deny Http Ip+Url右匹配
[Tags] selfserver deny http ip+url右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -157,7 +157,7 @@ SecurityPolicy-Deny-Http-00005
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00006
[Tags] Selfserver Deny Http Ip+Url完整匹配
[Tags] selfserver deny http ip+url完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -186,7 +186,7 @@ SecurityPolicy-Deny-Http-00006
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00007
[Tags] Selfserver Deny Http Ip+Url左匹配
[Tags] selfserver deny http ip+url左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -215,7 +215,7 @@ SecurityPolicy-Deny-Http-00007
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00008
[Tags] Selfserver Deny Ip+请求头字串匹配 Http
[Tags] selfserver deny ip+请求头字串匹配 http
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -244,7 +244,7 @@ SecurityPolicy-Deny-Http-00008
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00009
[Tags] Selfserver Deny Http Ip+请求头右匹配
[Tags] selfserver deny http ip+请求头右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -273,7 +273,7 @@ SecurityPolicy-Deny-Http-00009
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00010
[Tags] Selfserver Deny Http Ip+请求头完整匹配
[Tags] selfserver deny http ip+请求头完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -302,7 +302,7 @@ SecurityPolicy-Deny-Http-00010
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00011
[Tags] Selfserver Deny Http Ip+请求头左匹配
[Tags] selfserver deny http ip+请求头左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -331,7 +331,7 @@ SecurityPolicy-Deny-Http-00011
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00012
[Tags] Selfserver Http Ip+Cookie子串匹配 Deny
[Tags] selfserver http ip+cookie子串匹配 deny
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -360,7 +360,7 @@ SecurityPolicy-Deny-Http-00012
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00013
[Tags] Selfserver Deny Http Ip+应答头字串匹配
[Tags] selfserver deny http ip+应答头字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -389,7 +389,7 @@ SecurityPolicy-Deny-Http-00013
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00014
[Tags] Selfserver Deny Http Ip+应答头右匹配
[Tags] selfserver deny http ip+应答头右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -418,7 +418,7 @@ SecurityPolicy-Deny-Http-00014
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00015
[Tags] Selfserver Deny Http Ip+应答头完整匹配
[Tags] selfserver deny http ip+应答头完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -447,7 +447,7 @@ SecurityPolicy-Deny-Http-00015
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00016
[Tags] Selfserver Deny Http Ip+应答头左匹配
[Tags] selfserver deny http ip+应答头左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -476,7 +476,7 @@ SecurityPolicy-Deny-Http-00016
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00017
[Tags] Selfserver Deny Http Ip+Set-Cookie字串匹配
[Tags] selfserver deny http ip+set-cookie字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -492,7 +492,7 @@ SecurityPolicy-Deny-Http-00017
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl \ http://open.node.com/
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
@@ -505,7 +505,7 @@ SecurityPolicy-Deny-Http-00017
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00018
[Tags] Selfserver Deny Http Ip+Set-Cookie右匹配
[Tags] selfserver deny http ip+set-cookie右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -521,7 +521,7 @@ SecurityPolicy-Deny-Http-00018
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl \ http://open.node.com/
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
@@ -534,7 +534,7 @@ SecurityPolicy-Deny-Http-00018
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00019
[Tags] Selfserver Deny Ip+Set-Cookie完整匹配 Http
[Tags] selfserver deny ip+set-cookie完整匹配 http
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -550,7 +550,7 @@ SecurityPolicy-Deny-Http-00019
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl \ http://open.node.com/
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
@@ -563,7 +563,7 @@ SecurityPolicy-Deny-Http-00019
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00020
[Tags] Selfserver Deny Ip+Set-Cookie左匹配 Http
[Tags] selfserver deny ip+set-cookie左匹配 http
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -579,7 +579,7 @@ SecurityPolicy-Deny-Http-00020
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl \ http://open.node.com/
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Connection reset by peer
${starttime} Get Time
@@ -592,7 +592,7 @@ SecurityPolicy-Deny-Http-00020
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00021
[Tags] Selfserver Deny Ip+请求体 Http
[Tags] selfserver deny ip+请求体 http
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -621,7 +621,7 @@ SecurityPolicy-Deny-Http-00021
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00022
[Tags] Selfserver Deny Http Ip+应答体
[Tags] selfserver deny http ip+应答体
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -650,7 +650,7 @@ SecurityPolicy-Deny-Http-00022
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00023
[Tags] Selfserver Deny Http 最大组合
[Tags] selfserver deny http 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -660,11 +660,11 @@ SecurityPolicy-Deny-Http-00023
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建url
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node.com
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_uid|Cookie
${rescode} ${object_CK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CK_Id}
Comment 创建应答头
@@ -672,19 +672,19 @@ SecurityPolicy-Deny-Http-00023
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=новости
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00023 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_CK_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR,${object_RQ_Id} |TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00023 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"drop"} referenceObject=${object_fqdn_Id}|TSG_FIELD_HTTP_HOST,${object_url_Id}|TSG_FIELD_HTTP_URL,${object_CK_Id}|TSG_FIELD_HTTP_REQ_HDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0012.bat
... ELSE set variable curl --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.html
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0023.bat
... ELSE set variable curl -kv --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \http://open.node.com/test/tengrinews/tengrinews.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -693,9 +693,8 @@ SecurityPolicy-Deny-Http-00023
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00024
[Tags] selfserver deny Http IP+host block
[Tags] selfserver deny http ip+host block
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
@@ -723,7 +722,7 @@ SecurityPolicy-Deny-Http-00024
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00025
[Tags] selfserver deny Http IP+host alert
[Tags] selfserver deny http ip+host alert
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.10|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -752,13 +751,13 @@ SecurityPolicy-Deny-Http-00025
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00026
[Tags] selfserver deny Http IP+host alert
[Tags] selfserver deny http ip+host alert
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.10|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
#创建引用文件
@@ -784,7 +783,7 @@ SecurityPolicy-Deny-Http-00026
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00027
[Tags] Selfserver Deny Http 最大组合
[Tags] selfserver deny http 最大组合
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
@@ -818,7 +817,7 @@ SecurityPolicy-Deny-Http-00027
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Redirect-HTTP-00023.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" -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 'http://www.baidu.com/' http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -847,7 +846,7 @@ SecurityPolicy-Deny-Http-00028
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -872,7 +871,7 @@ SecurityPolicy-Deny-Http-00029
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -880,7 +879,7 @@ SecurityPolicy-Deny-Http-00029
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} common_server_ip 192.168.100.5
SecurityPolicy-Deny-Http-00030
[Tags] selfserver deny http 新增Filter条件 ip+fqdn
@@ -901,7 +900,7 @@ SecurityPolicy-Deny-Http-00030
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -917,7 +916,7 @@ SecurityPolicy-Deny-Http-00030
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Message content over the limit has been removed
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -925,3 +924,575 @@ SecurityPolicy-Deny-Http-00030
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00031
[Tags] selfserver deny alert http ip+url+请求头字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=node
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00031 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"block","code":404,"html_profile":${profiledId}} referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00031 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl \ --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 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00032
[Tags] selfserver deny alert http ip+url+请求头左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=node
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00032 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Главная страница
... ELSE Create List Главная страница
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00032 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl \ --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 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Главная страница
... ELSE Create List Главная страница
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00033
[Tags] selfserver deny alert http ip+url+请求头右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*nationalbank.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404english.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00033 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"block","code":403,"html_profile":${profiledId}} referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00033 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.bat
... ELSE set variable curl \ --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 'http://www.baidu.com/' \ http://open.node.com
${stringlist} run keyword if '${systemType}'=='Windows' Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
... ELSE Create List Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00034
[Tags] selfserver deny alert http ip+url+请求头完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/xiaozhu/xiaozhu.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00034 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
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 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00034 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0008.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 'http://www.baidu.com/' \ curl \ http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00035
[Tags] selfserver deny alert http ip+set-cookie+应答头字串匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=UTF-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Path=/tsgInterface|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00035 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00035 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/proxyPolicy-Deny-HTTP-00017.bat
... ELSE set variable curl http://open.node.com/
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00036
[Tags] selfserver deny alert http ip+set-cookie+应答头左匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=1234*|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00036 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Главная страница
... ELSE Create List Главная страница
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00036 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"message":"Главная страница"} referenceObject=${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Главная страница
... ELSE Create List Главная страница
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00037
[Tags] selfserver deny alert http ip+set-cookie+应答头完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00037 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
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 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00037 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00038
[Tags] selfserver deny alert http ip+set-cookie+应答头右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*5678|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00038 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl \ http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00038 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00039
[Tags] selfserver deny alert http ip+cookie+请求体+应答体
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${object_CK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CK_Id}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық
${rescode} ${object_yq_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_yq_Id}
#创建引用文件
${response} CreatePolicyFile2 ${url} ${responsePageFiles} 404china.html resPages
${profiledId} Get From Dictionary ${response} profileId
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00039 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0017.bat
... ELSE set variable curl -kv -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=test&setCookie=12345678&contentType=content-type&resBody=Response Body" http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
... ELSE Create List 对不起,您请求的页面不存在、或已被删除、或暂时不可用
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00039 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"HTTP","method":"alert","code":200,"html_profile":${profiledId}} referenceObject=${object_CK_Id}|TSG_FIELD_HTTP_REQ_HDR,${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_yq_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Deny-HTTP-0012.bat
... ELSE set variable curl --cookie "*_ga=GA1.2.721078436.1587543528; _gid=GA1.2.916148851.1587543528; _gat=1; _ym_uid=1587543532244912958; _ym_d=1587543532; _ym_isad=2" --referer 'http://www.baidu.com/' \ http://open.node.com/test/nationalbank/nationalbank.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
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-Http-00040
[Tags] selfserver ip+请求体and关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00040 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${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
SecurityPolicy-Deny-Http-00041
[Tags] selfserver ip+请求体或关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,qazx
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00041 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${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
SecurityPolicy-Deny-Http-00042
[Tags] selfserver ip+应答体and关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық&жайлы
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00022 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.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
SecurityPolicy-Deny-Http-00043
[Tags] selfserver ip+应答体或关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық,1234
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-HTTP-00022 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "HTTP","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.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

View File

@@ -16,13 +16,13 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-Mail-00001
[Tags] Selfserver Subject右匹配 Mail Deny
[Tags] selfserver subject右匹配 mail deny
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*test
${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}]}
@@ -50,7 +50,7 @@ SecurityPolicy-Deny-Mail-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00002
[Tags] Selfserver Subject完整匹配 Mail Deny
[Tags] selfserver subject完整匹配 mail deny
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=$你好明天
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
@@ -84,7 +84,7 @@ SecurityPolicy-Deny-Mail-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00003
[Tags] Selfserver Subject字串匹配 Mail Deny
[Tags] selfserver subject字串匹配 mail deny
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=стопо
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
@@ -118,7 +118,7 @@ SecurityPolicy-Deny-Mail-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00004
[Tags] Selfserver Subject左匹配 Mail Deny
[Tags] selfserver subject左匹配 mail deny
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=zxcv*
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
@@ -152,13 +152,13 @@ SecurityPolicy-Deny-Mail-00004
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00005
[Tags] Selfserver Content字串匹配 Mail Deny
[Tags] selfserver content字串匹配 mail deny
Comment 创建Content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=стопо
${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}]}
@@ -186,13 +186,13 @@ SecurityPolicy-Deny-Mail-00005
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00006
[Tags] Selfserver Deny ATT_CONT字串匹配 Mail
[Tags] selfserver deny att_cont字串匹配 mail
Comment 创建ATT_CONT
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=стопо
${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}]}
@@ -220,13 +220,13 @@ SecurityPolicy-Deny-Mail-00006
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00007
[Tags] Selfserver Deny From右匹配 Mail
[Tags] selfserver deny from右匹配 mail
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*il.com
${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}]}
@@ -254,13 +254,13 @@ SecurityPolicy-Deny-Mail-00007
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00008
[Tags] Selfserver Deny From完整匹配 Mail
[Tags] selfserver deny from完整匹配 mail
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$jwctest@mail.tsgmail.com
${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}]}
@@ -288,13 +288,13 @@ SecurityPolicy-Deny-Mail-00008
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00009
[Tags] Selfserver Deny From字串匹配 Mail
[Tags] selfserver deny from字串匹配 mail
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=tsgmail
${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}]}
@@ -322,13 +322,13 @@ SecurityPolicy-Deny-Mail-00009
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00010
[Tags] Selfserver Deny From左匹配 Mail
[Tags] selfserver deny from左匹配 mail
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwct*
${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}]}
@@ -356,7 +356,7 @@ SecurityPolicy-Deny-Mail-00010
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00011
[Tags] Selfserver Deny To右匹配 Mail
[Tags] selfserver deny to右匹配 mail
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*il.com
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
@@ -390,7 +390,7 @@ SecurityPolicy-Deny-Mail-00011
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00012
[Tags] Selfserver Mali Deny To完整匹配
[Tags] selfserver mali deny to完整匹配
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$zmmtest@mail.tsgmail.com
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
@@ -424,7 +424,7 @@ SecurityPolicy-Deny-Mail-00012
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00013
[Tags] Selfserver Mali Deny To字串匹配
[Tags] selfserver mali deny to字串匹配
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zmmtes
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
@@ -458,7 +458,7 @@ SecurityPolicy-Deny-Mail-00013
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00014
[Tags] Selfserver Mali Deny To左匹配
[Tags] selfserver mali deny to左匹配
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zmmt*
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
@@ -492,7 +492,7 @@ SecurityPolicy-Deny-Mail-00014
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00015
[Tags] Selfserver Mali Deny Account右匹配
[Tags] selfserver mali deny account右匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*ail.com
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -526,7 +526,7 @@ SecurityPolicy-Deny-Mail-00015
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00016
[Tags] Selfserver Mali Deny Account完整匹配
[Tags] selfserver mali deny account完整匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$jwctest@mail.tsgmail.com
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -560,7 +560,7 @@ SecurityPolicy-Deny-Mail-00016
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00017
[Tags] Selfserver Mali Deny Account字串匹配
[Tags] selfserver mali deny account字串匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwcte
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -594,7 +594,7 @@ SecurityPolicy-Deny-Mail-00017
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00018
[Tags] Selfserver Mali Deny Account左匹配
[Tags] selfserver mali deny account左匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwctest*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -626,3 +626,122 @@ SecurityPolicy-Deny-Mail-00018
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00019
[Tags] selfserver mali deny 最大组合
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*vbnm
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_Subject_Id}
Comment 创建Content
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=content
${rescode} ${object_Content_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Content_Id}
Comment 创建ATT_CONT
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=стопо
${rescode} ${object_ATT_CONT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_ATT_CONT_Id}
Comment 创建From
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=il.com
${rescode} ${object_From_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_From_Id}
Comment 创建To
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=zmmtes
${rescode} ${object_To_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_To_Id}
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwctest*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Account_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00019 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${object_Content_Id}|TSG_FIELD_MAIL_CONTENT,${object_From_Id}|TSG_FIELD_MAIL_FROM,${object_To_Id}|TSG_FIELD_MAIL_TO,${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}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable jwctest@mail.tsgmail.com
${邮箱密码} Set Variable jwctest
${邮件主题} Set Variable zxcvbnm
${发送者} Set Variable jwctest@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/姬巍川测试文件.txt"]
${接收者} Set Variable ["zmmtest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
SecurityPolicy-Deny-Mail-00020
[Tags] selfserver mali deny 多ip+修改
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.10|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=jwctest*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Account_Id}
Comment 创建Subject
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=*cvbnm
${rescode} ${object_Subject_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Subject_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00020 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_Account_Id}|TSG_FIELD_MAIL_ACCOUNT,${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appObjectIdArray=5
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable jwctest@mail.tsgmail.com
${邮箱密码} Set Variable jwctest
${邮件主题} Set Variable zxcvbnm
${发送者} Set Variable jwctest@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["zmmtest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-Mail-00020 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol":"MAIL","method":"drop"} referenceObject=${object_Subject_Id}|TSG_FIELD_MAIL_SUBJECT,${objectId}|TSG_SECURITY_SOURCE_ADDR isValid=${1} appObjectIdArray=5 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${Smtp服务器} Set Variable 192.168.100.5
${Smtp服务器端口} Set Variable 25
${邮箱账号} Set Variable jwctest@mail.tsgmail.com
${邮箱密码} Set Variable jwctest
${邮件主题} Set Variable zxcvbnm
${发送者} Set Variable jwctest@mail.tsgmail.com
${附件} Set Variable ["${mailpath}/朱明明测试文件.txt"]
${接收者} Set Variable ["zmmtest@mail.tsgmail.com"]
${抄送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${密送者} Set Variable ["zmmtest@mail.tsgmail.com"]
${邮件正文} Set Variable 朱明明content
${发送邮件返回结果} EmailSendFull ${Smtp服务器} ${Smtp服务器端口} ${邮箱账号} ${邮箱密码} ${邮件主题} ${发送者} ${接收者} ${抄送者} ${密送者} ${邮件正文} ${附件}
Log ${发送邮件返回结果}
should contain ${发送邮件返回结果} mail_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} mail_account jwctest@mail.tsgmail.com

View File

@@ -14,13 +14,17 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Deny-SSL-00001
[Tags] Selfserver Ip Deny Ssl
[Tags] selfserver deny ssl ip+fqdn
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -39,17 +43,17 @@ SecurityPolicy-Deny-SSL-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00002
[Tags] Selfserver Ssl Deny Sni Ip+Fqdn右匹配
[Tags] selfserver ssl deny sni ip+fqdn右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -57,7 +61,7 @@ SecurityPolicy-Deny-SSL-00002
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Operation timed out after
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -68,17 +72,17 @@ SecurityPolicy-Deny-SSL-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00003
[Tags] Selfserver Deny Sni Ssl Ip+Cat完整匹配
[Tags] selfserver deny ssl sni ip+Cat完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -86,7 +90,7 @@ SecurityPolicy-Deny-SSL-00003
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset
... ELSE Create List Operation timed out after
... ELSE Create List Connection reset by peer
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
@@ -97,17 +101,17 @@ SecurityPolicy-Deny-SSL-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00004
[Tags] Selfserver Ssl Deny Ip+Fqdn右匹配 Cn
[Tags] selfserver ssl deny ip+fqdn右匹配 cn
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -126,17 +130,17 @@ SecurityPolicy-Deny-SSL-00004
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00005
[Tags] Selfserver Deny Cn Ssl Ip+Cat完整匹配
[Tags] deny selfserver cn ssl ip+cat完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -155,17 +159,17 @@ SecurityPolicy-Deny-SSL-00005
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00006
[Tags] Selfserver Ssl Deny Ip+Fqdn右匹配 San
[Tags] selfserver ssl deny san ip+fqdn右匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -184,17 +188,17 @@ SecurityPolicy-Deny-SSL-00006
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00007
[Tags] Selfserver Deny San Ssl Ip+Cat完整匹配
[Tags] selfserver deny san ssl ip+cat完整匹配
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Allow-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -211,3 +215,76 @@ SecurityPolicy-Deny-SSL-00007
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00008
[Tags] selfserver deny ssl 最大组合 ip+cat+fqdn
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SAN,${object_fqdn_Id}|TSG_FIELD_SSL_SNI,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00008 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"drop"} referenceObject=${object_cat_Id}|TSG_FIELD_SSL_SAN,${object_cat_Id}|TSG_FIELD_SSL_SNI,${object_cat_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.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
#日志验证
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Deny-SSL-00009
[Tags] selfserver ssl deny san 多ip+fqdn右匹配
Comment 创建第二个源IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.50.18|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-SSL-00009 policyType=tsg_security policyDesc=autotest userTags= action=deny effectiveRange= userRegion={"protocol": "SSL","method":"rst"} referenceObject=${objectId}|TSG_SECURITY_SOURCE_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.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

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Intercept-Http-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Intercept-Http-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -95,3 +95,74 @@ SecurityPolicy-Intercept-Http-00003
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-Http-00004
[Tags] Selfserver Intercept Http 双协议
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00004 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=2,3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List nationalbank
... ELSE Create List nationalbank
${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
SecurityPolicy-Intercept-Http-00005
[Tags] Selfserver Intercept Http 修改
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=*open.node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List nationalbank
... ELSE Create List nationalbank
${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-HTTP-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_cat_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0002.bat
... ELSE set variable curl http://open.node.com/test/youtube/youtube.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List 您可以免费加入成为频道会员
... ELSE Create List 关闭播放器
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -20,7 +20,7 @@ SecurityPolicy-Intercept-SSL-00001
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00001 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -43,13 +43,13 @@ SecurityPolicy-Intercept-SSL-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -72,13 +72,13 @@ SecurityPolicy-Intercept-SSL-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
@@ -95,3 +95,50 @@ SecurityPolicy-Intercept-SSL-00003
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Intercept-SSL-00004
[Tags] Selfserver Intercept Ssl 修改
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_cat_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_cat_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable 字节跳动 Tango Secure Gateway CA
... ELSE set variable 字节跳动 Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${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
Comment 修改策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":1,"decryption":109,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_cat_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3 policyId=${policyId}
${rescode} ${policyId} EditPolicy ${policyDict} update
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable Twitter Tango Secure Gateway CA
... ELSE set variable 新鲜事一网打尽 Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommands ${commandstr} ${stringlist}
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com

View File

@@ -0,0 +1,200 @@
*** Settings ***
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
Library Custometest
*** Variables ***
${policyIds} ${EMPTY}
${objectids} ${EMPTY}
${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 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
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
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' set variable видео mesalab-ca
... ELSE set variable рутуб mesalab-ca
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${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
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 root
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable Twitter tango-ca-root
... ELSE set variable Twitter tango-ca-root
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${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
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 root
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable 字节跳动 Tango National Proxy CA
... ELSE set variable 字节跳动 Tango National Proxy CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${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
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 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
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
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' set variable видео tang-ca-v3-intermediate-01
... ELSE set variable рутуб tang-ca-v3-intermediate-01
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${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
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 intermediate
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0002.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/twitter/twitter.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable tang-ca-v3-intermediate-02 Twitter
... ELSE set variable Twitter tang-ca-v3-intermediate-02
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${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
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 end-entity
${keyringId} Get From Dictionary ${response} keyringId
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=intercept effectiveRange= userRegion={"protocol":"SSL","keyring":${keyringId},"decryption":1,"decrypt_mirror":{"enable":0,"mirror_profile":null}} referenceObject=${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-SSL-0003.bat
... ELSE set variable curl \ -kv \ https://open.node.com/test/bytedance/bytedance.html
@{stringlist} run keyword if '${systemType}'=='Windows' set variable 字节跳动 Tango Secure Gateway CA
... ELSE set variable 字节跳动 Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${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
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 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
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
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' set variable видео Tango Secure Gateway CA
... ELSE set variable рутуб Tango Secure Gateway CA
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${rescode} SystemCommand ${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

View File

@@ -45,7 +45,7 @@ SecurityPolicy-Monitor-DNS-00002
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"DNS"} isValid=${1} appObjectIdArray=4
${policyDict} Create Dictionary policyName=SecurityPolicy-Deny-DNS-00001 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"DNS"} isValid=${1} appObjectIdArray=4 referenceObject=${object_fqdn_Id}|TSG_FIELD_DNS_QNAME
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}

View File

@@ -14,7 +14,7 @@ ${objectids} ${EMPTY}
*** Test Cases ***
SecurityPolicy-Monitor-Ftp-00001
[Tags] Selfserver Ftp Monitor Account字串匹配
[Tags] selfserver monitor account字串匹配 ftp
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -27,7 +27,7 @@ SecurityPolicy-Monitor-Ftp-00001
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -36,7 +36,7 @@ SecurityPolicy-Monitor-Ftp-00001
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Monitor-Ftp-00002
[Tags] Selfserver Ftp Monitor Account右匹配
[Tags] selfserver ftp monitor account右匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=*user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -49,7 +49,7 @@ SecurityPolicy-Monitor-Ftp-00002
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -58,7 +58,7 @@ SecurityPolicy-Monitor-Ftp-00002
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Monitor-Ftp-00003
[Tags] Selfserver Ftp Account完整匹配 Monitor
[Tags] selfserver ftp account完整匹配 monitor
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=$ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -71,7 +71,7 @@ SecurityPolicy-Monitor-Ftp-00003
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
@@ -80,7 +80,7 @@ SecurityPolicy-Monitor-Ftp-00003
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Monitor-Ftp-00004
[Tags] Selfserver Ftp Monitor Account左匹配
[Tags] selfserver ftp monitor account左匹配
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_u*
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
@@ -93,32 +93,10 @@ SecurityPolicy-Monitor-Ftp-00004
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" english
${FTP} FTP_login ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 中文test
should contain ${FTP} ftp_success
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user
SecurityPolicy-Monitor-Ftp-00005
[Tags] Selfserver Ftp Account字串 Monitor
Comment 创建Account
${objectDict} Create Dictionary objectType=account isValid=${1} addItemList=ftp_user
${rescode} ${object_Account_Id} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${object_Account_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-FTP-00005 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"FTP"} referenceObject=${object_Account_Id}|TSG_FIELD_FTP_ACCOUNT isValid=${1} appObjectIdArray=6
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
${FTP} FTP_down ftp://192.168.100.5/test.txt -u"ftp_user:qazXSW@edc" 7 zmmtext123.txt
should contain ${FTP} ftp_fail
Sleep ${policyLogVerificationSleepSeconds}s
${endtime} Get Time
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} ftp_account ftp_user

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Monitor-Http-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00002 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Monitor-Http-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00003 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_HTTP_HOST isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -101,11 +101,11 @@ SecurityPolicy-Monitor-Http-00004
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open.node.com
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_url_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00004 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -130,11 +130,11 @@ SecurityPolicy-Monitor-Http-00005
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=*youtube.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_url_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00005 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -159,11 +159,11 @@ SecurityPolicy-Monitor-Http-00006
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=$open.node.com/test/nationalbank/nationalbank.html
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_url_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00006 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -188,11 +188,11 @@ SecurityPolicy-Monitor-Http-00007
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建url
${objectDict} Create Dictionary objectType=url isValid=${1} addItemList=open*
${rescode} ${object_url_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_url_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_url_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00007 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_url_Id}|TSG_FIELD_HTTP_URL isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -217,11 +217,11 @@ SecurityPolicy-Monitor-Http-00008
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Chrome|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_UA_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00008 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -246,11 +246,11 @@ SecurityPolicy-Monitor-Http-00009
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*Safari/537.36|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_UA_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00009 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -275,11 +275,11 @@ SecurityPolicy-Monitor-Http-00010
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/31.0.1650.63 Safari/537.36|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_UA_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00010 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -304,11 +304,11 @@ SecurityPolicy-Monitor-Http-00011
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=Mozilla/5.0*|User-Agent
${rescode} ${object_UA_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_UA_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_UA_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00011 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_UA_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -333,11 +333,11 @@ SecurityPolicy-Monitor-Http-00012
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=_ym_isad=2|Cookie
${rescode} ${object_CK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00012 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CK_Id}|TSG_FIELD_HTTP_REQ_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -362,11 +362,11 @@ SecurityPolicy-Monitor-Http-00013
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=utf-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CT_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00013 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -391,11 +391,11 @@ SecurityPolicy-Monitor-Http-00014
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*utf-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CT_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00014 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -420,11 +420,11 @@ SecurityPolicy-Monitor-Http-00015
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$text/html; charset=UTF-8|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CT_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00015 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -449,11 +449,11 @@ SecurityPolicy-Monitor-Http-00016
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答头
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=text*|Content-Type
${rescode} ${object_CT_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_CT_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_CT_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00016 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_CT_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -462,7 +462,7 @@ SecurityPolicy-Monitor-Http-00016
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List ақстан Республ
${stringlist} run keyword if '${systemType}'=='Windows' Create List switch=kazakh
... ELSE Create List ақстан Республ
${starttime} Get Time
Sleep ${policyVerificationSleepSeconds}s
@@ -478,11 +478,11 @@ SecurityPolicy-Monitor-Http-00017
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=4567|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_SK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00017 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -507,11 +507,11 @@ SecurityPolicy-Monitor-Http-00018
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=*5678|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_SK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00018 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -536,11 +536,11 @@ SecurityPolicy-Monitor-Http-00019
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=$12345678|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_SK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00019 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -565,11 +565,11 @@ SecurityPolicy-Monitor-Http-00020
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建set-cookie
${objectDict} Create Dictionary objectType=http_signature isValid=${1} addItemList=1234*|Set-Cookie
${rescode} ${object_SK_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_SK_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_SK_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00020 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_SK_Id}|TSG_FIELD_HTTP_RES_HDR isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -594,11 +594,11 @@ SecurityPolicy-Monitor-Http-00021
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_RQ_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00021 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -623,11 +623,11 @@ SecurityPolicy-Monitor-Http-00022
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_RQ_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00022 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -646,3 +646,118 @@ SecurityPolicy-Monitor-Http-00022
#日志验证
${s} Convert to String ${policyId}
GetLogList security_event_log ${starttime} ${endtime} ${testClentIP} ${s} http_host open.node.com
SecurityPolicy-Monitor-Http-00023
[Tags] selfserver ip+请求体and关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=ctes&t123
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00023 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Response Body
... ELSE Create List Response Body
${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
SecurityPolicy-Monitor-Http-00024
[Tags] selfserver ip+请求体或关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建请求体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=test,qazx
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00024 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_REQ_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/ProxyPolicy-Redircet-HTTP-0024.bat
... ELSE set variable curl -H "Content-Type:application/x-www-form-urlencoded" -X POST -d "reqBody=jwctest123&setCookie=12345678&contentType=content-type&resBody=Response Body" -kv http://open.node.com/action
${stringlist} run keyword if '${systemType}'=='Windows' Create List Response Body
... ELSE Create List Response Body
${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
SecurityPolicy-Monitor-Http-00025
[Tags] selfserver ip+应答体and关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық&жайлы
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00025 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List nationalbank
... ELSE Create List nationalbank
${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
SecurityPolicy-Monitor-Http-00026
[Tags] selfserver ip+应答体或关系
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} set Variable ${objectId}
Comment 创建应答体
${objectDict} Create Dictionary objectType=keywords isValid=${1} addItemList=Ұлттық,1234
${rescode} ${object_RQ_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_RQ_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-HTTP-00026 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "HTTP"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_RQ_Id}|TSG_FIELD_HTTP_RES_CONTENT isValid=${1} appObjectIdArray=2
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
#删除策略
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
Comment 功能端验证HTTP验证
${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/selfserver/SecurityPolicy-Intercept-HTTP-0003.bat
... ELSE set variable curl \ http://open.node.com/test/nationalbank/nationalbank.html
${stringlist} run keyword if '${systemType}'=='Windows' Create List nationalbank
... ELSE Create List nationalbank
${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

View File

@@ -43,11 +43,11 @@ SecurityPolicy-Monitor-SSL-00002
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00002 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -72,11 +72,11 @@ SecurityPolicy-Monitor-SSL-00003
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00003 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SNI isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -101,11 +101,11 @@ SecurityPolicy-Monitor-SSL-00004
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00004 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -130,11 +130,11 @@ SecurityPolicy-Monitor-SSL-00005
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00005 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_CN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -159,11 +159,11 @@ SecurityPolicy-Monitor-SSL-00006
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建fqdn
${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=*node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00006 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol":"SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}
@@ -188,11 +188,11 @@ SecurityPolicy-Monitor-SSL-00007
Comment 创建目标IP
${objectDict} Create Dictionary objectType=ip isValid=${1} addItemList=CIDR|192.168.100.5|32|0/0
${rescode} ${objectId} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId}
${objectids} set Variable ${objectId}
Comment 创建cat
${objectDict} Create Dictionary objectType=fqdn_category isValid=${1} addItemList=$open.node.com
${rescode} ${object_fqdn_Id} AddObject2 ${1} ${objectDict}
${objectids} Catenate SEPARATOR=, ${objectId} ${object_fqdn_Id}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_fqdn_Id}
Comment 创建安全策略
${policyDict} Create Dictionary policyName=SecurityPolicy-Monitor-SSL-00007 policyType=tsg_security policyDesc=autotest userTags= action=monitor effectiveRange= userRegion={"protocol": "SSL"} referenceObject=${objectId}|TSG_SECURITY_DESTINATION_ADDR,${object_fqdn_Id}|TSG_FIELD_SSL_SAN isValid=${1} appObjectIdArray=3
${rescode} ${policyId} AddPolicy2 ${1} ${policyDict}

View File

View 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

View 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

View File

@@ -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

View File

@@ -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"] }
${starttime} ${endtime} GetLast24HoursStartAndEndTime
${conditions} Set Variable { "field":"common_recv_time", "type":"timestamp", "value":["${starttime}"] }
${logname} Set Variable active_defence_event_log
${logCondition} GetLogCondition ${logname} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
${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"] }
${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} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
${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"] }
${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} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
${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"] }
${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} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
${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"] }
${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} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
${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"] }
${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} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
${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"] }
${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} 2020-04-26 12:27:03 2020-04-27 13:27:03 30 1
${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

View File

@@ -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

View File

@@ -1,17 +1,18 @@
*** 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-4-11 13:36:35.000
${startTime} set variable 2020-05-10 15:56:05
#结束时间格式Y-M-D h:i:s
${endTime} set variable 2020-4-30 13:36:35.000
${endTime} set variable 2020-05-25 15:56:35
#limit int型
${limit} set variable 50
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} limit=${limit}
@@ -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

View File

@@ -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-04-26 23:00:00
${statisticTime} set variable 2020-05-10 15:56:05
GetApi ${apiName} ${url} statisticTime=${statisticTime}

View File

@@ -0,0 +1,20 @@
*** 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 /${version}/report/domain/resource/analyze
#结束时间格式Y-M-D h:i:s
${Time} get current date
${endTime}= add time to date ${Time} -00:05:00
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime} -30 days
${startTime} Get Substring ${startTime} \ -4
${policyId} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policyId}

View File

@@ -1,17 +1,18 @@
*** 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-01 16:43:48
${startTime} set variable 2020-04-26 16:40:01
#结束时间格式Y-M-D h:i:s
${endTime} set variable 2020-04-26 16:40:01
${endTime} set variable 2020-05-26 10:57:47
#策略ID
${policy_id} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_id=${policy_id}
@@ -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

View File

@@ -0,0 +1,99 @@
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library DateTime
*** Test Cases ***
LogStatistics-hijack_scrip_num-00001
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable 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
${endTime} set variable 2020-05-26 10:57:47
#策略ID列表多个逗号分隔
${policy_ids} set variable 0
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00002
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable 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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -01:00:00
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00003
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#结束时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -1 days
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00004
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -7 days
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00005
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -30 days
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}
LogStatistics-hijack_scrip_num-00006
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable hijack_srcip_num
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -365 days
${startTime} Get Substring ${startTime} \ -4
#策略ID列表多个逗号分隔
${policy_ids} set variable 0,1
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} policy_ids=${policy_ids}

View File

@@ -0,0 +1,112 @@
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library DateTime
*** Test Cases ***
LogStatistics-injectionstatistics-00001
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable 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
${endTime} set variable 2020-05-26 10:57:47
#返回结果记录数
${limit} set variable 50
#设备id多个id逗号分隔 \ 支持设备列表查询 后台查询条件如device_id in ($device_ids)
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity} limit=${limit} device_ids=${device_ids}
LogStatistics-injectionstatistics-00002
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -01:00:00
${startTime} Get Substring ${startTime} \ -4
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
LogStatistics-injectionstatistics-00003
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -1 days
${startTime} Get Substring ${startTime} \ -4
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
LogStatistics-injectionstatistics-00004
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -7 days
${startTime} Get Substring ${startTime} \ -4
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
LogStatistics-injectionstatistics-00005
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -30 days
${startTime} Get Substring ${startTime} \ -4
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}
LogStatistics-injectionstatistics-00006
#120未更新
#apiName请求大数据时用于区分每个接口的sql
${apiName} set variable injectionstatistics
#请求地址 例如:/${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
${endTime} Get Substring ${endTime} \ -4
#开始时间格式Y-M-D h:i:s
${startTime}= add time to date ${endTime}= -365 days
${startTime} Get Substring ${startTime} \ -4
${device_ids} set variable CBT2201925000001
#统计时间粒度单位秒最小统计粒度为30秒
${timeGranularity} set variable 30
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} timeGranularity=${timeGranularity}

View File

@@ -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

View File

@@ -0,0 +1,20 @@
*** 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
#请求地址 例如:/${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
${endTime} set variable 2020-05-26 18:38:20
#排序依据: \ sessions、bytes、packets
${orderBy} set variable sessions
#limit int型
${limit} set variable 50
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} orderBy=${orderBy} limit=${limit}

View File

@@ -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

View File

@@ -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}

View File

@@ -0,0 +1,15 @@
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Library DateTime
*** Variables ***
${url} /${version}/report/url/recommend
*** Test Cases ***
LogStatistics-Recommend-00001
${Time} get current date
${endTime} add time to date ${Time} -01:00:00
${endTime} Get Substring ${endTime} \ -9
LOG ${endTime}00:00
Recommend ${url} ${endTime}00:00

View File

@@ -0,0 +1,31 @@
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url} /${version}/report/policyevent/hit/timeandcount
*** Test Cases ***
LogStatistics-Timeandcount-00001
[Tags] security_event_hits_log类型正常输出 单policyId
Timeandcount ${url} security_event_hits_log 20515
LogStatistics_Timeandcount-00002
[Tags] security_event_hits_log类型正常输出 多ip
Timeandcount ${url} security_event_hits_log 14385,32601
LogStatistics_Timeandcount-00003
[Tags] proxy_event_hits_log类型正常输出 单ip
Timeandcount ${url} proxy_event_hits_log 34736
LogStatistics-Timeandcount-00004
[Tags] proxy_event_hits_log类型正常输出 多ip
Timeandcount ${url} proxy_event_hits_log 34752,34748
LogStatistics-Timeandcount-00005
[Tags] policyid与日志类型不符合 单ip
Timeandcount ${url} proxy_event_hits_log 20515
LogStatistics-Timeandcount-00006
[Tags] policyid与日志类型不符合 多ip
Timeandcount ${url} proxy_event_hits_log 14385,32601

View File

@@ -0,0 +1,27 @@
*** Settings ***
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url} /${version}/report/policyevent/hit/trend
*** Test Cases ***
LogStatistics-Trend-00001
[Tags] security_event_hits_log类型正常输出
Trend ${url} 2020-05-27 00:00:00 2020-05-27 15:00:00 security_event_hits_log 32601
LogStatistics-Trend-00002
[Tags] proxy_event_hits_log类型正常输出
Trend ${url} 2020-05-27 00:00:00 2020-05-27 17:00:00 proxy_event_hits_log 34358
LogStatistics-Trend-00003
[Tags] 日志类型和policyId不一致
Trend ${url} 2020-05-27 00:00:00 2020-05-27 15:00:00 proxy_event_hits_log 32601
LogStatistics-Trend-00004
[Tags] policyId不在此时间段产生流量
Trend ${url} 2020-05-27 00:00:00 2020-05-27 15:00:00 proxy_event_hits_log 34358
LogStatistics-Trend-00005
[Tags] policyId不在此时间段产生流量
Trend ${url} 2020-05-27 00:00:00 2020-05-27 15:00:00 security_event_hits_log 14385

View 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新建ChartLien图形表
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新建ChartArea图形表
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新建ChartPie图形表
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新建ChartBra图形表
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]

View 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新建ChartLien图形表
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新建ChartArea图形表
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新建ChartPie图形表
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新建ChartBra图形表
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"}]}]}}

View File

@@ -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]

View 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"}]}}

View 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新建ChartLien图形表
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新建ChartArea图形表
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新建ChartPie图形表
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新建ChartBra图形表
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]

View 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新建ChartLien图形表
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新建ChartArea图形表
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新建ChartPie图形表
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新建ChartBra图形表
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":[]}}

View 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新建ChartLien图形表
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新建ChartArea图形表
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新建ChartPie图形表
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新建ChartBra图形表
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}

View File

@@ -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}

View File

@@ -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,缺省OFF1表示ON,0表示OFF
Comment cert_transparency Integer 是 ON/OFF,缺省OFF1表示ON,0表示OFF
Comment mutual_authentication Integer 是 ON/OFF,缺省ON1表示ON,0表示OFF
Comment cert_pinning Integer 是 Blocl/Bypass,缺省Block1表示Block,0表示Bypass
Comment protocol_errors Integer 是 ON/OFF,缺省ON1表示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,缺省ON1表示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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View 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

View 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}

View File

@@ -0,0 +1,264 @@
*** 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
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/decryption
${profileId} ${EMPTY}
*** Test Cases ***
Decryption_Profile-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest
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}
Decryption_Profile-00002
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest cn=1
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}
Decryption_Profile-00003
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest issuer=1
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}
Decryption_Profile-00004
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest self-signed=1
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}
Decryption_Profile-00005
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest expiration=1
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}
Decryption_Profile-00006
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest fail_action=pass-through
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}
Decryption_Profile-00007
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest ev_cert=1
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}
Decryption_Profile-00008
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest cert_transparency=1
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}
Decryption_Profile-00009
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest mutual_authentication=1
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}
Decryption_Profile-00010
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest cert_pinning=1
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}
Decryption_Profile-00011
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest protocol_errors=1
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}
Decryption_Profile-00012
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest trusted_root_cert_is_not_installed_on_client=1
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}
Decryption_Profile-00013
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest allow_http2=0
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}
Decryption_Profile-00014
#Hijack 需要修改的内容
${protocol_version} Create Dictionary min=ssl3 max=tls13 mirror_client=1 allow_http2=1
${objectedit} Create Dictionary profileName=zmminserttest protocol_version=${protocol_version}
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}
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}

View File

@@ -0,0 +1,184 @@
*** 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/dnsrecords
${profileId} ${EMPTY}
*** Test Cases ***
Dnsrecords_A_-00001
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=192.168.0.1
${Dict2} Create Dictionary value=192.168.0.2
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=A 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": 1, \ \ \ \ \ \ \ \ \ \ \ \ "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}
Dnsrecords_MX_-00002
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com priority=10
${Dict2} Create Dictionary value=edf.com priority=12
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=MX 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}
Dnsrecords_CNAME_-00003
#Hijack 需要修改的内容
${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}
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}
Dnsrecords_AAAA_-00004
#Hijack 需要修改的内容
${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内容
${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}
Dnsrecords_TXT_-00005
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com
${Dict2} Create Dictionary value=edf.com
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=TXT 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}
Dnsrecords_NS_-00006
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com
${Dict2} Create Dictionary value=edf.com
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 recordType=NS 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}
Dnsrecords_PTR_-00007
#Hijack 需要修改的内容
${Dict1} Create Dictionary value=abc.com
${Dict2} Create Dictionary value=edf.com
${list} Create List ${Dict1} ${Dict2}
${objectedit} Create Dictionary recordName=12 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}
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}

View File

@@ -0,0 +1,517 @@
*** 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}
*** 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
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_hijack} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} hijack_files/ Create-Hijack Files-test-0.apk ${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":"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
#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/ Create-Hijack Files-test-1.exe ${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":"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 需要修改的内容
${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/ Create-Hijack Files-test-2.gif ${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":"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 需要修改的内容
${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/ Create-Hijack Files-test-3.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,"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 需要修改的内容
${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/ Create-Hijack Files-test-4.jpeg ${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.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 需要修改的内容
${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/ Create-Hijack Files-test-5.png ${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.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 需要修改的内容
${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/ Create-Hijack Files-test-5.png ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-6.svg ${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.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 需要修改的内容
${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}
# 查询
${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.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 需要修改的内容
${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/ Create-Hijack Files-test-8.dmg ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-9.js ${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.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 需要修改的内容
${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/ Create-Hijack Files-test-10.rar ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-11.zip ${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":"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 需要修改的内容
${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/ Create-Hijack Files-test-12.doc ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-13.docx ${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.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 需要修改的内容
${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/ Create-Hijack Files-test-14.json ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-15.xml ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-16.pdf ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-17.xls ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-17.xls ${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/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 需要修改的内容
${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/ Create-Hijack Files-test-18.xlsx ${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":"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 需要修改的内容
${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/ Create-Hijack Files-test-19.ppt ${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":"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 需要修改的内容
${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/ Create-Hijack Files-test-19.ppt ${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/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
#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/ Create-Hijack Files-test-20.pptx ${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":"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}
Hijack_file_24_type_odt-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/ Create-Hijack Files-test-21.odt ${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":"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 需要修改的内容
${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/ Create-Hijack Files-test-22.css ${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":"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 需要修改的内容
${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/ Create-Hijack Files-test-23.csv ${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":"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 需要修改的内容
${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/ Create-Hijack Files-test-24.plain ${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/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 需要修改的内容
${objectedit} Create Dictionary profileName=zmmhjacktest 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}
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}

View File

@@ -0,0 +1,98 @@
*** 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/insertscripts
${profileId} ${EMPTY}
*** Test Cases ***
Insert_Scripts_js_before-00001
#Hijack 需要修改的内容
${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 ${url} insert_files/ Create-Insert Scripts-test-1.js ${objectDict}
# 查询
${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","insertOn":"","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} insert_files/ Create-Insert Scripts-test.css ${reqHeader_edit}
Insert_Scripts_js_after-00002
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest format=js insertOn=after_page_load
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_insert} ${objectedit}
log ${objectDict}
${response} CreatePolicyFile4 ${url} insert_files/ Create-Insert Scripts-test-1.js ${objectDict}
# 查询
${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","insertOn":"","opAction":"update","profileName":"test_edit","profileId":"${profileId}","returnData":1}
UpdatePolicyFile ${url} insert_files/ Create-Insert Scripts-test.css ${reqHeader_edit}
Insert_Scripts_css_before-00003
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest 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}
# 查询
${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":"before_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-00004
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest 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}
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}

View File

@@ -0,0 +1,41 @@
*** 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} /v1/policy/exch/intermediacert
*** Test Cases ***
IntermediaCertPolicy-00001
# 查询1
QueryPolicyFile ${url} pageNo=1
# 查询2
${suffix_quary} Catenate SEPARATOR=& pageNo=1 pageSize=20
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}
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}

View File

@@ -0,0 +1,51 @@
*** 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} /v1/policy/profile/keyringobj
${keyringId} ${EMPTY}
*** Test Cases ***
Settings-ProxyProfiles-KeyringFile_root-00001
# 新增 root
${response} CreatePolicyMutipartFile ${url} keyrings/root/ mesalab-ca-cert.pem mesalab-ca-key.pem root
# 查询
${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}
Settings-ProxyProfiles-KeyringFile_end-entity-00002
# 新增 end-entity
${response} CreatePolicyMutipartFile ${url} keyrings/end-entity/ tang-ca-v3-www.bing.com-cer.cer tang-ca-v3-www.bing.com-key.pem end-entity
# 查询
${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}
Settings-ProxyProfiles-KeyringFile_Intermediate-00003
# 新增 end-entity
${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}

View File

@@ -0,0 +1,50 @@
*** 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/reflector
${profileId} ${EMPTY}
*** Test Cases ***
reflector-00001
#Hijack 需要修改的内容
${list} Create List 192.168.0.1 192.168.0.2 192.168.0.3
${objectedit} Create Dictionary profileName=12313 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":""}]}
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":""}]}
UpdatePolicyFile2 ${url} ${reqHeader_edit}

View File

@@ -0,0 +1,48 @@
*** 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/reflector/payload
${profileId} ${EMPTY}
*** Test Cases ***
ReflectorPayload-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=12313 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":""}]}
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":""}]}
UpdatePolicyFile2 ${url} ${reqHeader_edit}

View File

@@ -0,0 +1,54 @@
*** 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
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/responsepages
${profileId} ${EMPTY}
*** Test Cases ***
Response_page_html-00001
#Hijack 需要修改的内容
${objectedit} Create Dictionary profileName=zmminserttest 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}
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}

View File

@@ -0,0 +1,117 @@
*** 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
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
Resource ../../../02-Keyword/tsg_bfapi/Common.robot
Resource ../../../02-Keyword/tsg_bfapi/ApiRequest.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url} /v1/policy/profile/trafficmirror
${profileId} ${EMPTY}
*** Test Cases ***
TrafficMirrorPolicy_vlan_Single_object-00001
#Hijack 需要修改的内容
${list} Create List 1
${objectedit} Create Dictionary profileName=zmminserttest addrType=vlan addrArray=${list}
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_traffic_mirror_profiles} ${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,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
TrafficMirrorPolicy_vlan_Multi_object-00002
#Hijack 需要修改的内容
${list} Create List 1 2
${objectedit} Create Dictionary profileName=zmminserttest addrType=vlan addrArray=${list}
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_traffic_mirror_profiles} ${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,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
TrafficMirrorPolicy_mac_Single_object-00003
#Hijack 需要修改的内容
${list} Create List 13:13:13:13:13:13
${objectedit} Create Dictionary profileName=zmminserttest addrType=mac addrArray=${list}
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${setting_proxy_profiles_traffic_mirror_profiles} ${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,"trafficMirrorList":[{"profileId":"${profileId}","profileName":"test_edit","addrType":"vlan","isValid":1,"addrArray":["256"]}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
TrafficMirrorPolicy_mac_Multi_object-00004
#Hijack 需要修改的内容
${list} Create List 13:13:13:13:13:13 13:13:13:13:13:13
${objectedit} Create Dictionary profileName=zmminserttest 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}
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}

View File

@@ -0,0 +1,56 @@
*** 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
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/trustedcacertobj
${certId} ${EMPTY}
*** Test Cases ***
TrustedCertPolicy_root-00001
# 新增
${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/end-entity/ tang-ca-v3-www.amazon.cn-cer.pem ${header_edit}
TrustedCertPolicy_end-entity-00002
# 新增
${response} CreatePolicyFile ${url} keyrings/end-entity/ tang-ca-v3-www.amazon.cn-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/root/ tango-ca-trust-ca-cer.pem ${header_edit}
TrustedCertPolicy_Intermediate-00003
# 新增
${response} CreatePolicyFile ${url} keyrings/Intermediate/ tang-ca-v3-intermediate-01-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/root/ tango-ca-trust-ca-cer.pem ${header_edit}

View 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}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View 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}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

View 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

View 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 малый

View 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

View 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 малый

View 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 малый

View File

@@ -1,8 +1,9 @@
*** Settings ***
Force Tags tsg-ui objects HTTPSignature
Resource ../../../03-Variable/bifangapivariable.txt
Resource ../../../02-Keyword/Tsg_Ui/Objects/ObjectPages.robot
Resource ../../../02-Keyword/Tsg_Ui/Objects/Objects.robot
Resource ../../../02-Keyword/tsg_ui/objects/ObjectPages.robot
Library OperatingSystem
Resource ../../../02-Keyword/tsg_ui/objects/Objects.robot
*** Test Cases ***
create-HTTPSignature-Request-User-Agent-prefix-001
@@ -10,8 +11,8 @@ create-HTTPSignature-Request-User-Agent-prefix-001
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-prefix-001 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.0*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-prefix-001
#删除对象
objects-delete
@@ -20,8 +21,8 @@ create-HTTPSignature-Request-User-Agent-sub-002
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-sub-002 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-sub-002
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-sub-002
#删除对象
objects-delete
@@ -30,8 +31,8 @@ create-HTTPSignature-Request-User-Agent-exactly-003
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-exactly-003 reqrestype=req reqresheader=ua keywordtext=$Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-exactly-003
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-exactly-003
#删除对象
objects-delete
@@ -40,8 +41,8 @@ create-HTTPSignature-Request-User-Agent-suffix-004
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-suffix-004 reqrestype=req reqresheader=ua keywordtext=*Safari/537.36
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-suffix-004
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-suffix-004
#删除对象
objects-delete
@@ -50,8 +51,8 @@ create-HTTPSignature-Request-Cookie-prefix-005
CreatePage ReqRes create-HTTPSignature-Request-Cookie-prefix-005 reqrestype=req reqresheader=ck keywordtext=cookie*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-prefix-005
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-Cookie-prefix-005
#删除对象
objects-delete
@@ -60,8 +61,8 @@ create-HTTPSignature-Request-Cookie-sub-006
CreatePage ReqRes create-HTTPSignature-Request-Cookie-sub-006 reqrestype=req reqresheader=ck keywordtext=cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-sub-006
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-Cookie-sub-006
#删除对象
objects-delete
@@ -70,8 +71,8 @@ create-HTTPSignature-Request-Cookie-exactly-007
CreatePage ReqRes create-HTTPSignature-Request-Cookie-exactly-007 reqrestype=req reqresheader=ck keywordtext=$cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-exactly-007
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-Cookie-exactly-007
#删除对象
objects-delete
@@ -80,8 +81,8 @@ create-HTTPSignature-Request-Cookie-suffix-008
CreatePage ReqRes create-HTTPSignature-Request-Cookie-suffix-008 reqrestype=req reqresheader=ck keywordtext=*cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-Cookie-suffix-008
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-Cookie-suffix-008
#删除对象
objects-delete
@@ -90,8 +91,8 @@ create-HTTPSignature-Response-Set-Cookie-prefix-009
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-prefix-009 reqrestype=res reqresheader=sck keywordtext=set-cookie*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-prefix-009
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Set-Cookie-prefix-009
#删除对象
objects-delete
@@ -100,8 +101,8 @@ create-HTTPSignature-Response-Set-Cookie-sub-010
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-sub-010 reqrestype=res reqresheader=sck keywordtext=set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-sub-010
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Set-Cookie-sub-010
#删除对象
objects-delete
@@ -110,8 +111,8 @@ create-HTTPSignature-Response-Set-Cookie-exactly-011
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-exactly-011 reqrestype=res reqresheader=sck keywordtext=$set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-exactly-011
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Set-Cookie-exactly-011
#删除对象
objects-delete
@@ -120,8 +121,8 @@ create-HTTPSignature-Response-Set-Cookie-suffix-012
CreatePage ReqRes create-HTTPSignature-Response-Set-Cookie-suffix-012 reqrestype=res reqresheader=sck keywordtext=*set-cookie
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Set-Cookie-suffix-012
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Set-Cookie-suffix-012
#删除对象
objects-delete
@@ -130,8 +131,8 @@ create-HTTPSignature-Response-Content-Type-prefix-0013
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-prefix-0013 reqrestype=res reqresheader=ct keywordtext=Content-Type*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-prefix-0013
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Content-Type-prefix-0013
#删除对象
objects-delete
@@ -140,8 +141,8 @@ create-HTTPSignature-Response-Content-Type-sub-0014
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-sub-0014 reqrestype=res reqresheader=ct keywordtext=Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-sub-0014
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Content-Type-sub-0014
#删除对象
objects-delete
@@ -150,8 +151,8 @@ create-HTTPSignature-Response-Content-Type-exactly-0015
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-exactly-0015 reqrestype=res reqresheader=ct keywordtext=$Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-exactly-0015
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Content-Type-exactly-0015
#删除对象
objects-delete
@@ -160,8 +161,8 @@ create-HTTPSignature-Response-Content-Type-suffix-0016
CreatePage ReqRes create-HTTPSignature-Response-Content-Type-suffix-0016 reqrestype=res reqresheader=ct keywordtext=*Content-Type
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Response-Content-Type-suffix-0016
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Response-Content-Type-suffix-0016
#删除对象
objects-delete
@@ -170,8 +171,8 @@ edit-HTTPSignature-017
CreatePage ReqRes create-HTTPSignature-Request-User-Agent-prefix-001 reqrestype=req reqresheader=ua keywordtext=Mozilla/5.0*
#验证新建是否成功
ui-object-search-name create-HTTPSignature-Request-User-Agent-prefix-001
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-Request-User-Agent-prefix-001
#修改对象
object-edit-HTTPSignature edit-HTTPSignature-017 res sck 8f6c 6362 31 36 8fdb 5236 hex=open
#查询修改对象
@@ -184,7 +185,7 @@ create-HTTPSignature-open-16-hex-0018
CreatePage ReqRes create-HTTPSignature-open-16-hex-0018 reqrestype=res reqresheader=ct keywordtext=*63 6f 6e 74 65 6e 74 hex=open
#验证新建是否成功
ui-object-search-name create-HTTPSignature-open-16-hex-0018
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span/span[2]/span
log ${text}
${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${text} create-HTTPSignature-open-16-hex-0018
#删除对象
objects-delete

Some files were not shown because too many files have changed in this diff Show More