1
- 开发背景 -
工具链集成
现状及课题
对策和效果
2
- 功能说明 -
开发语言:
功能模块,小工具:Python
分词,识别:Perl
流程控制,脚本粘合,小工具:Bash
核心功能:
test suite:test suite是一组test case或者test suite的集合,也可以两者都有。用来将需要一同执行的测试用例聚合到一起。
test runner:一个test runner是用来执行测试用例的,对测试进行编排并把结果返回给用户。
test fixture:一个test fixture代表执行一个或者多个测试时需要准备环境,以及相关联的清理环境的工作。这包含很多内容,比如创建临时的数据库、目录等。
解释器,执行器:花了90%的精力都在这上面。涉及的内容比较多,详细请参考工具的DSL语法文档。涵盖了分词,识别,动作。如定义变量命名规则,变量作用域,注释方式,大小写是否敏感,在不同虚拟机物理机切换,投入命令的执行,命令返回结果判断,提取部分返回结果,test case模块复用和跳转,复用测试模块的参数传递返回值获取,命令的同步异步并行处理,文件传输,条件判断,循环,断点调试等等。
边缘功能,小工具:
查询:整体完成状况查询,当天或某一段时间内的进度查询,某一段时间内测试频度查询,某一段时间内测试内容查询,单个测试项目的历史查询
结合excel文档:测试结果自动更新测试文档;根据文档自动生成test suite
测试环境自动scale out:根据测试需要,自动scale out,VNFM,NFVO,controller。compute虚拟机
测试环境健康自动检测:一旦检测到测试环境异常,尝试恢复,恢复失败自动生成新的测试环境,如VNFM,NFVO,controller,compute虚拟机,待新环境生成自动继续测试。问题环境和问题日志可以第二天白天查看分析。
3
- 工具功能演示 -
执行方法
DSL和hello world
hello world
查询功能
查询示例:统计整体进展状况
例:
查询某个时间点(例2018-06-23_174311)的整体进展状况:
# ./analyse_achievement_doc 2018-06-23_174311
可自动化项目总数/脚本完成项目数/已测试过项目数/测试OK项目数
312 /114 /88/85
查询截至目前为止的整体进展状况:
# ./analyse_achievement_doc
可自动化项目总数/脚本完成项目数/已测试过项目数/测试OK项目数
312 /125 /93/90
查询示例:某一个时间段的详细测试进展情况
典型应用场景:查询当天或本周的测试进展
例:
query 2018-06-25_083000 ~ 2018-06-26_170000‘s 测试进展情况
# ./diff_achievement_doc 2018-06-25_083000 2018-06-26_170000
///////////////////////////////////////////////////
2018-06-25_083000 ~ 2018-06-26_170000’s 测试进展情况
///////////////////////////////////////////////////
[ 测试项目脚本完成进展: NO -> YES ]
209_002_095
[ 测试进展: UNTEST -> OK ]
209_002_095
[ 测试进展: NG -> OK ]
211_002_003
201_005_023
201_005_024
query 2018-06-23_153000 ~ 2018-06-24_153000‘s 测试进展情况
# ./diff_achievement_doc 2018-06-23_153000 2018-06-24_153000
///////////////////////////////////////////////////
2018-06-23_153000 ~ 2018-06-24_153000‘s 测试进展情况
///////////////////////////////////////////////////
[ 测试项目脚本完成进展: NO -> YES ]
101_008_001
101_003_002
211_002_003
101_002_005
210_001_040
210_001_042
210_001_046
210_001_047
210_001_048
209_002_094
[ 测试进展: UNTEST -> NG ]
101_008_001
101_003_002
211_002_003
101_002_005
[ 测试进展: UNTEST -> OK ]
209_002_094
查询示例:查询某一段时间内的测试频度
典型应用场景:
1)挑出多次测试不通过的用例,调查原因
2)挑出时过时不过的测试用例,调查原因
例:
query 2018-06-22_123615 ~ 2018-06-28_123617 の test frequency
# ./query_test_frequency 2018-06-22_123615 2018-06-28_123617
101_002_003 OK: +0 NG: +2
101_002_005 OK: +0 NG: +1
101_003_002 OK: +0 NG: +1
101_008_001 OK: +0 NG: +1
201_001_000 OK: +59 NG: +6
201_005_007 OK: +0 NG: +2
201_005_008 OK: +0 NG: +1
201_005_010 OK: +0 NG: +2
201_005_011 OK: +0 NG: +3
201_005_012 OK: +0 NG: +1
201_005_014 OK: +0 NG: +1
201_005_015 OK: +0 NG: +1
201_005_018 OK: +0 NG: +1
201_005_019 OK: +0 NG: +1
201_005_020 OK: +0 NG: +1
201_005_022 OK: +0 NG: +1
201_005_023 OK: +1 NG: +4
201_005_024 OK: +1 NG: +0
206_000_000 OK: +48 NG: +3
209_001_006 OK: +0 NG: +1
209_002_094 OK: +10 NG: +0
209_002_095 OK: +4 NG: +0
209_003_010 OK: +0 NG: +1
210_001_027 OK: +0 NG: +1
查询示例:某段时间内实施的测试项目一览
例:
# ./query_test_item 2017-11-10_224621 2017-11-11_030000
test_item test_result duration list_name end_time
204_001_001 NG 13m 11s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_225349
204_001_002 NG 13m 49s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_230742
205_005_240 NG 9m 48s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_231734
205_005_245 OK 5m 53s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_232333
205_006_577 NG 4m 44s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_232825
205_006_623 NG 7m 11s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_233544
205_004_389 OK 6m 53s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_234241
205_004_401 NG 4m 27s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_234716
205_004_412 NG 8m 1s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_235524
205_004_452 NG 3m 49s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-10_235917
205_006_001 OK 5m 19s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_000442
205_006_070 NG 5m 20s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_001008
205_006_139 NG 12m 11s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_002227
205_006_162 NG 1m 50s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_002423
205_006_185 OK 2m 1s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_002630
205_006_208 OK 1m 59s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_002835
205_006_231 OK 3m 4s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_003145
205_006_254 NG 1m 58s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_003351
205_006_277 OK 1m 55s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_003552
205_006_300 NG 6m 7s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_004205
205_006_323 NG 8m 26s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_005038
205_006_346 NG 12m 25s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_010309
205_006_369 OK 12m 30s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_011547
205_010_002 NG 31m 53s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_014749
205_011_001 NG 34m 4s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_022355
201_007_001 NG 5m 43s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_023144
205_005_259 NG 7m 29s /mnt/LOG/NFV/sequence/list_2017-11-10_190001 2017-11-11_023919
查询示例:某一个具体测试项目的测试历史
例:
# ./query_test_item_history 209_002_068
test_result duration log_server's sequence|job|list log folder path:
NG 3秒 /mnt/LOG/NFV/sequence/list_2017-10-29_195817 2017-10-30_034247
NG 5分2秒 /mnt/LOG/NFV/sequence/list_2017-10-30_104048 2017-10-30_120452
NG 5分58秒 /mnt/LOG/NFV/sequence/list_2017-10-30_182635 2017-10-31_071012
NG 34秒 /mnt/LOG/NFV/sequence/list_2017-11-02_195530 2017-11-03_005632
NG 34秒 /mnt/LOG/NFV/sequence/list_2017-11-02_225739 2017-11-03_014757
OK 2分15秒 /mnt/LOG/NFV/sequence/list_2017-11-03_190002 2017-11-03_233201
OK 7分46秒 /mnt/LOG/NFV/sequence/list_2017-11-06_220532 2017-11-07_082735
配置文件说明(部分)
测试文档自动更新
白天测试,夜间测试,增量测试,全量测试
测试环境自动scale out和测试环境自动恢复
实 测
-END-
往期精彩