[go: up one dir, main page]

CN113315675B - White box switch U-Boot automatic testing method, system and storage medium - Google Patents

White box switch U-Boot automatic testing method, system and storage medium Download PDF

Info

Publication number
CN113315675B
CN113315675B CN202110499685.9A CN202110499685A CN113315675B CN 113315675 B CN113315675 B CN 113315675B CN 202110499685 A CN202110499685 A CN 202110499685A CN 113315675 B CN113315675 B CN 113315675B
Authority
CN
China
Prior art keywords
test
boot
switch
task
chip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110499685.9A
Other languages
Chinese (zh)
Other versions
CN113315675A (en
Inventor
周庆飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yingxin Computer Technology Co Ltd
Original Assignee
Shandong Yingxin Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yingxin Computer Technology Co Ltd filed Critical Shandong Yingxin Computer Technology Co Ltd
Priority to CN202110499685.9A priority Critical patent/CN113315675B/en
Publication of CN113315675A publication Critical patent/CN113315675A/en
Application granted granted Critical
Publication of CN113315675B publication Critical patent/CN113315675B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
    • G06F11/2635Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers using a storage for the test inputs, e.g. test ROM, script files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/14Arrangements for monitoring or testing data switching networks using software, i.e. software packages

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Automation & Control Theory (AREA)
  • Computer Hardware Design (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a white box switch U-Boot automatic testing method, a white box switch U-Boot automatic testing system and a storage medium, wherein the method comprises the following steps: s1: creating a U-Boot automatic test task and selecting an automatic script required by the test; s2: configuring a switch and a network tester port required by testing; s3: interconnecting the switch with the switch according to the test task, and interconnecting the switch with the port of the network tester; s4: setting the execution time and times of the test task; s5: the test is performed and the test log and results are recorded. The invention builds a set of automatic test scheme aiming at the U-Boot by adopting a SecureCRT + python mode, replaces manual test with an automatic script, improves the test efficiency and frees a test engineer from the manual test.

Description

一种白盒交换机U-Boot自动化测试方法、系统和存储介质A white box switch U-Boot automated testing method, system and storage medium

技术领域technical field

本发明属于交换机测试技术领域,具体涉及一种白盒交换机U-Boot自动化测试方法、系统和存储介质。The invention belongs to the technical field of switch testing, and in particular relates to a U-Boot automatic testing method, system and storage medium of a white box switch.

背景技术Background technique

U-Boot属于Bootloader的一种,是用来引导启动内核的,可以从flash中读出内核,放到内存中启动内核;白盒交换机中包含有U-Boot,对于交换机的启动和硬件管理具有重要作用,同时U-Boot对交换机还具备系统引导,资产信息查看,硬件设备管理以及时钟同步等功能。U-Boot is a kind of Bootloader, which is used to boot and start the kernel. It can read the kernel from the flash and put it in the memory to start the kernel; the white box switch contains U-Boot, which has great functions for the startup and hardware management of the switch. At the same time, U-Boot also has the functions of system booting, asset information viewing, hardware device management and clock synchronization for switches.

白盒交换机U-Boot需要进行功能测试,主要包括快捷键功能测试、资产信息测试、主备芯片功能测试和重启压力测试;目前,U-Boot测试内容较多,每个版本发布后需要投入较多的人力进行手工测试,测试周期较长且测试结果需要人工进行对比验证,测试效率很低,急需一种高效的自动化测试方法,此为现有技术的不足之处。U-Boot, a white-box switch, needs to be tested for functions, mainly including shortcut key function tests, asset information tests, active and standby chip function tests, and restart stress tests. A lot of manpower is required for manual testing, the test period is long and the test results need to be manually compared and verified, the test efficiency is very low, and an efficient automated test method is urgently needed, which is the deficiency of the existing technology.

有鉴于此,本发明提供一种白盒交换机U-Boot自动化测试方法、系统和存储介质,以解决现有技术中存在的缺陷,是非常有必要的。In view of this, the present invention provides a white box switch U-Boot automatic testing method, system and storage medium, so as to solve the defects existing in the prior art, which is very necessary.

发明内容Contents of the invention

针对白盒交换机U-Boot测试内容多,手工测试周期长、测试效率低的问题,本发明提供设计一种白盒交换机U-Boot自动化测试方法、系统和存储介质,用自动化脚本代替手工测试,实现交换机U-Boot的自动化测试,提高测试效率,让测试工程师从手工测试中解放出来,将更多时间投入到测试设计和测试分析上。Aiming at the problems of many U-Boot test contents of white-box switches, long manual test period and low test efficiency, the present invention provides and designs a U-Boot automatic test method, system and storage medium of white-box switches, and uses automated scripts instead of manual tests. Realize the automatic test of switch U-Boot, improve test efficiency, free test engineers from manual testing, and spend more time on test design and test analysis.

为实现上述目的,本发明给出以下技术方案:To achieve the above object, the present invention provides the following technical solutions:

第一方面,本发明提供一种白盒交换机U-Boot自动化测试方法,包括以下步骤:First aspect, the present invention provides a kind of U-Boot automatic testing method of white box exchange, comprises the following steps:

S1:创建U-Boot自动化测试任务并选择测试所需的自动化脚本;S1: Create a U-Boot automation test task and select the automation script required for the test;

S2:配置测试所需的交换机和网络测试仪端口;S2: Configure the switches and network tester ports required for testing;

S3:按照测试任务将交换机与交换机互连,交换机与网络测试仪端口互连;S3: According to the test task, the switch is interconnected with the switch, and the switch is connected with the port of the network tester;

S4:设置测试任务执行时间和次数;S4: Set the test task execution time and times;

S5:执行测试并记录测试日志和结果。S5: Execute the test and record the test log and results.

作为优选,所述步骤S1中U-Boot自动化测试任务包括快捷键功能测试,快捷键功能测试具体方法如下:As preferably, U-Boot automated test task comprises shortcut key function test in the described step S1, and the concrete method of shortcut key function test is as follows:

调用python脚本,控制SecureCRT在U-Boot系统中下发重启指令;Call the python script to control SecureCRT to issue a restart command in the U-Boot system;

等待重启并判断SecureCRT界面是否出现进入Booting阶段的关键字;Wait for the restart and judge whether the SecureCRT interface appears the keyword entering the Booting stage;

当屏幕出现进入Booting阶段的关键字后,模拟U-Boot中对应测试项的快捷键,不同的快捷键进入不同的界面;When the keyword to enter the Booting stage appears on the screen, simulate the shortcut keys corresponding to the test items in U-Boot, and enter different interfaces with different shortcut keys;

验证模拟的快捷键是否进入预期的对应界面,模拟的快捷键进入对应界面则测试通过,否则测试失败;Verify whether the simulated shortcut key enters the expected corresponding interface. If the simulated shortcut key enters the corresponding interface, the test passes, otherwise the test fails;

通过快捷键功能测试验证U-Boot的快捷键功能与预期是否相符。Verify that the shortcut key functions of U-Boot are as expected through the shortcut key function test.

作为优选,所述步骤S1中U-Boot自动化测试任务包括资产信息测试,资产信息测试具体方法如下:As preferably, the U-Boot automated testing task in the step S1 includes asset information testing, and the specific method of asset information testing is as follows:

第一步将设计文档中资产信息的名称与期望值汇总至测试数据集中;The first step is to summarize the name and expected value of the asset information in the design document into the test data set;

第二步分别在U-Boot中下发CPU、内存、M.2、电源资产信息的指令;The second step is to issue instructions for CPU, memory, M.2, and power asset information in U-Boot;

第三步将指令下发后获得的返回值与测试数据集中的期望值进行对比;The third step is to compare the return value obtained after the instruction is issued with the expected value in the test data set;

第四步对比判定,返回值与测试数据集中的期望值一致则测试通过,否则测试失败;The fourth step is to compare and judge, if the return value is consistent with the expected value in the test data set, the test passes, otherwise the test fails;

通过资产信息测试验证U-Boot中显示的内存、M.2、电源以及CPU等主要部件的信息显示是否完全正确。Verify that the main components such as memory, M.2, power supply, and CPU displayed in U-Boot are completely correct through the asset information test.

作为优选,所述步骤S1中U-Boot自动化测试任务包括主备芯片功能测试,主备芯片功能测试具体方法如下:As preferably, the U-Boot automated test task in the step S1 includes the functional test of the active and standby chips, and the specific methods for the functional test of the active and standby chips are as follows:

第一步调用python脚本,在SecureCRT控制台中确定当前使用的是主Flash芯片;The first step is to call the python script, and determine in the SecureCRT console that the main Flash chip is currently used;

第二步将启动模式改为备用Flash启动,并下发重启指令;The second step is to change the boot mode to standby Flash boot, and issue a restart command;

第三步再次在自动化脚本中获取当前启动的Flash,判断是否已更改为备用Flash启动,如果已经更改为备用Flash启动则进入第四步,否则测试失败;The third step is to obtain the currently started Flash in the automation script again, and judge whether it has been changed to the backup Flash startup. If it has been changed to the backup Flash startup, then enter the fourth step, otherwise the test fails;

第四步在脚本中下发关闭主芯片的指令,并将默认启动的Flash改为主芯片;The fourth step is to issue an instruction to shut down the main chip in the script, and change the Flash that is started by default to the main chip;

第五步下发重启指令,再次进入U-Boot系统后验证当前是否使用备用芯片启动的,如果当前是使用备用芯片启动,则测试通过,反之测试失败;The fifth step is to issue a restart command. After entering the U-Boot system again, verify whether the backup chip is currently used for booting. If the backup chip is currently used for booting, the test passes, otherwise the test fails;

通过主备芯片功能测试验证主备芯片切换、主芯片启动以及备用芯片启动功能。Verify the switching of the active and standby chips, the startup of the main chip, and the startup of the backup chip through the functional test of the active and standby chips.

作为优选,所述步骤S1中U-Boot自动化测试任务还包括重启压力测试,重启压力测试具体方法如下:As preferably, the U-Boot automated test task in the step S1 also includes restarting the stress test, and the specific method of restarting the stress test is as follows:

第一步调用python脚本,在SecureCRT控制台模拟U-Boot快捷键进入系统;The first step is to call the python script to simulate the U-Boot shortcut key on the SecureCRT console to enter the system;

第二步在系统中下发日志检查命令,核对日志中是否存在告警日志或异常日志,如果存在则测试失败,不存在则继续执行第三步;The second step is to issue a log check command in the system to check whether there is an alarm log or abnormal log in the log. If it exists, the test fails, and if it does not exist, continue to the third step;

第三步使用python脚本控制SecureCRT控制台下发系统重启指令;The third step is to use the python script to control the SecureCRT console to issue a system restart command;

第四步等待系统进入Booting阶段后,模拟快捷键进入U-Boot,并检查日志中是否存在告警日志以及异常日志,如果存在则测试失败,不存在则完成一次重启测试;The fourth step is to wait for the system to enter the Booting stage, simulate the shortcut key to enter U-Boot, and check whether there are alarm logs and abnormal logs in the log. If there is, the test fails, and if there is no one, complete a restart test;

第五步将上述第一步至第四步重复执行多次,完成重启压力测试;The fifth step is to repeat the above steps from the first step to the fourth step several times to complete the restart stress test;

通过重启压力测试验证多次不断重启的过程中,U-Boot能否每次都成功加载并且进入系统。Through the restart stress test to verify whether U-Boot can be successfully loaded and enter the system every time during the process of repeated restarts.

第二方面,本发明还提供一种白盒交换机U-Boot自动化测试系统,包括:In the second aspect, the present invention also provides a white box switch U-Boot automated test system, including:

测试任务创建模块:创建U-Boot自动化测试任务并选择测试所需的自动化脚本;Test task creation module: create U-Boot automated test tasks and select the automated scripts required for testing;

交换机配置模块:配置测试所需的交换机和网络测试仪端口;Switch configuration module: configure the switches and network tester ports required for testing;

测试连接模块:按照测试任务将交换机与交换机互连,交换机与网络测试仪端口互连;Test connection module: according to the test task, the switch is interconnected with the switch, and the switch is connected with the port of the network tester;

测试设置模块:设置测试任务执行时间和次数;Test setting module: set the test task execution time and times;

测试执行模块:执行测试并记录测试日志和结果。Test Execution Module: Executes tests and records test logs and results.

作为优选,所述测试任务创建模块包括:Preferably, the test task creation module includes:

快捷键功能测试单元:编写并调用脚本验证U-Boot的快捷键功能与预期是否相符;Shortcut key function test unit: write and call the script to verify whether the shortcut key function of U-Boot is as expected;

资产信息测试单元:编写并调用脚本验证U-Boot中显示的内存、M.2、电源以及CPU等主要部件的信息显示是否完全正确;Asset information test unit: Write and call scripts to verify whether the information display of main components such as memory, M.2, power supply and CPU displayed in U-Boot is completely correct;

主备芯片功能测试单元:编写并调用脚本验证主备芯片切换、主芯片启动以及辅芯片启动功能;Main and standby chip function test unit: write and call scripts to verify the main and standby chip switching, main chip startup and auxiliary chip startup functions;

重启压力测试单元:调用脚本验证多次不断重启的过程中,U-Boot能否每次都成功加载并进入系统。Restart stress test unit: call the script to verify whether U-Boot can be successfully loaded and enter the system every time during the process of repeated restarts.

第三方面,本发明提供一种计算机存储介质,所述计算机存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述方法。In a third aspect, the present invention provides a computer storage medium, wherein instructions are stored in the computer storage medium, and when the computer storage medium is run on a computer, the computer is made to execute the above method.

第四方面,提供一种终端,包括:In a fourth aspect, a terminal is provided, including:

处理器、存储器,其中存储器用于存储计算机程序,处理器用于从存储器中调用并运行该计算机程序,使得终端执行上述方法。A processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the terminal executes the above method.

本发明的有益效果在于,使用python撰写脚本并采用SecureCRT的调用脚本功能实现U-Boot自动化测试,不依赖于连接,不管是系统启动前还是启动后,该自动化测试都可以一直运行;本发明提供的U-Boot自动化测试方法可以取代手工测试,并且可以批量运行,很好地利用了SecureCRT对控制台的监控功能以及python的模拟按键和数据提前、对比等功能,有效节省测试人力。The beneficial effects of the present invention are that, using python to compose scripts and adopting the call script function of SecureCRT to realize U-Boot automated testing, does not depend on the connection, no matter before or after the system starts, the automated testing can always run; the present invention provides The U-Boot automated testing method can replace manual testing, and can be run in batches. It makes good use of SecureCRT's monitoring function on the console and python's simulated keystrokes and data advance and comparison functions, effectively saving testing manpower.

由此可见,本发明与现有技术相比,具有突出的实质性特点和显著的进步,其实施的有益效果也是显而易见的。It can be seen that, compared with the prior art, the present invention has outstanding substantive features and remarkable progress, and the beneficial effects of its implementation are also obvious.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, In other words, other drawings can also be obtained from these drawings on the premise of not paying creative work.

图1是本发明实施例1提供的一种白盒交换机U-Boot自动化测试方法的流程图。FIG. 1 is a flow chart of a U-Boot automated testing method for a white-box switch provided in Embodiment 1 of the present invention.

图2是本发明实施例2提供的一种白盒交换机U-Boot自动化测试系统的原理框图。FIG. 2 is a functional block diagram of a U-Boot automated testing system for a white-box switch provided in Embodiment 2 of the present invention.

其中,1-测试任务创建模块,1.1-快捷键功能测试单元,1.2-资产信息测试单元,1.3-主备芯片功能测试单元,1.4-重启压力测试单元,2-交换机配置模块,3-测试连接模块,4-测试设置模块,5-测试执行模块。Among them, 1-Test task creation module, 1.1-Shortcut key function test unit, 1.2-Asset information test unit, 1.3-Active and standby chip function test unit, 1.4-Restart stress test unit, 2-Switch configuration module, 3-Test connection module, 4-test setup module, 5-test execution module.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明中的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described The embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

下面对本发明中出现的关键术语进行解释:The following key terms appearing in the present invention are explained:

U-Boot:全称Universal Boot Loader,是德国DENX小组开发的用于多种嵌入式CPU的BootLoader程序,遵循GPL条款;U-Boot从FADSROM、8xxROM、PPCBOOT逐步发展演化而来,主要用于嵌入式系统的引导加载。U-Boot: The full name is Universal Boot Loader, which is a BootLoader program developed by the German DENX team for various embedded CPUs, following the terms of the GPL; U-Boot gradually evolved from FADSROM, 8xxROM, and PPCBOOT, and is mainly used for embedded System bootloader.

实施例1:Example 1:

如图1所示,本实施例提供一种白盒交换机U-Boot自动化测试方法,包括以下步骤:As shown in Figure 1, the present embodiment provides a U-Boot automated testing method for a white box switch, including the following steps:

S1:创建U-Boot自动化测试任务并选择测试所需的自动化脚本;S1: Create a U-Boot automation test task and select the automation script required for the test;

其中,U-Boot自动化测试任务包括快捷键功能测试,快捷键功能测试具体方法如下:调用python脚本,控制SecureCRT在U-Boot系统中下发重启指令;等待重启并判断SecureCRT界面是否出现进入Booting阶段的关键字;当屏幕出现进入Booting阶段的关键字后,模拟U-Boot中对应测试项的快捷键,不同的快捷键进入不同的界面;验证模拟的快捷键是否进入预期的对应界面,模拟的快捷键进入对应界面则测试通过,否则测试失败;通过快捷键功能测试验证U-Boot的快捷键功能与预期是否相符。Among them, the U-Boot automated test task includes the shortcut key function test. The specific method of the shortcut key function test is as follows: call the python script, control the SecureCRT to issue a restart command in the U-Boot system; wait for the restart and judge whether the SecureCRT interface appears to enter the Booting stage keywords; when the screen displays the keywords that enter the Booting stage, simulate the shortcut keys corresponding to the test items in U-Boot, and enter different interfaces with different shortcut keys; verify whether the simulated shortcut keys enter the expected corresponding interface, simulate If the shortcut key enters the corresponding interface, the test passes, otherwise the test fails; through the shortcut key function test, it is verified whether the function of the shortcut key of U-Boot is consistent with the expectation.

U-Boot自动化测试任务包括资产信息测试,资产信息测试具体方法如下:第一步将设计文档中资产信息的名称与期望值汇总至测试数据集中;第二步分别在U-Boot中下发CPU、内存、M.2、电源资产信息的指令;第三步将指令下发后获得的返回值与测试数据集中的期望值进行对比;第四步对比判定,返回值与测试数据集中的期望值一致则测试通过,否则测试失败;通过资产信息测试验证U-Boot中显示的内存、M.2、电源以及CPU等主要部件的信息显示是否完全正确。The U-Boot automated test task includes asset information testing. The specific method of asset information testing is as follows: the first step is to summarize the name and expected value of the asset information in the design document into the test data set; the second step is to issue CPU, Instructions for memory, M.2, and power asset information; the third step compares the return value obtained after the instruction is issued with the expected value in the test data set; the fourth step compares and judges, if the return value is consistent with the expected value in the test data set, test Pass, otherwise the test fails; pass the asset information test to verify whether the information displayed in U-Boot on main components such as memory, M.2, power supply, and CPU is completely correct.

U-Boot自动化测试任务包括主备芯片功能测试,主备芯片功能测试具体方法如下:第一步调用python脚本,在SecureCRT控制台中确定当前使用的是主Flash芯片;第二步将启动模式改为备用Flash启动,并下发重启指令;第三步再次在自动化脚本中获取当前启动的Flash,判断是否已更改为备用Flash启动,如果已经更改为备用Flash启动则进入第四步,否则测试失败;第四步在脚本中下发关闭主芯片的指令,并将默认启动的Flash改为主芯片;第五步下发重启指令,再次进入U-Boot系统后验证当前是否使用备用芯片启动的,如果当前是使用备用芯片启动,则测试通过,反之测试失败;通过主备芯片功能测试验证主备芯片切换、主芯片启动以及备用芯片启动功能。The U-Boot automated test task includes the function test of the main and standby chips. The specific method of the function test of the main and standby chips is as follows: the first step calls the python script, and confirms that the main Flash chip is currently used in the SecureCRT console; the second step changes the startup mode to Start the backup Flash, and issue a restart command; the third step is to obtain the currently started Flash in the automation script again, and judge whether it has been changed to the backup Flash startup. If it has been changed to the backup Flash startup, enter the fourth step, otherwise the test fails; The fourth step is to issue the command to shut down the main chip in the script, and change the default startup Flash to the main chip; the fifth step is to issue a restart command, enter the U-Boot system again and verify whether the current backup chip is used to start, if If the standby chip is currently used to start, the test passes, otherwise the test fails; the main and standby chip switching, main chip startup and backup chip startup functions are verified through the main and backup chip function test.

U-Boot自动化测试任务还包括重启压力测试,重启压力测试具体方法如下:第一步调用python脚本,在SecureCRT控制台模拟U-Boot快捷键进入系统;第二步在系统中下发日志检查命令,核对日志中是否存在告警日志或异常日志,如果存在则测试失败,不存在则继续执行第三步;第三步使用python脚本控制SecureCRT控制台下发系统重启指令;第四步等待系统进入Booting阶段后,模拟快捷键进入U-Boot,并检查日志中是否存在告警日志以及异常日志,如果存在则测试失败,不存在则完成一次重启测试;第五步将上述第一步至第四步重复执行1000次,完成重启压力测试;通过重启压力测试验证多次不断重启的过程中,U-Boot能否每次都成功加载并且进入系统。The U-Boot automated test task also includes restarting the stress test. The specific method of restarting the stress test is as follows: the first step is to call the python script, and simulate the U-Boot shortcut key in the SecureCRT console to enter the system; the second step is to issue a log check command in the system , check whether there is an alarm log or abnormal log in the log, if it exists, the test fails, if not, continue to the third step; the third step uses the python script to control the SecureCRT console to issue a system restart command; the fourth step waits for the system to enter Booting After the stage, simulate the shortcut key to enter U-Boot, and check whether there is an alarm log and abnormal log in the log. If there is, the test will fail, and if it does not exist, a restart test will be completed; the fifth step is to repeat the first step to the fourth step above Execute 1000 times to complete the restart stress test; through the restart stress test, verify whether U-Boot can be successfully loaded and enter the system every time during the process of repeated restarts.

S2:配置测试所需的交换机和网络测试仪端口;S2: Configure the switches and network tester ports required for testing;

S3:按照测试任务将交换机与交换机互连,交换机与网络测试仪端口互连;S3: According to the test task, the switch is interconnected with the switch, and the switch is connected with the port of the network tester;

S4:设置测试任务执行时间和次数;S4: Set the test task execution time and times;

S5:执行测试并记录测试日志和结果。S5: Execute the test and record the test log and results.

实施例2:Example 2:

如图2所示,本实施例提供一种白盒交换机U-Boot自动化测试系统,包括:As shown in Figure 2, this embodiment provides a white box switch U-Boot automated test system, including:

测试任务创建模块1:创建U-Boot自动化测试任务并选择测试所需的自动化脚本;Test task creation module 1: Create U-Boot automated test tasks and select the automated scripts required for testing;

交换机配置模块2:配置测试所需的交换机和网络测试仪端口;Switch configuration module 2: configure the switches and network tester ports required for testing;

测试连接模块3:按照测试任务将交换机与交换机互连,交换机与网络测试仪端口互连;Test connection module 3: interconnect the switch with the switch according to the test task, and connect the switch with the port of the network tester;

测试设置模块4:设置测试任务执行时间和次数;Test setting module 4: set the test task execution time and times;

测试执行模块5:执行测试并记录测试日志和结果。Test Execution Module 5: Execute tests and record test logs and results.

本实施例中,所述测试任务创建模块1包括有:In the present embodiment, described test task creation module 1 includes:

快捷键功能测试单元1.1:编写并调用脚本验证U-Boot的快捷键功能与预期是否相符;Shortcut key function test unit 1.1: Write and call scripts to verify whether the shortcut key function of U-Boot is as expected;

资产信息测试单元1.2:编写并调用脚本验证U-Boot中显示的内存、M.2、电源以及CPU等主要部件的信息显示是否完全正确;Asset information test unit 1.2: Write and call scripts to verify whether the information displayed in U-Boot on main components such as memory, M.2, power supply, and CPU is completely correct;

主备芯片功能测试单元1.3:编写并调用脚本验证主备芯片切换、主芯片启动以及辅芯片启动功能;Main and standby chip function test unit 1.3: Write and call scripts to verify the main and standby chip switching, main chip startup and auxiliary chip startup functions;

重启压力测试单元1.4:调用脚本验证多次不断重启的过程中,U-Boot能否每次都成功加载并进入系统。Reboot Stress Test Unit 1.4: Call the script to verify whether U-Boot can be successfully loaded and enter the system every time in the process of repeated restarts.

实施例3:Example 3:

本实施例提供一种计算机存储介质,所述计算机存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述方法。This embodiment provides a computer storage medium, where instructions are stored in the computer storage medium, and when the computer is run on the computer, the computer is made to execute the above method.

实施例4:Example 4:

本实施例提供一种终端,包括:This embodiment provides a terminal, including:

处理器、存储器,其中存储器用于存储计算机程序,处理器用于从存储器中调用并运行该计算机程序,使得终端执行上述方法。A processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the terminal executes the above method.

尽管通过参考附图并结合优选实施例的方式对本发明进行了详细描述,但本发明并不限于此。在不脱离本发明的精神和实质的前提下,本领域普通技术人员可以对本发明的实施例进行各种等效的修改或替换,而这些修改或替换都应在本发明的涵盖范围内/任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。Although the present invention has been described in detail in conjunction with preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, those skilled in the art can make various equivalent modifications or replacements to the embodiments of the present invention, and these modifications or replacements should be within the scope of the present invention/any Those skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention, and all should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (6)

1.一种白盒交换机U-Boot自动化测试方法,其特征在于,包括以下步骤:1. a white box switch U-Boot automated testing method, is characterized in that, comprises the following steps: S1:创建U-Boot自动化测试任务并选择测试所需的自动化脚本;S1: Create a U-Boot automation test task and select the automation script required for the test; S2:配置测试所需的交换机和网络测试仪端口;S2: Configure the switches and network tester ports required for testing; S3:按照测试任务将交换机与交换机互连,交换机与网络测试仪端口互连;S3: According to the test task, the switch is interconnected with the switch, and the switch is connected with the port of the network tester; S4:设置测试任务执行时间和次数;S4: Set the test task execution time and times; S5:执行测试并记录测试日志和结果;S5: Execute the test and record the test log and results; 所述步骤S1中U-Boot自动化测试任务包括快捷键功能测试,快捷键功能测试具体方法如下:In the step S1, the U-Boot automated test task includes a shortcut key function test, and the specific method of the shortcut key function test is as follows: 调用python脚本,控制SecureCRT在U-Boot系统中下发重启指令;Call the python script to control SecureCRT to issue a restart command in the U-Boot system; 等待重启并判断SecureCRT界面是否出现进入Booting阶段的关键字;Wait for the restart and judge whether the SecureCRT interface appears the keyword entering the Booting stage; 当屏幕出现进入Booting阶段的关键字后,模拟U-Boot中对应测试项的快捷键,不同的快捷键进入不同的界面;When the keyword to enter the Booting stage appears on the screen, simulate the shortcut keys corresponding to the test items in U-Boot, and enter different interfaces with different shortcut keys; 验证模拟的快捷键是否进入预期的对应界面,模拟的快捷键进入对应界面则测试通过,否则测试失败。Verify whether the simulated shortcut key enters the expected corresponding interface. If the simulated shortcut key enters the corresponding interface, the test passes, otherwise the test fails. 2.根据权利要求1所述的一种白盒交换机U-Boot自动化测试方法,其特征在于,所述步骤S1中U-Boot自动化测试任务还包括资产信息测试,资产信息测试具体方法如下:2. a kind of white box exchange U-Boot automated testing method according to claim 1, is characterized in that, U-Boot automated testing task also comprises asset information test among the described step S1, and asset information test concrete method is as follows: 第一步将设计文档中资产信息的名称与期望值汇总至测试数据集中;The first step is to summarize the name and expected value of the asset information in the design document into the test data set; 第二步分别在U-Boot中下发CPU、内存、M.2、电源资产信息的指令;The second step is to issue instructions for CPU, memory, M.2, and power asset information in U-Boot; 第三步将指令下发后获得的返回值与测试数据集中的期望值进行对比;The third step is to compare the return value obtained after the instruction is issued with the expected value in the test data set; 第四步对比判定,返回值与测试数据集中的期望值一致则测试通过,否则测试失败。The fourth step is to compare and judge. If the return value is consistent with the expected value in the test data set, the test passes, otherwise the test fails. 3.根据权利要求2所述的一种白盒交换机U-Boot自动化测试方法,其特征在于,所述步骤S1中U-Boot自动化测试任务还包括主备芯片功能测试,主备芯片功能测试具体方法如下:3. a kind of white box exchange U-Boot automated testing method according to claim 2, it is characterized in that, U-Boot automated testing task also comprises active and standby chip function test among the described step S1, and active and standby chip function test is specific Methods as below: 第一步调用python脚本,在SecureCRT控制台中确定当前使用的是主Flash芯片;The first step is to call the python script, and determine in the SecureCRT console that the main Flash chip is currently used; 第二步将启动模式改为备用Flash启动,并下发重启指令;The second step is to change the boot mode to standby Flash boot, and issue a restart command; 第三步再次在自动化脚本中获取当前启动的Flash,判断是否已更改为备用Flash启动,如果已经更改为备用Flash启动则进入第四步,否则测试失败;The third step is to obtain the currently started Flash in the automation script again, and judge whether it has been changed to the backup Flash startup. If it has been changed to the backup Flash startup, then enter the fourth step, otherwise the test fails; 第四步在脚本中下发关闭主芯片的指令,并将默认启动的Flash改为主芯片;The fourth step is to issue an instruction to shut down the main chip in the script, and change the Flash that is started by default to the main chip; 第五步下发重启指令,再次进入U-Boot系统后验证当前是否使用备用芯片启动的,如果当前是使用备用芯片启动,则测试通过,反之测试失败。The fifth step is to issue a restart command. After entering the U-Boot system again, verify whether the backup chip is currently used for booting. If the backup chip is currently used for booting, the test passes, otherwise the test fails. 4.根据权利要求3所述的一种白盒交换机U-Boot自动化测试方法,其特征在于,所述步骤S1中U-Boot自动化测试任务还包括重启压力测试,重启压力测试具体方法如下:4. a kind of white box exchange U-Boot automated testing method according to claim 3, it is characterized in that, U-Boot automated testing task also comprises restarting stress test among the described step S1, and restarting stress testing concrete method is as follows: 第一步调用python脚本,在SecureCRT控制台模拟U-Boot快捷键进入系统;The first step is to call the python script to simulate the U-Boot shortcut key on the SecureCRT console to enter the system; 第二步在系统中下发日志检查命令,核对日志中是否存在告警日志或异常日志,如果存在则测试失败,不存在则继续执行第三步;The second step is to issue a log check command in the system to check whether there is an alarm log or abnormal log in the log. If it exists, the test fails, and if it does not exist, continue to the third step; 第三步使用python脚本控制SecureCRT控制台下发系统重启指令;The third step is to use the python script to control the SecureCRT console to issue a system restart command; 第四步等待系统进入Booting阶段后,模拟快捷键进入U-Boot,并检查日志中是否存在告警日志以及异常日志,如果存在则测试失败,不存在则完成一次重启测试;The fourth step is to wait for the system to enter the Booting stage, simulate the shortcut key to enter U-Boot, and check whether there are alarm logs and abnormal logs in the log. If there is, the test fails, and if there is no one, complete a restart test; 第五步将上述第一步至第四步重复执行多次,完成重启压力测试。Step 5: Repeat steps 1 to 4 above several times to complete the restart stress test. 5.一种白盒交换机U-Boot自动化测试系统,其特征在于,系统执行根据权利要求1至4任意一项所述的白盒交换机U-Boot自动化测试方法,包括:5. A white box switch U-Boot automated testing system, characterized in that, the system executes the white box switch U-Boot automated test method according to any one of claims 1 to 4, comprising: 测试任务创建模块:创建U-Boot自动化测试任务并选择测试所需的自动化脚本;Test task creation module: create U-Boot automated test tasks and select the automated scripts required for testing; 交换机配置模块:配置测试所需的交换机和网络测试仪端口;Switch configuration module: configure the switches and network tester ports required for testing; 测试连接模块:按照测试任务将交换机与交换机互连,交换机与网络测试仪端口互连;Test connection module: according to the test task, the switch is interconnected with the switch, and the switch is connected with the port of the network tester; 测试设置模块:设置测试任务执行时间和次数;Test setting module: set the test task execution time and times; 测试执行模块:执行测试并记录测试日志和结果;Test execution module: execute tests and record test logs and results; 所述测试任务创建模块包括:The test task creation module includes: 快捷键功能测试单元:编写并调用脚本验证U-Boot的快捷键功能与预期是否相符;Shortcut key function test unit: write and call the script to verify whether the shortcut key function of U-Boot is as expected; 资产信息测试单元:编写并调用脚本验证U-Boot中显示的内存、M.2、电源以及CPU部件的信息显示是否完全正确;Asset information test unit: Write and call scripts to verify whether the information display of memory, M.2, power supply and CPU components displayed in U-Boot is completely correct; 主备芯片功能测试单元:编写并调用脚本验证主备芯片切换、主芯片启动以及辅芯片启动功能;Main and standby chip function test unit: write and call scripts to verify the main and standby chip switching, main chip startup and auxiliary chip startup functions; 重启压力测试单元:调用脚本验证多次不断重启的过程中,U-Boot能否每次都成功加载并进入系统。Restart stress test unit: call the script to verify whether U-Boot can be successfully loaded and enter the system every time during the process of repeated restarts. 6.一种计算机存储介质,其特征在于,所述计算机存储介质中存储有指令,当其在计算机上运行时,使得计算机执行权利要求1-4中任一项所述方法。6. A computer storage medium, characterized in that instructions are stored in the computer storage medium, and when the computer storage medium is run on a computer, it causes the computer to execute the method according to any one of claims 1-4.
CN202110499685.9A 2021-05-08 2021-05-08 White box switch U-Boot automatic testing method, system and storage medium Active CN113315675B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110499685.9A CN113315675B (en) 2021-05-08 2021-05-08 White box switch U-Boot automatic testing method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110499685.9A CN113315675B (en) 2021-05-08 2021-05-08 White box switch U-Boot automatic testing method, system and storage medium

Publications (2)

Publication Number Publication Date
CN113315675A CN113315675A (en) 2021-08-27
CN113315675B true CN113315675B (en) 2023-02-24

Family

ID=77371848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110499685.9A Active CN113315675B (en) 2021-05-08 2021-05-08 White box switch U-Boot automatic testing method, system and storage medium

Country Status (1)

Country Link
CN (1) CN113315675B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115208787A (en) * 2022-06-29 2022-10-18 国电南瑞科技股份有限公司 Automatic testing method and system for switch
CN115695265B (en) * 2022-10-20 2024-07-19 深圳市智微智能科技股份有限公司 Automatic cycle power-on and power-off testing method and equipment for switch and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766247A (en) * 2017-10-18 2018-03-06 上海科世达-华阳汽车电器有限公司 Bootloader method of testing, device and readable storage medium storing program for executing
CN109889407A (en) * 2019-02-12 2019-06-14 太仓市同维电子有限公司 A kind of managed switches production test method
CN111694340A (en) * 2020-06-05 2020-09-22 浪潮电子信息产业股份有限公司 Automatic test fixture and method for PSU BootLoader
CN112486809A (en) * 2020-11-23 2021-03-12 苏州浪潮智能科技有限公司 Automatic testing method, system and equipment based on white box switch

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9135150B2 (en) * 2013-02-27 2015-09-15 International Business Machines Corporation Automated execution of functional test scripts on a remote system within a unit testing framework
CN106325868A (en) * 2016-08-24 2017-01-11 南京百敖软件有限公司 Method for binding starting equipment with shortcut keys in UEFI (unified extensible firmware interface)
TWI650710B (en) * 2018-04-12 2019-02-11 和碩聯合科技股份有限公司 Test process detection method
CN111427777B (en) * 2020-03-13 2023-03-21 苏州浪潮智能科技有限公司 SOL test method, system, equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766247A (en) * 2017-10-18 2018-03-06 上海科世达-华阳汽车电器有限公司 Bootloader method of testing, device and readable storage medium storing program for executing
CN109889407A (en) * 2019-02-12 2019-06-14 太仓市同维电子有限公司 A kind of managed switches production test method
CN111694340A (en) * 2020-06-05 2020-09-22 浪潮电子信息产业股份有限公司 Automatic test fixture and method for PSU BootLoader
CN112486809A (en) * 2020-11-23 2021-03-12 苏州浪潮智能科技有限公司 Automatic testing method, system and equipment based on white box switch

Also Published As

Publication number Publication date
CN113315675A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
JP6530774B2 (en) Hardware failure recovery system
CN102289398A (en) Restart testing method
KR20140095882A (en) Test system for evaluating mobile device and driving method thereof
CN113315675B (en) White box switch U-Boot automatic testing method, system and storage medium
TW202036293A (en) Computer system and debugging method thereof
CN100395713C (en) Method and module for automatically repairing basic input output system element
CN111338698A (en) A kind of method and system for BIOS to accurately guide server to start
CN113672306A (en) Method, device, system and medium for recovery from abnormal self-checking of server components
CN101539876A (en) Start-up test system and method thereof
CN104657232A (en) BIOS automatic recovery system and BIOS automatic recovery method
WO2021179787A1 (en) Method and system for testing nvdimm memory on production line
TW202018312A (en) Testing system
CN119201522A (en) A method, system, device and medium for indicating abnormal power supply timing during server startup
CN113450865B (en) Memory test system and test method thereof
CN116662050A (en) A method, device, terminal and medium for error injection support function verification
CN117389781A (en) Abnormality detection and recovery method and system for server equipment, server and medium
CN1477511A (en) Device with BIOS updating and detecting functions
CN115951949A (en) Recovery method and device for configuration parameters of BIOS (basic input output System) and computing equipment
CN102831032A (en) Repair system and method for master boot record of hard disc
CN115098403B (en) Network environment inspection and repair method, system, device and medium for testing machine
CN113835631B (en) Residual platform configuration data deletion method, system, terminal and storage medium
US20040162978A1 (en) Firmware developer user interface
CN114138648B (en) A server reliability testing method, device, server and storage medium
TWI845166B (en) Display method for memory module fatal error
CN115129517B (en) A BIOS option failure recovery method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant