Switch testing methods and related equipment

By using an automated testing platform to generate and apply combined test cases, the problem of a lack of combined scenarios in switch testing has been solved, achieving more comprehensive test coverage and cost reduction.

CN115695261BActive Publication Date: 2026-01-30INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211182051.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2026-01-30
Estimated Expiration
2042-09-27

AI Technical Summary

Technical Problem

Existing switch testing methods lack combined scenarios, leading to probabilistic problems gradually emerging in the later stages of testing or during customer use, increasing high maintenance costs.

Method used

The automated testing platform obtains test commands, captures test case libraries for each functional module, generates combined test cases, and uses these combined test cases to test the switch, covering more probabilistic issues.

Benefits of technology

It enables more comprehensive switch testing, covers more probabilistic issues, and reduces subsequent maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695261B_ABST
    Figure CN115695261B_ABST
Patent Text Reader

Abstract

This application discloses a switch testing method applied to an automated testing platform, comprising: obtaining a test command; retrieving target test cases from a test case library corresponding to each functional module according to the test command; combining the target test cases to obtain combined test cases; and testing the target switch using the combined test cases. Applying the technical solution provided in this application enables more comprehensive switch testing, covering more probabilistic issues and reducing subsequent maintenance costs. This application also discloses a switch testing device, electronic device, and computer-readable storage medium, which similarly possess the aforementioned technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of performance testing, in particular to a switch testing method, and relates to a switch testing device, an electronic device and a computer readable storage medium. BACKGROUND

[0002] Switch testing includes hardware testing, firmware testing and software testing, and specific test items include but are not limited to Design Verification (DV), Signal Integrity (SI), Power Integrity (PI), Electromagnetic Compatibility (EMC), Basic Input Output System (BIOS), Baseboard Management Controller (BMC), reliability and software testing, etc.

[0003] At present, switch testing is performed by each module responsible for the testing of each module within a fixed time. Since each module is tested independently, there is a lack of combined scenario testing, and the probability problems are not fully explored. Therefore, many probability problems will be gradually exposed in the later testing stage or in the process of trial production or customer use, and it is often necessary to pay a high cost to locate and repair such problems.

[0004] Therefore, how to realize more comprehensive switch testing to cover more probability problems and reduce the maintenance cost in the later stage is a problem to be solved by those skilled in the art. SUMMARY

[0005] The purpose of the present application is to provide a switch testing method which can realize more comprehensive switch testing to cover more probability problems and reduce the maintenance cost in the later stage. Another purpose of the present application is to provide a switch testing device, an electronic device and a computer readable storage medium, all of which have the above beneficial effects.

[0006] In a first aspect, the present application provides a switch testing method applied to an automatic testing platform, comprising:

[0007] obtaining a test command;

[0008] grabbing a target test case from a test case library corresponding to each functional module according to the test command;

[0009] combining each target test case to obtain a combined test case;

[0010] Test the target switch by using the combined test case.

[0011] Optionally, the fetching of the target test case from the test case library corresponding to each function module according to the test command comprises:

[0012] Determining the target test function according to the test command;

[0013] In the test case library corresponding to each function module, an initial target test case corresponding to the function attribute of the target test function is queried and determined to exist;

[0014] Among all the initial target test cases, an initial target test case whose weight attribute exceeds a preset threshold is selected as the target test case.

[0015] Optionally, after the test of the target switch by using the combined test case, the method further comprises:

[0016] Obtaining a test result about the target switch;

[0017] When an abnormality identifier exists in the test result, an abnormal problem corresponding to the abnormality identifier is determined;

[0018] According to an abnormality level standard, an abnormality level corresponding to the abnormal problem is determined;

[0019] According to a correlation coefficient standard, a correlation coefficient of the abnormal problem of the abnormality level and each test case in each test case library is determined;

[0020] According to the correlation coefficient, the weight attribute of the test case is updated.

[0021] Optionally, the combining of each target test case to obtain a combined test case comprises:

[0022] Each target test case is combined according to a preset execution order, a preset execution times, and a preset execution mode to obtain the combined test case; wherein the preset execution mode comprises serial execution and parallel execution.

[0023] Optionally, the test of the target switch by using the combined test case comprises:

[0024] Determining each target switch connected to the automatic test platform;

[0025] The combined test case is sent to each target switch, so that each target switch executes the combined test case to realize switch testing.

[0026] Optionally, after testing the target switch using the combined test case, the method further comprises:

[0027] obtaining a test result about the target switch;

[0028] storing the test result to a log file.

[0029] Optionally, the switch testing further comprises:

[0030] receiving a filtering command;

[0031] filtering the test result with an abnormal identifier in the log file according to the filtering command.

[0032] In a second aspect, the present application discloses a switch testing device applied to an automatic testing platform, comprising:

[0033] a obtaining module, configured to obtain a test command;

[0034] a grabbing module, configured to grab target test cases in test case libraries corresponding to each functional module according to the test command;

[0035] a combining module, configured to combine each target test case to obtain a combined test case;

[0036] a testing module, configured to test a target switch using the combined test case.

[0037] In a third aspect, the present application discloses an electronic device, comprising:

[0038] a memory, configured to store a computer program;

[0039] a processor, configured to execute the computer program to realize steps of any switch testing method described above.

[0040] In a fourth aspect, the present application discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize steps of any switch testing method described above.

[0041] The present application provides a switch testing method applied to an automatic testing platform, comprising: obtaining a test command; grabbing target test cases in test case libraries corresponding to each functional module according to the test command; combining each target test case to obtain a combined test case; and testing a target switch using the combined test case.

[0042] By using the technical solution provided in the application, an automatic test platform is created, which can be connected with test case libraries of various functional modules, and in the test process, test cases can be automatically captured from various test case libraries for combination, so as to realize the test of the switch of the combined scene. Obviously, compared with the implementation mode of sequentially testing the switch of a single functional module, the technical solution can realize more comprehensive and efficient switch testing, can cover more probabilistic problems, and effectively reduces the maintenance cost of the switch in the later period.

[0043] The switch testing device, the electronic equipment and the computer readable storage medium provided in the application also have the technical effects described above, and the application will not be described here. BRIEF DESCRIPTION OF DRAWINGS

[0044] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the application, the drawings needed to be used in the description of the prior art and the embodiments of the application will be briefly introduced below. Of course, the drawings related to the embodiments of the application described below are only a part of the embodiments of the application, and those skilled in the art can obtain other drawings according to the provided drawings without creative labor, and the obtained other drawings also belong to the protection scope of the application.

[0045] Figure 1 A flowchart of a switch testing method provided in the application;

[0046] Figure 2 A topology diagram of an automatic test platform provided in the application;

[0047] Figure 3 A structural diagram of a switch testing device provided in the application;

[0048] Figure 4 A structural diagram of an electronic equipment provided in the application. DETAILED DESCRIPTION

[0049] The core of the application is to provide a switch testing method, which can realize more comprehensive switch testing to cover more probabilistic problems and reduce the maintenance cost in the later period. Another core of the application is to provide a switch testing device, an electronic equipment and a computer readable storage medium, which all have the beneficial effects described above.

[0050] In order to make the technical solutions in the embodiments of the present application more clearly and completely, the technical solutions in the embodiments of the present application will be described below in conjunction with the drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0051] The embodiment of the present application provides a switch test method.

[0052] Please refer to Figure 1 , Figure 1 A flowchart of a switch test method provided by the present application is shown in the figure. The switch test method is applied to an automated test platform and can include the following S101-S104.

[0053] S101: Obtain a test command;

[0054] First of all, it should be noted that the switch test method provided by the embodiments of the present application is applied to an automated test platform. After connecting the switch under test into the automated test platform, the switch under test can be tested.

[0055] Further, this step aims to achieve the acquisition of the test command, which is a command for testing the target switch, wherein the target switch is the switch that needs to be tested, i.e. the above-mentioned switch under test. It can be understood that the acquisition method of the test command is not unique, which can be directly input by the technician through the front-end device, or it can be automatically responded to some trigger conditions, such as timing conditions, switch port sensing conditions, etc. Therefore, the acquisition method of the test command is not limited in the embodiments of the present application.

[0056] S102: According to the test command, grab the target test case in the test case library corresponding to each function module;

[0057] This step aims to achieve automatic grabbing of test cases. Specifically, a test case library corresponding to each function module can be created in advance, and each test case library contains a plurality of test cases of the corresponding function module, wherein the test cases can directly use the automated test scripts already implemented by each function module. Further, the automated test platform is connected to each test case library, so that the automated test platform can directly grab the test cases in each test case library to achieve automated testing of the switch.

[0058] In the implementation process, after receiving the test command, the test cases in each test case library can be automatically captured according to the test command. Here, the captured test cases are referred to as target test cases. It should be noted that the automatic capture of target test cases can be random capture or capture following a pre-set capture strategy. For example, test cases related to the current test function can be captured. On this basis, the number of target test cases is not unique. One or more test cases can be captured from each test case library, or one or more test cases can be captured from part of the test case library. The present application does not limit this.

[0059] S103: combining each target test case to obtain a combined test case;

[0060] This step aims to combine test cases to obtain a combined test case. Specifically, after automatically capturing a plurality of target test cases, all target test cases can be combined into a complete test case containing a plurality of different test items, i.e., the above-mentioned combined test case, so as to test the target switch based on the combined test case, thereby realizing the test of the switch in the combined scenario.

[0061] It should be noted that the combination of a plurality of target test cases is not unique. It can be implemented according to a pre-set combination strategy. The combination strategy can set the execution order, execution times, execution mode, etc. of a plurality of target test cases to realize the generation of a combined test case. Of course, the specific content of the combination strategy can be set by the technician according to the actual situation, and the present application does not limit this.

[0062] S104: testing the target switch by using the combined test case.

[0063] This step aims to realize the test of the switch based on the combined test case. Specifically, after generating a combined test case based on a plurality of target test cases, the target switch can be tested by using the combined test case. In the implementation process, the combined test case can be sent to the target switch to make it execute the combined test case, so as to obtain the final test result. Thus, the test of the switch is completed.

[0064] It can be seen that the switch test method provided in the embodiments of the present application creates an automatic test platform, which can be connected with the test case libraries of various functional modules. During the test process, test cases can be automatically captured from the various test case libraries for combination, so as to realize the switch test of the combined scene. Obviously, compared with the implementation mode of sequentially performing the switch test of a single functional module, the technical solution can realize more comprehensive and efficient switch test, can cover more probabilistic problems, and effectively reduces the maintenance cost of the switch in the later period.

[0065] On the basis of the above embodiments:

[0066] In an embodiment of the present application, the above capturing of the target test case in the test case library corresponding to each functional module according to the test command can include the following steps:

[0067] Determining the target test function according to the test command;

[0068] In the test case library corresponding to each functional module, an initial target test case with a functional attribute corresponding to the target test function is queried and determined;

[0069] In all initial target test cases, an initial target test case with a weight attribute exceeding a preset threshold is selected as the target test case.

[0070] The embodiments of the present application provide an implementation method for automatically capturing a target test case.

[0071] Specifically, when a technician initiates a switch test, the related information of the current test function (i.e., the above target test function) can be attached to the test command. Thus, after receiving the test command, the automatic test platform can determine the target test function through command analysis.

[0072] Further, each test case in each test case library is pre-set with a functional attribute and a weight attribute. The functional attribute is used to indicate which function of the switch test the corresponding test case is used to implement, and the weight attribute is used to indicate the correlation between the corresponding test case and the target test function. The higher the correlation is, the higher the weight value is. Thus, after determining the target test function, the functional attribute corresponding to the target test function can be determined first, and each test case with the functional attribute can be queried in each test case library. Here, these queried test cases can be referred to as initial target test cases. Then, in all initial target test cases, an initial target test case with a weight attribute exceeding a preset threshold is selected as the target test case, that is, an initial target test case with higher correlation with the target test function is selected as the target test case. Thus, the automatic capturing of the target test case based on the functional attribute and the weight attribute is realized.

[0073] The specific value of the preset threshold does not affect the implementation of the technical solution, and can be set by the technician according to the actual situation, and the present application does not limit this.

[0074] In an embodiment of the present application, after the above-mentioned test on the target switch using the combination test case, the following steps can be further included:

[0075] Obtaining the test result about the target switch;

[0076] When the abnormal identifier exists in the test result, determining the abnormal problem corresponding to the abnormal identifier;

[0077] According to the abnormal level standard, determining the abnormal level corresponding to the abnormal problem;

[0078] According to the correlation coefficient standard, determining the correlation coefficient between the abnormal problem of the abnormal level and each test case in each test case library;

[0079] According to the correlation coefficient, updating the weight attribute of the test case.

[0080] The embodiment of the present application provides an implementation method for updating the weight attribute. It can be understood that at the beginning of the test, the initial value of the weight attribute of each test case is set to 1, and further, in the whole test process, the weight value attribute of each test case can be updated according to the test result, so as to screen the test case that best meets the test requirement.

[0081] In the implementation process, after the test on the target switch based on the combination test case is completed, the corresponding test result can be first counted, and it is determined whether the abnormal identifier exists in the test result. Obviously, when the test result does not contain the abnormal identifier (such as error identifier, warning identifier, etc.), it means that this test is passed, and the target switch is qualified. When the test result contains the abnormal identifier, it means that this test is not passed, and the target switch is unqualified. Then, when it is determined that the abnormal identifier exists in the test result, the abnormal problem corresponding to the abnormal identifier in the test result can be further determined, and the abnormal level corresponding to the abnormal problem can be determined by querying the abnormal level standard. Further, after the abnormal problem and the abnormal level of the abnormal problem are determined, the correlation coefficient between the abnormal problem of the abnormal level and each test case in each test case library can be determined by querying the correlation coefficient standard. Finally, the weight attribute of each test case can be updated according to the correlation coefficient.

[0082] In the weight attribute updating process based on the correlation coefficient, a weight change value can be calculated according to the current correlation coefficient, and then the weight change value is added to the current weight attribute to obtain the updated weight attribute. For example, the correlation coefficient ranges from 0.1 to 1, and the weight calculation factor is 10. When the correlation coefficient is 0.8, the weight change value is 0.8*10=8. If the current weight attribute of a test force is the initial value 1, the updated weight attribute is 1+8=9 after the weight change value is added to the current weight attribute.

[0083] In addition, the abnormality level criterion and the correlation coefficient criterion are both determination criteria pre-created by technicians according to historical experience and pre-stored in a designated storage space, which can be directly called when used.

[0084] In an embodiment of the present application, the combination of the target test cases to obtain the combined test case can include the following steps:

[0085] The target test cases are combined according to the preset execution order, the preset execution times, and the preset execution mode to obtain the combined test case. The preset execution mode includes serial execution and parallel execution.

[0086] The embodiment of the present application provides an implementation mode of combining a plurality of target test cases into one combined test case, that is, the combination of the target test cases can be implemented according to the preset execution order, execution times, and execution mode. The preset execution order specifies the execution order of the target test cases. The preset execution times specify the execution times of each target test case. The preset execution mode specifies the execution mode of different test cases, which can be parallel execution or serial execution. For example, each target test case can be executed N times, and different types of target test cases are executed in parallel. Or, target test case 1 is executed N times, and then target test case 2 is executed N times to implement serial execution.

[0087] In an embodiment of the present application, the test of the target switch by using the combined test case can include the following steps:

[0088] Each target switch connected to the automated test platform is determined.

[0089] The combined test case is sent to each target switch to enable each target switch to execute the combined test case and implement the switch test.

[0090] The switch testing method provided by the embodiments of the present application can realize the synchronous testing of multiple target switches, so as to improve the testing efficiency of the switches. Specifically, in the automatic testing platform, a dynamically scalable interface is arranged, and the target switches can be added and deleted, so that the interface can be set according to the quantity requirement of the target switches during the testing of the switches, and each interface is used to connect one target switch. On this basis, when the automatic testing platform tests the target switches by using the combined test case, the target switches connected with the automatic testing platform are determined first, and then the combined test case is sent to each target switch, so as to realize the synchronous testing of multiple target switches.

[0091] In an embodiment of the present application, after the testing of the target switches by using the combined test case, the following steps can be further included:

[0092] obtaining the testing result of the target switch;

[0093] storing the testing result into a log file.

[0094] The switch testing method provided by the embodiments of the present application can further realize the generation of the log file, and based on the log file, the subsequent abnormality tracing is more convenient, so that after the testing of the target switch based on the combined test case is completed, the testing result of the target switch can be counted and added to the log file. The log file is used to store the testing result of each tested switch.

[0095] In an embodiment of the present application, the switch testing can further include the following steps:

[0096] receiving a filtering command;

[0097] filtering the testing result with the abnormality identifier in the log file according to the filtering command.

[0098] The switch testing method provided by the embodiments of the present application can further realize the filtering function of the abnormality problem, that is, the testing result with the abnormality identifier can be filtered from the log file according to the received filtering command, that is, all the target switches with the failed testing can be directly filtered, so as to provide the convenience for the abnormality tracing of the switches. The form of the abnormality identifier is not unique, and by adding the related information of the abnormality identifier to the filtering command, the target switch with the specified type of abnormality can be filtered.

[0099] On the basis of the above-mentioned embodiments, another switch testing method is provided in the embodiments of the present application.

[0100] Please refer to Figure 2 , Figure 2This application provides a topology diagram of an automated testing platform, based on which the automated testing platform ( Figure 2 The implementation flow of the switch testing method provided in this application embodiment (shown as an intelligent automated stress testing platform) is as follows:

[0101] 1. Construct a test case library for each functional module. Figure 2 The test case library of module 1 to module n shown can utilize the automated test scripts already implemented in each functional module.

[0102] 2. Add a unique keyword attribute and weight attribute to each test case:

[0103] (1) The keyword attribute corresponds to the test function of the test case (i.e. the above function attribute). For example, the keyword of test_reboot.py is reboot, and the keyword of test_traffic.py is traffic.

[0104] (2) The initial value of the weight attribute is set to 1, and it can be combined with the target switch later. Figure 2 For the problems found in the tested machines 1 to n shown, their weight values ​​are increased. That is, the more bugs related to the function, the greater the weight value. The weight value of each test case can be dynamically adjusted throughout the testing process.

[0105] 3. The correspondence between the weight values ​​of test cases and the bug level (anomaly level) is shown in Table 1:

[0106] Table 1. Correspondence between weighted attributes and bug levels

[0107]

[0108] For example, if the bug severity level of "probabilistic freezing during reboot" is found to be "severe" through testing, then the correlation coefficient between this bug and the reboot test case is 1, and the weight attribute of the test case test_reboot.py is increased by 10; the correlation coefficient between this bug and the reset test case is 0.8, and the weight attribute of the test case test_reset.py is increased by 8, and so on. The correlation coefficient can be determined based on the experience of the test engineer.

[0109] 4. Automatically filter test cases with higher weight values ​​based on the weight attributes of each test case in the test case library.

[0110] 5. In the early stages of testing, when the weights of each test case are relatively equal, a random number of test cases can be randomly selected from the test case library corresponding to all functional modules, based on the concept of mouse testing (automated testing). These test cases are then combined, and later tests will automatically retrieve test cases based on their weights. The combination of retrieved test cases can be achieved by executing them in three ways: 10 times in forward order, 10 times in reverse order, and 10 times concurrently.

[0111] For example, if two test cases are randomly selected, namely test_onie_eeprom.py script 1 and test_bios_upgrade.py script 2, then there are 3 possible scenarios:

[0112] (1) After script 1 is executed 10 times, script 2 is executed 10 times;

[0113] (2) After script 2 is executed 10 times, script 1 is executed 10 times;

[0114] (3) Script 1 and Script 2 are run concurrently 10 times, and executed in a mixed order.

[0115] In addition, the background script is test_traffic.py, meaning that the background script is executed whenever all test cases are executed.

[0116] 6. One-click execution: The automated testing platform automatically connects to multiple switches under test, executes the scripts obtained from the selection and combination (i.e., the combined test cases mentioned above), and outputs a test report.

[0117] 7. An automatic filtering function is provided for logs with an ERR or higher level in the log file, which facilitates log investigation.

[0118] 8. The automated testing platform is equipped with a dynamic and scalable interface, which can support the dynamic addition and removal of the switches under test.

[0119] As can be seen, the switch testing method provided in this application creates an automated testing platform that can interface with the test case libraries of various functional modules. During the testing process, test cases can be automatically retrieved from each test case library and combined to achieve switch testing in combined scenarios. Obviously, compared with the implementation method of testing switches sequentially by relying on a single functional module, this technical solution can achieve more comprehensive and efficient switch testing, cover more probabilistic problems, and effectively reduce the later maintenance cost of the switch.

[0120] This application provides a switch testing device.

[0121] Please refer to Figure 3 , Figure 3This is a schematic diagram of a switch testing device provided in this application. The switch testing device is applied to an automated testing platform and may include:

[0122] Get module 1, used to obtain test commands;

[0123] The capture module 2 is used to capture target test cases from the test case library corresponding to each functional module according to the test command.

[0124] Combination module 3 is used to combine the target test cases to obtain combined test cases;

[0125] Test module 4 is used to test the target switch using combined test cases.

[0126] As can be seen, the switch testing device provided in this application creates an automated testing platform that can interface with the test case libraries of various functional modules. During the testing process, test cases can be automatically retrieved from each test case library and combined to achieve switch testing in combined scenarios. Obviously, compared with the implementation method of relying on a single functional module to perform switch testing sequentially, this technical solution can achieve more comprehensive and efficient switch testing, cover more probabilistic problems, and effectively reduce the later maintenance cost of the switch.

[0127] In one embodiment of this application, the above-mentioned capture module 2 can be specifically used to determine the target test function according to the test command; in the test case library corresponding to each functional module, query and determine the initial target test case that has the functional attribute corresponding to the target test function; among all the initial target test cases, select the initial target test case whose weight attribute exceeds the preset threshold as the target test case.

[0128] In one embodiment of this application, the switch testing device may further include an update module, configured to: obtain test results for the target switch after testing the target switch using combined test cases; determine the abnormal problem corresponding to the abnormal identifier when an anomaly identifier is present in the test results; determine the anomaly level corresponding to the abnormal problem according to the anomaly level standard; determine the correlation coefficient between the abnormal problem of the anomaly level and each test case in each test case library according to the correlation coefficient standard; and update the weight attribute of the test cases according to the correlation coefficient.

[0129] In one embodiment of this application, the combination module 3 can be specifically used to combine each target test case according to a preset execution order, a preset number of executions, and a preset execution method to obtain combined test cases; wherein, the preset execution method includes serial execution and parallel execution.

[0130] In one embodiment of this application, the test module 4 described above can be specifically used to determine each target switch connected to the automated test platform; and to distribute combined test cases to each target switch so that each target switch executes the combined test cases to achieve switch testing.

[0131] In one embodiment of this application, the switch testing device may further include a log generation module, used to obtain test results about the target switch after testing the target switch using the combined test cases; and to store the test results in a log file.

[0132] In one embodiment of this application, the switch testing device may further include a log filtering module for receiving filtering commands and filtering test results with anomaly indicators in the log file according to the filtering commands.

[0133] For a description of the apparatus provided in the embodiments of this application, please refer to the above method embodiments; further details will not be repeated here.

[0134] This application provides an electronic device.

[0135] Please refer to Figure 4 , Figure 4 This application provides a schematic diagram of the structure of an electronic device, which may include:

[0136] Memory, used to store computer programs;

[0137] A processor, used to execute computer programs, can implement the steps of any of the switch testing methods described above.

[0138] like Figure 4 The diagram shows the structural composition of an electronic device, which may include a processor 10, a memory 11, a communication interface 12, and a communication bus 13. The processor 10, memory 11, and communication interface 12 all communicate with each other through the communication bus 13.

[0139] In this embodiment, the processor 10 may be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic devices.

[0140] The processor 10 can call the program stored in the memory 11. Specifically, the processor 10 can execute the operations in the embodiment of the switch testing method.

[0141] The memory 11 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment, the memory 11 stores at least a program for implementing the following functions:

[0142] Get the test command;

[0143] Retrieve target test cases from the test case library corresponding to each functional module according to the test command;

[0144] Combine the target test cases to obtain combined test cases;

[0145] The target switch is tested using a combination of test cases.

[0146] In one possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.

[0147] In addition, memory 11 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.

[0148] Communication interface 12 can be an interface for the communication module, used to connect with other devices or systems.

[0149] Of course, it should be noted that, Figure 4 The structure shown does not constitute a limitation on the electronic device in the embodiments of this application. In practical applications, the electronic device may include more than Figure 4 More or fewer components as shown, or combinations of certain components.

[0150] This application provides a computer-readable storage medium.

[0151] The computer-readable storage medium provided in this application embodiment stores a computer program, which, when executed by a processor, can implement the steps of any of the above-described switch testing methods.

[0152] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0153] For a description of the computer-readable storage medium provided in the embodiments of this application, please refer to the above method embodiments; further details will not be repeated here.

[0154] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0155] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0156] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0157] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this application. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A method of testing a switch, the method comprising: The application is applied to an automatic test platform, and comprises: acquiring a test command; grabbing a target test case in a test case library corresponding to each function module according to the test command, comprising: determining a target test function according to the test command; in the test case library corresponding to each function module, querying an initial target test case with a function attribute corresponding to the target test function; and selecting an initial target test case with a weight attribute exceeding a preset threshold value from all the initial target test cases as the target test case; combining each target test case to obtain a combined test case; testing a target switch by using the combined test case; acquiring a test result about the target switch; when there is an abnormal identifier in the test result, determining an abnormal problem corresponding to the abnormal identifier; determining an abnormal level corresponding to the abnormal problem according to an abnormal level standard; determining a correlation coefficient of the abnormal problem of the abnormal level and each test case in each test case library according to a correlation coefficient standard; updating a weight attribute of the test case according to the correlation coefficient; wherein the function attribute is used to indicate a function of the switch test implemented by the corresponding test case, and the weight attribute is used to indicate a correlation between the corresponding test case and the target test function, and the higher the correlation is, the greater the weight value is; the initial value of the weight attribute of the test case is 1, and the more the bugs related to the function of the test case are, the greater the weight value of the test case is.

2. The method of claim 1, wherein, The combining each target test case to obtain a combined test case comprises: combining each target test case according to a preset execution order, a preset execution frequency and a preset execution mode to obtain the combined test case; wherein the preset execution mode comprises serial execution and parallel execution.

3. The method of claim 1, wherein, The testing a target switch by using the combined test case comprises: determining each target switch connected to the automatic test platform; downloading the combined test case to each target switch to enable each target switch to execute the combined test case and implement switch test.

4. The method of claim 1, wherein, After the testing a target switch by using the combined test case, the method further comprises: acquiring a test result about the target switch; storing the test result to a log file.

5. The method of claim 4, wherein, The method further comprises: receiving a screening command; screening a test result with an abnormal identifier in the log file according to the screening command.

6. A switch tester apparatus, characterized by, The application is applied to an automatic test platform, and comprises: an acquiring module configured to acquire a test command; a grabbing module configured to grab a target test case in a test case library corresponding to each function module according to the test command, comprising: determining a target test function according to the test command; in the test case library corresponding to each function module, querying an initial target test case with a function attribute corresponding to the target test function; and selecting an initial target test case with a weight attribute exceeding a preset threshold value from all the initial target test cases as the target test case; A combination module is configured to combine each of the target test cases to obtain a combined test case; A test module is configured to test the target switch by using the combined test case; An update module is configured to obtain a test result of the target switch, determine an abnormal problem corresponding to an abnormal identifier when the abnormal identifier exists in the test result, determine an abnormal level corresponding to the abnormal problem according to an abnormal level standard, determine a correlation coefficient between the abnormal problem of the abnormal level and each test case in each of the test case libraries according to a correlation coefficient standard, and update a weight attribute of the test case according to the correlation coefficient. The function attribute is used to indicate a function of the switch test implemented by the corresponding test case, and the weight attribute is used to indicate a correlation between the corresponding test case and the target test function. The higher the correlation is, the greater the weight value is. The initial value of the weight attribute of the test case is 1, and the more the bugs related to the function of the test case are, the greater the weight value of the test case is.

7. An electronic device, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the switch test method according to any one of claims 1 to 5. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the switch test method according to any one of claims 1 to 5. ​ 8. A computer-readable storage medium, characterized in that, ​

Citation Information

Patent Citations

  • Vehicle-mounted equipment test method, device and system and computer equipment

    CN112596972A