dts 大体框架

  1. framework
  2. 定义类
  3. 定义方法
  4. tests
  5. framework调用所需要的函数
  6.  
  7. ./dpdk/usertools/cpu_layout.py
  8. /sys/devices/system/cpu
  9. 环境内核:0 1 2 3 4 5 6 7
  10. ffff:1111 1111 1111 1111
  11. ff3e:1111 1111 0011 1110

dts.py

  1. 01.dts_parse_param(config, section):
  2. 02.dts_parse_config(config, section):
  3. 03.dts_parse_commands(commands):
  4. 04.dts_run_commands(crb, dts_commands):
  5. 05.get_project_obj(project_name, super_class, crbInst, serializer, dut_id):
  6. 06.dts_log_testsuite(duts, tester, suite_obj, log_handler, test_classname):
  7. 07.dts_log_execution(duts, tester, log_handler):
  8. 08.dts_crbs_init(crbInsts, skip_setup, read_cache, project, base_dir, serializer, virttype):
  9. 09.dts_crbs_exit(duts, tester):
  10. 10.dts_run_prerequisties(duts, tester, pkgName, patch, dts_commands, serializer):
  11. 11.dts_run_target(duts, tester, targets, test_suites):
  12. 12.dts_run_suite(duts, tester, test_suites, target):
  13. 13.run_all(config_file, pkgName, git, patch, skip_setup, '''Main process of DTS, it will run all test suites in the config file.'''
  14. read_cache, project, suite_dir, test_cases,
  15. base_dir, output_dir, verbose, virttype, debug,
  16. debugcase, re_run, commands):
  17. 14.show_speedup_options_messages(read_cache, skip_setup):
  18. 15.save_all_results():
  19. 16.quit_execution(duts, tester):

Main.py

  1. """
  2. A test framework for testing DPDK.
  3. """
  4. 01.def git_build_package(gitLabel, pkgName, depot="dep"):
  5. dts.run_all(args.config_file, args.snapshot, args.git, #args = parser.parse_args()
  6. args.patch, args.skip_setup, args.read_cache,
  7. args.project, args.suite_dir, args.test_cases,
  8. args.dir, args.output, args.verbose,args.virttype,
  9. args.debug, args.debugcase, args.re_run, args.commands)

Crb.py

  1. class Crb(object):
  2. 01.send_expect(self, cmds, expected, timeout=TIMEOUT,alt_session=False, verify=False):
  3. 02.create_session(self, name=""):
  4. 03.destroy_session(self, session=None):
  5. 04.reconnect_session(self, alt_session=False):
  6. 05.send_command(self, cmds, timeout=TIMEOUT, alt_session=False):
  7. 06.get_session_output(self, timeout=TIMEOUT):
  8. 07.set_test_types(self, func_tests, perf_tests):
  9. 08.get_total_huge_pages(self):
  10. 09.mount_huge_pages(self):
  11. 10.strip_hugepage_path(self):
  12. 11.set_huge_pages(self, huge_pages, numa=-1):
  13. 12.set_speedup_options(self, read_cache, skip_setup):
  14. 13.set_directory(self, base_dir):
  15. 14.admin_ports(self, port, status):
  16. 15.admin_ports_freebsd(self, port, status):
  17. 16.admin_ports_linux(self, eth, status):
  18. 17.pci_devices_information(self):
  19. 18.pci_devices_information_uncached(self):
  20. 19.pci_devices_information_uncached_linux(self):
  21. 20.pci_devices_information_uncached_freebsd(self):
  22. 21.get_pci_dev_driver(self, domain_id, bus_id, devfun_id):
  23. 22.get_pci_dev_driver_linux(self, domain_id, bus_id, devfun_id):
  24. 23.get_pci_dev_driver_freebsd(self, domain_id, bus_id, devfun_id):
  25. 24.get_pci_dev_id(self, domain_id, bus_id, devfun_id):
  26. 25.get_pci_dev_id_linux(self, domain_id, bus_id, devfun_id):
  27. 26.get_device_numa(self, domain_id, bus_id, devfun_id):
  28. 27.get_device_numa_linux(self, domain_id, bus_id, devfun_id):
  29. 28.get_ipv6_addr(self, intf):
  30. 29.get_ipv6_addr_linux(self, intf):
  31. 30.get_ipv6_addr_freebsd(self, intf):
  32. 31.disable_ipv6(self, intf):
  33. 32.enable_ipv6(self, intf):
  34. 33.create_file(self, contents, fileName):
  35. 34.kill_all(self, alt_session=True):
  36. 35.close(self):
  37. 36.get_os_type(self):
  38. 37.check_os_type(self):
  39. 38.init_core_list(self):
  40. 39.init_core_list_uncached(self):
  41. 40.init_core_list_uncached_freebsd(self):
  42. 41.init_core_list_uncached_linux(self):
  43. 42.get_all_cores(self):
  44. 43.remove_hyper_core(self, core_list, key=None):
  45. 44.init_reserved_core(self):
  46. 45.remove_reserved_cores(self, core_list, args):
  47. 46.get_reserved_core(self, config, socket):
  48. 47.get_core_list(self, config, socket=-1):
  49. 48.get_lcore_id(self, config):
  50. 49.get_port_info(self, pci):
  51. 50.get_port_pci(self, port_id):
  52. 51.enable_promisc(self, intf):

Dut.py

  1. """
  2. A connection to the CRB under test.
  3. This class sends commands to the CRB and validates the responses. It is
  4. implemented using either ssh for linuxapp or the terminal server for
  5. baremetal.
  6. All operations are in fact delegated to an instance of either CRBLinuxApp
  7. or CRBBareMetal.
  8. """
  9. 00.__init__(self, crb, serializer, dut_id)
  10. 01.init_host_session(self, vm_name)
  11. 02.new_session(self, suite="")
  12. 03.close_session(self, session)
  13. 04.set_nic_type(self, nic_type)
  14. 05.set_toolchain(self, target)
  15. 06.mount_procfs(self)
  16. 07.ount_procfs_linux(self)
  17. 08.mount_procfs_freebsd(self)
  18. 09.get_ip_address(self)
  19. 10.get_password(self)
  20. 11.get_username(self)
  21. 12.dut_prerequisites(self)
  22. 13.restore_interfaces(self)
  23. 14.restore_interfaces_freebsd(self)
  24. 15.stop_ports(self)
  25. 16.restore_interfaces_linux(self)
  26. 17.setup_memory(self, hugepages=-1)
  27. 18.setup_memory_linux(self, hugepages=-1)
  28. 19.setup_memory_freebsd(self, hugepages=-1)
  29. 20.taskset(self, core)
  30. 21.is_ssh_session_port(self, pci_bus)
  31. 22.get_dpdk_bind_script(self)
  32. 23.bind_interfaces_linux(self, driver='igb_uio', nics_to_bind=None)
  33. 24.unbind_interfaces_linux(self, nics_to_bind=None)
  34. 25.get_ports(self, nic_type='any', perf=None, socket=None)
  35. 26.get_ports_performance(self, nic_type='any', perf=None, socket=None,
  36. force_same_socket=True,
  37. force_different_nic=True)
  38. 27.get_peer_pci(self, port_num)
  39. 28.get_mac_address(self, port_num)
  40. 29.get_ipv6_address(self, port_num)
  41. 30.get_numa_id(self, port_num)
  42. 31.lcore_table_print(self, horizontal=False)
  43. 32.get_memory_channels(self)
  44. 33.check_ports_available(self, pci_bus, pci_id)
  45. 34.rescan_ports(self)
  46. 35.rescan_ports_uncached(self)
  47. 36.rescan_ports_uncached_linux(self)
  48. 37.rescan_ports_uncached_freebsd(self)
  49. 38.load_serializer_ports(self)
  50. 39.save_serializer_ports(self)
  51. 40.scan_ports(self)
  52. 41.scan_ports_cached(self)
  53. 42.scan_ports_cached_linux(self)
  54. 43.scan_ports_uncached(self)
  55. 44.scan_ports_uncached_linux(self)
  56. 45.scan_ports_uncached_freebsd(self)
  57. 46.setup_virtenv(self, virttype)
  58. 47.generate_sriov_vfs_by_port(self, port_id, vf_num, driver='default')
  59. 48.destroy_sriov_vfs_by_port(self, port_id)
  60. 49.destroy_all_sriov_vfs(self)
  61. 50.destroy_all_sriov_vfs(self)
  62. 51.get_vm_core_list(self)
  63. 52.load_portconf(self)
  64. 53.map_available_ports(self)
  65. 54.map_available_ports_uncached(self)
  66. 55.disable_tester_ipv6(self)
  67. 56.enable_tester_ipv6
  68. 57.check_port_occupied
  69. 58.get_maximal_vnc_num(self)
  70. 59.close(self)
  71. 60.virt_exit(self)
  72. 61.crb_exit(self)

test_cases.py

  1. """
  2. A base class for creating DTF test cases.
  3. """
  4. test_cases.py
  5. 01.def __init__(self, duts, tester, target, suitename)
  6. 02.def init_log(self)
  7. 03._check_and_reconnect(self, crb=None)
  8. 04.set_up_all(self)
  9. 05.set_up(self)
  10. 06.tear_down(self)
  11. 07.tear_down_all(self)
  12. 08.verify(self, passed, description)
  13. 09._get_nic_driver(self, nic_name)
  14. 10.set_check_inst(self, check=None)
  15. 11.rst_report(self, *args, **kwargs)
  16. 12.result_table_create(self, header)
  17. 13.result_table_add(self, row)
  18. 14.result_table_print(self)
  19. 15.result_table_getrows(self)
  20. 16._get_functional_cases(self)
  21. 17._get_performance_cases(self)
  22. 18._has_it_been_requested(self, test_case, test_name_regex)
  23. 19.set_requested_cases(self, case_list)
  24. 20._get_test_cases(self, test_name_regex)
  25. 21.execute_setup_all(self)
  26. 22._execute_test_case(self, case_obj)
  27. 23.execute_test_cases(self)
  28. 24.execute_test_case(self, case_obj)
  29. 25.get_result(self)
  30. 26.get_case_cfg(self)
  31. 27.get_suite_cfg(self)
  32. 28.execute_tear_downall(self)
  33. 29.enable_history(self, history)
  34. 30.dump_history(self)
  35. 31.wirespeed(self, nic, frame_size, num_ports)

CheckCase.py

  1. """
  2. Class for check test case running criteria. All information will be loaded
  3. from conf/test_case_*list.json. Current two files are maintained. One is
  4. for check whether test case should skip, another one is for check whether
  5. current environment support test case execution.
  6. """
  7. CheckCase.py
  8. filter_json_file = './conf/test_case_checklist.json'
  9. support_json_file = './conf/test_case_supportlist.json'
  10. 00.__init__(self)
  11. 01.check_dut(self, dut)
  12. 02._check_os(self, os_type)
  13. 03._check_nic(self, nic_type)
  14. 04._check_target(self, target)
  15. 05._check_host_driver(self, drivers)
  16. 06.case_skip(self, case_name)
  17. 07.case_support(self, case_name)
  18.  
  19. settings.py
  20. """
  21. FOLDERS
  22. 'Framework': 'framework',
  23. 'Testscripts': 'tests',
  24. 'Configuration': 'conf',
  25. 'Depends': 'dep',
  26. 'Output': 'output',
  27. 'NicDriver': 'nics',
  28.  
  29. Nics and its identifiers supported by the framework.
  30. 'kawela': '8086:10e8',
  31. 'kawela_2': '8086:10c9',
  32. 'kawela_4': '8086:1526',
  33. 'bartonhills': '8086:150e',
  34. 'powerville': '8086:1521',
  35. 'powerville_vf': '8086:1520',
  36.  
  37. DRIVERS
  38. 'kawela': 'igb',
  39. 'kawela_2': 'igb',
  40. 'kawela_4': 'igb',
  41. 'bartonhills': 'igb',
  42. 'powerville': 'igb',
  43. 'powerville_vf': 'igbvf',
  44.  
  45. List used to translate scapy packets into Ixia TCL commands.
  46. SCAPY2IXIA
  47. 'Ether',
  48. 'Dot1Q',
  49. 'IP',
  50.  
  51. Helpful header sizes.
  52. HEADER_SIZE
  53. 'eth': 18,
  54. 'ip': 20,
  55. 'ipv6': 40,
  56.  
  57. dpdk send protocol packet size.
  58. PROTOCOL_PACKET_SIZE = {
  59. 'lldp': [110, 100],
  60. }
  61. Default session timeout.
  62. TIMEOUT = 15
  63.  
  64. Global macro for dts.
  65. IXIA = "ixia"
  66.  
  67. The log name seperater.
  68. LOG_NAME_SEP = '.'
  69.  
  70. Section name for suite level configuration
  71. SUITE_SECTION_NAME = "suite"
  72.  
  73. DTS global environment variable
  74. DTS_ENV_PAT = r"DTS_*"
  75. PERF_SETTING = "DTS_PERF_ONLY"
  76.  
  77. DTS global error table
  78. DTS_ERR_TBL = {
  79. "GENERIC_ERR": 1,
  80. "DPDK_BUILD_ERR" : 2,
  81. "DUT_SETUP_ERR" : 3,
  82.  
  83. 00.get_nic_name(type)
  84. 01.get_nic_driver(pci_id)
  85. 02.get_netdev(crb, pci)
  86. 03.get_host_ip(address)
  87. 04.save_global_setting(key, value)
  88. 05.load_global_setting(key)
  89. 06.report_error(error)
  90. 07.exit_error()
  91. 08.accepted_nic(pci_id)

utils.py

  1. """
  2. Create thread lock dictionary based on DUTs number
  3. """
  4. utils.py
  5. 01.create_parallel_locks(num_duts)
  6. 02.parallel_lock(num=1)
  7. 03.RED(text)
  8. 04.BLUE(text)
  9. 05.GREEN(text)
  10. 06.pprint(some_dict, serialzer=None)
  11. 07.regexp(s, to_match, allString=False)
  12. 08.get_obj_funcs(obj, func_name_regex)
  13. 09.remove_old_rsa_key(crb, ip)
  14. 10.human_read_number(num)
  15. 11.get_subclasses(module, clazz)
  16. 12.copy_instance_attr(from_inst, to_inst)
  17. 13.create_mask(indexes)
  18. 14.convert_int2ip(value, ip_type)
  19. 15.convert_ip2int(ip_str, ip_type)
  20. 16.get_backtrace_object(file_name, obj_name)

dts--framework(一)的更多相关文章

  1. windows类书的学习心得

    原文网址:http://www.blogjava.net/sound/archive/2008/08/21/40499.html 现在的计算机图书发展的可真快,很久没去书店,昨日去了一下,真是感叹万千 ...

  2. Linux PWM framework简介和API描述【转】

    本文转载自:https://blog.csdn.net/mike8825/article/details/51656400 1. 前言 PWM是Pulse Width Modulation(脉冲宽度调 ...

  3. Linux Regulator Framework(2)_regulator driver

    转自蜗窝科技:http://www.wowotech.net/pm_subsystem/regulator_driver.html 说实话,这篇好难懂啊... 1. 前言 本文从regulator d ...

  4. Linux regulator framework(1) - 概述【转】

    转自蜗窝科技:http://www.wowotech.net/pm_subsystem/regulator_framework_overview.html 1. 前言 Regulator,中文名翻译为 ...

  5. Linux Thermal Framework分析及实施

    关键词:Zone.Cooling.Governor.Step Wise.Fair Share.trip等等. Linux Thermal的目的是控制系统运行过程中采样点温度,避免温度过高造成器件损坏, ...

  6. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第二章:利用模型类创建视图、控制器和数据库

    在这一章中,我们将直接进入项目,并且为产品和分类添加一些基本的模型类.我们将在Entity Framework的代码优先模式下,利用这些模型类创建一个数据库.我们还将学习如何在代码中创建数据库上下文类 ...

  7. Entity Framework Core 1.1 升级通告

    原文地址:https://blogs.msdn.microsoft.com/dotnet/2016/11/16/announcing-entity-framework-core-1-1/ 翻译:杨晓东 ...

  8. Entity Framework Core 实现MySQL 的TimeStamp/RowVersion 并发控制

    将通用的序列号生成器库 从SQL Server迁移到Mysql 遇到的一个问题,就是TimeStamp/RowVersion并发控制类型在非Microsoft SQL Server数据库中的实现.SQ ...

  9. 在传统.NET Framework 上运行ASP.NET Core项目

    新的项目我们想用ASP.NET Core来开发,但是苦于我们历史的遗产很多,比如<使用 JavaScriptService 在.NET Core 里实现DES加密算法>,我们要估计等到.N ...

  10. 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)

    前言 Entity Framework 延伸系列目录 今天来说说EF与MVC项目的性能检测和监控 首先,先介绍一下今天我们使用的工具吧. MiniProfiler~ 这个东西的介绍如下: MVC Mi ...

随机推荐

  1. vue学习笔记 vue安装

    一.安装步骤:(用cmd命令用管理身份安装比较顺利) 1.安装node,安装后可以输入npm -v 查看版本,升级npm可用 cnpm install npm -g 2.安装vue 输入cnpm in ...

  2. Xtrareport绘制行号

    需要是用事件beforePrint (在打印数据之前的事件) private void xrTableCell12_BeforePrint(object sender, System.Drawing. ...

  3. Devexpress GridControl使用

    //不显示内置的导航条.            gc1.UseEmbeddedNavigator = false;             //不显示分组的面板            gv1.Opti ...

  4. vim基本操作思维导图

  5. js中各种距离clientWidth

    1: offsetLeft.offsetTop.offsetHeight.offsetWidth 1.1 偏移参照——定位父级offsetParent   offsetParent的定义是:与当前元素 ...

  6. 移动webApp - 1像素实现(点5像素的秘密)

    在移动web项目中,经常会实现以下1像素的边框 移动web设计中,在retina显示屏下网页会由1px会被渲染为2px,那么视觉稿中1px的线条还原成网页需要css定义为0.5px 但是正当我们去用0 ...

  7. canvas制作倒计时效果

  8. foxmail6.5 不能收取电子邮件,反复提示输入密码?

    使用foxmail时候报错:-err system resource error,system close connect,code=<1014>,id=<1>重新输入密码吗? ...

  9. uLua学习之HelloWorld(一)

    前言 好久都没有写过文章了,现在正好在看有关unity3d的热更新方案,在网上找了很久,发现了ulua这个插件,感觉还是不错的,反正自己是个初学者,多了解一些知识应该是没有什么问题的.说起ulua,就 ...

  10. dell omsa管理工具

    dell服务器raid管理工具 lsiutil dell sas6i/r MegaCli dell prec omsa管理raid分区 显示物理硬盘信息 omreport storage pdisk ...