dts--framework(一)
dts 大体框架
framework
定义类
定义方法
tests
framework调用所需要的函数 ./dpdk/usertools/cpu_layout.py
/sys/devices/system/cpu
环境内核:0 1 2 3 4 5 6 7
ffff:1111 1111 1111 1111
ff3e:1111 1111 0011 1110
dts.py
01.dts_parse_param(config, section):
02.dts_parse_config(config, section):
03.dts_parse_commands(commands):
04.dts_run_commands(crb, dts_commands):
05.get_project_obj(project_name, super_class, crbInst, serializer, dut_id):
06.dts_log_testsuite(duts, tester, suite_obj, log_handler, test_classname):
07.dts_log_execution(duts, tester, log_handler):
08.dts_crbs_init(crbInsts, skip_setup, read_cache, project, base_dir, serializer, virttype):
09.dts_crbs_exit(duts, tester):
10.dts_run_prerequisties(duts, tester, pkgName, patch, dts_commands, serializer):
11.dts_run_target(duts, tester, targets, test_suites):
12.dts_run_suite(duts, tester, test_suites, target):
13.run_all(config_file, pkgName, git, patch, skip_setup, '''Main process of DTS, it will run all test suites in the config file.'''
read_cache, project, suite_dir, test_cases,
base_dir, output_dir, verbose, virttype, debug,
debugcase, re_run, commands):
14.show_speedup_options_messages(read_cache, skip_setup):
15.save_all_results():
16.quit_execution(duts, tester):
Main.py
"""
A test framework for testing DPDK.
"""
01.def git_build_package(gitLabel, pkgName, depot="dep"):
dts.run_all(args.config_file, args.snapshot, args.git, #args = parser.parse_args()
args.patch, args.skip_setup, args.read_cache,
args.project, args.suite_dir, args.test_cases,
args.dir, args.output, args.verbose,args.virttype,
args.debug, args.debugcase, args.re_run, args.commands)
Crb.py
class Crb(object):
01.send_expect(self, cmds, expected, timeout=TIMEOUT,alt_session=False, verify=False):
02.create_session(self, name=""):
03.destroy_session(self, session=None):
04.reconnect_session(self, alt_session=False):
05.send_command(self, cmds, timeout=TIMEOUT, alt_session=False):
06.get_session_output(self, timeout=TIMEOUT):
07.set_test_types(self, func_tests, perf_tests):
08.get_total_huge_pages(self):
09.mount_huge_pages(self):
10.strip_hugepage_path(self):
11.set_huge_pages(self, huge_pages, numa=-1):
12.set_speedup_options(self, read_cache, skip_setup):
13.set_directory(self, base_dir):
14.admin_ports(self, port, status):
15.admin_ports_freebsd(self, port, status):
16.admin_ports_linux(self, eth, status):
17.pci_devices_information(self):
18.pci_devices_information_uncached(self):
19.pci_devices_information_uncached_linux(self):
20.pci_devices_information_uncached_freebsd(self):
21.get_pci_dev_driver(self, domain_id, bus_id, devfun_id):
22.get_pci_dev_driver_linux(self, domain_id, bus_id, devfun_id):
23.get_pci_dev_driver_freebsd(self, domain_id, bus_id, devfun_id):
24.get_pci_dev_id(self, domain_id, bus_id, devfun_id):
25.get_pci_dev_id_linux(self, domain_id, bus_id, devfun_id):
26.get_device_numa(self, domain_id, bus_id, devfun_id):
27.get_device_numa_linux(self, domain_id, bus_id, devfun_id):
28.get_ipv6_addr(self, intf):
29.get_ipv6_addr_linux(self, intf):
30.get_ipv6_addr_freebsd(self, intf):
31.disable_ipv6(self, intf):
32.enable_ipv6(self, intf):
33.create_file(self, contents, fileName):
34.kill_all(self, alt_session=True):
35.close(self):
36.get_os_type(self):
37.check_os_type(self):
38.init_core_list(self):
39.init_core_list_uncached(self):
40.init_core_list_uncached_freebsd(self):
41.init_core_list_uncached_linux(self):
42.get_all_cores(self):
43.remove_hyper_core(self, core_list, key=None):
44.init_reserved_core(self):
45.remove_reserved_cores(self, core_list, args):
46.get_reserved_core(self, config, socket):
47.get_core_list(self, config, socket=-1):
48.get_lcore_id(self, config):
49.get_port_info(self, pci):
50.get_port_pci(self, port_id):
51.enable_promisc(self, intf):
Dut.py
"""
A connection to the CRB under test.
This class sends commands to the CRB and validates the responses. It is
implemented using either ssh for linuxapp or the terminal server for
baremetal.
All operations are in fact delegated to an instance of either CRBLinuxApp
or CRBBareMetal.
"""
00.__init__(self, crb, serializer, dut_id)
01.init_host_session(self, vm_name)
02.new_session(self, suite="")
03.close_session(self, session)
04.set_nic_type(self, nic_type)
05.set_toolchain(self, target)
06.mount_procfs(self)
07.ount_procfs_linux(self)
08.mount_procfs_freebsd(self)
09.get_ip_address(self)
10.get_password(self)
11.get_username(self)
12.dut_prerequisites(self)
13.restore_interfaces(self)
14.restore_interfaces_freebsd(self)
15.stop_ports(self)
16.restore_interfaces_linux(self)
17.setup_memory(self, hugepages=-1)
18.setup_memory_linux(self, hugepages=-1)
19.setup_memory_freebsd(self, hugepages=-1)
20.taskset(self, core)
21.is_ssh_session_port(self, pci_bus)
22.get_dpdk_bind_script(self)
23.bind_interfaces_linux(self, driver='igb_uio', nics_to_bind=None)
24.unbind_interfaces_linux(self, nics_to_bind=None)
25.get_ports(self, nic_type='any', perf=None, socket=None)
26.get_ports_performance(self, nic_type='any', perf=None, socket=None,
force_same_socket=True,
force_different_nic=True)
27.get_peer_pci(self, port_num)
28.get_mac_address(self, port_num)
29.get_ipv6_address(self, port_num)
30.get_numa_id(self, port_num)
31.lcore_table_print(self, horizontal=False)
32.get_memory_channels(self)
33.check_ports_available(self, pci_bus, pci_id)
34.rescan_ports(self)
35.rescan_ports_uncached(self)
36.rescan_ports_uncached_linux(self)
37.rescan_ports_uncached_freebsd(self)
38.load_serializer_ports(self)
39.save_serializer_ports(self)
40.scan_ports(self)
41.scan_ports_cached(self)
42.scan_ports_cached_linux(self)
43.scan_ports_uncached(self)
44.scan_ports_uncached_linux(self)
45.scan_ports_uncached_freebsd(self)
46.setup_virtenv(self, virttype)
47.generate_sriov_vfs_by_port(self, port_id, vf_num, driver='default')
48.destroy_sriov_vfs_by_port(self, port_id)
49.destroy_all_sriov_vfs(self)
50.destroy_all_sriov_vfs(self)
51.get_vm_core_list(self)
52.load_portconf(self)
53.map_available_ports(self)
54.map_available_ports_uncached(self)
55.disable_tester_ipv6(self)
56.enable_tester_ipv6
57.check_port_occupied
58.get_maximal_vnc_num(self)
59.close(self)
60.virt_exit(self)
61.crb_exit(self)
test_cases.py
"""
A base class for creating DTF test cases.
"""
test_cases.py
01.def __init__(self, duts, tester, target, suitename)
02.def init_log(self)
03._check_and_reconnect(self, crb=None)
04.set_up_all(self)
05.set_up(self)
06.tear_down(self)
07.tear_down_all(self)
08.verify(self, passed, description)
09._get_nic_driver(self, nic_name)
10.set_check_inst(self, check=None)
11.rst_report(self, *args, **kwargs)
12.result_table_create(self, header)
13.result_table_add(self, row)
14.result_table_print(self)
15.result_table_getrows(self)
16._get_functional_cases(self)
17._get_performance_cases(self)
18._has_it_been_requested(self, test_case, test_name_regex)
19.set_requested_cases(self, case_list)
20._get_test_cases(self, test_name_regex)
21.execute_setup_all(self)
22._execute_test_case(self, case_obj)
23.execute_test_cases(self)
24.execute_test_case(self, case_obj)
25.get_result(self)
26.get_case_cfg(self)
27.get_suite_cfg(self)
28.execute_tear_downall(self)
29.enable_history(self, history)
30.dump_history(self)
31.wirespeed(self, nic, frame_size, num_ports)
CheckCase.py
"""
Class for check test case running criteria. All information will be loaded
from conf/test_case_*list.json. Current two files are maintained. One is
for check whether test case should skip, another one is for check whether
current environment support test case execution.
"""
CheckCase.py
filter_json_file = './conf/test_case_checklist.json'
support_json_file = './conf/test_case_supportlist.json'
00.__init__(self)
01.check_dut(self, dut)
02._check_os(self, os_type)
03._check_nic(self, nic_type)
04._check_target(self, target)
05._check_host_driver(self, drivers)
06.case_skip(self, case_name)
07.case_support(self, case_name) settings.py
"""
FOLDERS
'Framework': 'framework',
'Testscripts': 'tests',
'Configuration': 'conf',
'Depends': 'dep',
'Output': 'output',
'NicDriver': 'nics', Nics and its identifiers supported by the framework.
'kawela': '8086:10e8',
'kawela_2': '8086:10c9',
'kawela_4': '8086:1526',
'bartonhills': '8086:150e',
'powerville': '8086:1521',
'powerville_vf': '8086:1520', DRIVERS
'kawela': 'igb',
'kawela_2': 'igb',
'kawela_4': 'igb',
'bartonhills': 'igb',
'powerville': 'igb',
'powerville_vf': 'igbvf', List used to translate scapy packets into Ixia TCL commands.
SCAPY2IXIA
'Ether',
'Dot1Q',
'IP', Helpful header sizes.
HEADER_SIZE
'eth': 18,
'ip': 20,
'ipv6': 40, dpdk send protocol packet size.
PROTOCOL_PACKET_SIZE = {
'lldp': [110, 100],
}
Default session timeout.
TIMEOUT = 15 Global macro for dts.
IXIA = "ixia" The log name seperater.
LOG_NAME_SEP = '.' Section name for suite level configuration
SUITE_SECTION_NAME = "suite" DTS global environment variable
DTS_ENV_PAT = r"DTS_*"
PERF_SETTING = "DTS_PERF_ONLY" DTS global error table
DTS_ERR_TBL = {
"GENERIC_ERR": 1,
"DPDK_BUILD_ERR" : 2,
"DUT_SETUP_ERR" : 3, 00.get_nic_name(type)
01.get_nic_driver(pci_id)
02.get_netdev(crb, pci)
03.get_host_ip(address)
04.save_global_setting(key, value)
05.load_global_setting(key)
06.report_error(error)
07.exit_error()
08.accepted_nic(pci_id)
utils.py
"""
Create thread lock dictionary based on DUTs number
"""
utils.py
01.create_parallel_locks(num_duts)
02.parallel_lock(num=1)
03.RED(text)
04.BLUE(text)
05.GREEN(text)
06.pprint(some_dict, serialzer=None)
07.regexp(s, to_match, allString=False)
08.get_obj_funcs(obj, func_name_regex)
09.remove_old_rsa_key(crb, ip)
10.human_read_number(num)
11.get_subclasses(module, clazz)
12.copy_instance_attr(from_inst, to_inst)
13.create_mask(indexes)
14.convert_int2ip(value, ip_type)
15.convert_ip2int(ip_str, ip_type)
16.get_backtrace_object(file_name, obj_name)
dts--framework(一)的更多相关文章
- windows类书的学习心得
原文网址:http://www.blogjava.net/sound/archive/2008/08/21/40499.html 现在的计算机图书发展的可真快,很久没去书店,昨日去了一下,真是感叹万千 ...
- Linux PWM framework简介和API描述【转】
本文转载自:https://blog.csdn.net/mike8825/article/details/51656400 1. 前言 PWM是Pulse Width Modulation(脉冲宽度调 ...
- Linux Regulator Framework(2)_regulator driver
转自蜗窝科技:http://www.wowotech.net/pm_subsystem/regulator_driver.html 说实话,这篇好难懂啊... 1. 前言 本文从regulator d ...
- Linux regulator framework(1) - 概述【转】
转自蜗窝科技:http://www.wowotech.net/pm_subsystem/regulator_framework_overview.html 1. 前言 Regulator,中文名翻译为 ...
- Linux Thermal Framework分析及实施
关键词:Zone.Cooling.Governor.Step Wise.Fair Share.trip等等. Linux Thermal的目的是控制系统运行过程中采样点温度,避免温度过高造成器件损坏, ...
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第二章:利用模型类创建视图、控制器和数据库
在这一章中,我们将直接进入项目,并且为产品和分类添加一些基本的模型类.我们将在Entity Framework的代码优先模式下,利用这些模型类创建一个数据库.我们还将学习如何在代码中创建数据库上下文类 ...
- Entity Framework Core 1.1 升级通告
原文地址:https://blogs.msdn.microsoft.com/dotnet/2016/11/16/announcing-entity-framework-core-1-1/ 翻译:杨晓东 ...
- Entity Framework Core 实现MySQL 的TimeStamp/RowVersion 并发控制
将通用的序列号生成器库 从SQL Server迁移到Mysql 遇到的一个问题,就是TimeStamp/RowVersion并发控制类型在非Microsoft SQL Server数据库中的实现.SQ ...
- 在传统.NET Framework 上运行ASP.NET Core项目
新的项目我们想用ASP.NET Core来开发,但是苦于我们历史的遗产很多,比如<使用 JavaScriptService 在.NET Core 里实现DES加密算法>,我们要估计等到.N ...
- 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)
前言 Entity Framework 延伸系列目录 今天来说说EF与MVC项目的性能检测和监控 首先,先介绍一下今天我们使用的工具吧. MiniProfiler~ 这个东西的介绍如下: MVC Mi ...
随机推荐
- java学习第十四天
1:正则表达式(理解) (1)就是符合一定规则的字符串 (2)常见规则 A:字符 x 字符 x.举例:'a'表示字符a \\ 反斜线字符. \n 新行(换行)符 ('\u000A') \r 回车符 ( ...
- 《C#高效编程》读书笔记13-正确的初始化静态成员变量
在创建某个类型实例之前,就应该初始化该实例的所有静态成员变量.而C#为此提供了静态初始化器和静态构造函数. 静态构造函数是特殊的构造函数,将在其他所有方法执行之前以及变量或属性被第一次访问之前执行. ...
- 错误Cannot find module 'stylus'
vue项目中使用stylus预处理器写css语法,老是出现 Cannot find module ‘stylus’ 的错误,鼓捣了很久,包括webstorm中配置stylus的支持,安装依赖. 终于找 ...
- Git学习笔记day01 从GitHub克隆版本库
本期Git教程将会带您进入Git的世界,这是您使用分布版本控制工具Git的开端,祝您学习顺利! 步骤一 在Linux系统中下载Git 如果是Ubuntu系统,在shell中输入指令 sudo apt ...
- mysql一些常用的查询语句总结
工作中会遇到一些比较有用的mysql查询语句,有了它,可以对mysql进行更全面的维护和管理,下面就写一下我记录的 1.按照字段ru_id查询dsc_order_goods表中ru_id出现次数由多到 ...
- 笨办法学Python(七)
习题 7: 更多打印 现在我们将做一批练习,在练习的过程中你需要键入代码,并且让它们运行起来.我不会解释太多,因为这节的内容都是以前熟悉过的.这节练习的目的是巩固你学到的东西.我们几个练习后再见.不要 ...
- 51nod 1366 贫富差距
题目来源: TopCoder 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 一个国家有N个公民,标记为0,1,2,...,N-1,每个公民有一个存款额.已知每个公 ...
- MySQL入门很简单: 3 操作数据库
登陆:mysq -u root -p 0409 1). 创建, 删除数据库 SHOW DATABASES; 显示已经存在的数据率 CREATE DATABASES 数据库名: 创建数据库 DROP D ...
- Fiddler-1 官网下载及安装
1 进入Fiddler官网:http://www.telerik.com/fiddler 点击[Free download]:填写一些信息后就可以下载. 2 双击安装包--下一步dinghanhua下 ...
- MySQL 相关文章参考
MySQL 中隔离级别 RC 与 RR 的区别http://www.cnblogs.com/digdeep/p/4968453.html MySQL+InnoDB semi-consitent rea ...