CN116016270A - Switch test management method and device, electronic equipment and storage medium - Google Patents

Switch test management method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116016270A
CN116016270A CN202211634511.XA CN202211634511A CN116016270A CN 116016270 A CN116016270 A CN 116016270A CN 202211634511 A CN202211634511 A CN 202211634511A CN 116016270 A CN116016270 A CN 116016270A
Authority
CN
China
Prior art keywords
test
switch
log information
resolvable
log
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.)
Pending
Application number
CN202211634511.XA
Other languages
Chinese (zh)
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211634511.XA priority Critical patent/CN116016270A/en
Publication of CN116016270A publication Critical patent/CN116016270A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a method and a device for testing and managing a switch, electronic equipment and a storage medium. The switch test management method comprises the following steps: when the switch is tested, a test case log and a case number are obtained from a switch defect library; binding the test case log and the case number to generate a resolvable format file; generating a test script according to the resolvable format file and a preset test script template, and distributing the test script to a plurality of different types of switches to be tested; acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested; screening the test log information according to the resolvable format file to generate error report log information; and updating the switch defect library by adopting the error report log information. The embodiment of the invention can improve the test execution efficiency and the test flexibility.

Description

Switch test management method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of switch testing technologies, and in particular, to a switch test management method, a switch test management device, an electronic device, and a storage medium.
Background
With the development of the internet, the quality requirement on the switch product is higher and higher, and the iteration efficiency of the switch product is also higher, so that the test work as an important link for ensuring the quality of the product is more and more important. After each test is completed, a significant amount of time may be required to complete a summary of the test job. And because the switch products are various and the complexity of the test work is different, under the condition that a plurality of products are delivered simultaneously, the defects are easily caused by a large number of repeated test works, the test is insufficient, and serious hidden danger is left for quality problems.
Although many testing activities are performed in an automatic mode, automatic testing results also need to be manually summarized and analyzed, analysis results cannot be shared, so that the efficiency of automatic testing is low, the dependence of log analysis on manpower is reduced for improving the accuracy of the automatic testing, and the effectiveness and flexibility of a defect library are improved.
Disclosure of Invention
In view of the above problems, embodiments of the present invention have been made to provide a switch test management method, a switch test management apparatus, an electronic device, and a storage medium that overcome or at least partially solve the above problems.
In a first aspect of the present invention, an embodiment of the present invention discloses a method for managing a test of a switch, including:
when the switch is tested, a test case log and a case number are obtained from a switch defect library;
binding the test case log and the case number to generate a resolvable format file;
generating a test script according to the resolvable format file and a preset test script template, and distributing the test script to a plurality of different types of switches to be tested;
acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested;
screening the test log information according to the resolvable format file to generate error report log information;
and updating the switch defect library by adopting the error report log information.
Optionally, the method further comprises:
receiving a test script template expansion instruction, wherein the test script template instruction comprises expansion data;
and updating the preset test script template by adopting the expansion data.
Optionally, the method further comprises:
after the test script is generated, generating test script notification information according to the test script;
And responding to the confirmation operation aiming at the notification information of the test script, and executing the step of distributing the test script to a plurality of different types of switches to be tested.
Optionally, the method further comprises:
acquiring a historical switch test log;
and constructing the switch defect library according to the historical switch test log.
Optionally, the binding the test case log and the case number to generate a resolvable format file includes:
determining the case number;
associating the test case log with the case number;
writing the related test case log and the case number into a preset resolvable format data set to generate the resolvable format file.
Optionally, the filtering the test log information according to the resolvable format file to generate error report log information includes:
comparing the resolvable format file with the test log information;
and when the test log information comprises an error reporting mark matched with the resolvable format file, determining the test log information as the error reporting log information.
Optionally, the updating the switch defect library by using the error log information includes:
Determining target error report log information according to the target keyword of the error report log information;
converting the application number and the error application corresponding to the target error report log information into a file with an resolvable format to be updated according to a machine learning principle;
and writing the to-be-updated resolvable format file into the switch defect library to finish updating the switch defect library.
In a second aspect of the present invention, an embodiment of the present invention further discloses a device for testing and managing a switch, including:
the first acquisition module is used for acquiring a test case log and a case number from a switch defect library when a switch test is performed;
the binding module is used for binding the test case log and the case number and generating a resolvable format file;
the test distribution module is used for generating a test script according to the resolvable format file and a preset test script template and distributing the test script to a plurality of different types of switches to be tested;
the second acquisition module is used for acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested;
the screening module is used for screening the test log information according to the resolvable format file and generating error report log information;
And the first updating module is used for updating the switch defect library by adopting the error report log information.
In a third aspect of the present invention, an embodiment of the present invention further discloses an electronic device, including a processor, a memory, and a computer program stored on the memory and capable of running on the processor, where the computer program when executed by the processor implements the steps of the switch test management method as described above.
In a fourth aspect of the present invention, embodiments of the present invention also disclose a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the switch test management method as described above.
The embodiment of the invention has the following advantages:
when the switch is tested, the embodiment of the invention acquires the test case log and the case number from the switch defect library; binding the test case log and the case number to generate a resolvable format file; generating a test script according to the resolvable format file and a preset test script template, and distributing the test script to a plurality of different types of switches to be tested; acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested; screening the test log information according to the resolvable format file to generate error report log information; and updating the switch defect library by adopting the error report log information. According to the known problem types of different switches in the switch defect library, a test script is generated and distributed to the switch to be tested for execution, log information in the test process is compared and analyzed with the known problems, and an analysis result is updated to the defect library, so that the time for a tester to verify the known problem of one switch in other types of switches is saved, and the test efficiency is improved; and the newly found problems are classified into a switch defect library, the switch defect library is updated, and the flexibility of the switch defect library is improved.
Drawings
FIG. 1 is a flow chart of steps of an embodiment of a switch test management method of the present invention;
FIG. 2 is a flow chart of steps of another embodiment of a switch test management method of the present invention;
FIG. 3 is a flow chart of steps of an example of a switch test management method of the present invention;
FIG. 4 is a schematic diagram of script generation for an example of a switch test management method of the present invention;
fig. 5 is a block diagram of an embodiment of a test management apparatus for a switch according to the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention;
fig. 7 is a block diagram of a storage medium according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a method for managing a test of a switch according to the present invention may specifically include the following steps:
step 101, when the switch is tested, a test case log and a case number are obtained from a switch defect library;
the defect library of the switch stores files for discovering loopholes (BUGs) in the test process of various types of switches. The file includes at least a test case log and a case number. The switch defect library can be divided into a switch defect library 1, a switch defect library 2 and a switch defect library 3 … according to the type of the switch; n is a positive integer. When the method is used for calling, all the switch defect libraries are called at the same time, namely all the switch defect library 1, the switch defect library 2 and the switch defect library 3 and … switch defect library N are called. In addition, the division of the switch defect library by adopting the pure numbers is only an example of the embodiment of the invention, and the division of the switch defect library can also be realized by adopting the modes of pure letters, combination of the numbers and the letters, and the like; this is not particularly limited.
When the switch test is performed, the test case log and the case number can be obtained from the data corresponding to the storage address (interval) of the switch defect library. The storage address (interval) may be a local storage space of a server connected to the switch, or may be a cloud storage space of a cloud space connected to the switch and the server, which is not particularly limited in the embodiment of the present invention.
Step 102, binding the test case log and the case number to generate a resolvable format file;
after the test case log and the case number are obtained, the test case log and the case number can be bound to generate an resolvable format file so that the resolvable format file can be directly read and resolved for testing the switch. The parsable format file may be an HTML (Hyper Text Markup Language ) file, a JSON (JavaScript Object Notation, JS object profile) file. JSON is a text-based, language-independent lightweight data interchange format. It stores and presents data in a text format that is completely independent of the programming language based on a subset of ECMAScript (European Computer Manufacturers Association, js specification by the european computer institute). The simple and clear hierarchical structure makes it easy for machine to analyze and generate and effectively improves the network transmission efficiency. HTML is an identified language. The document format on the network can be unified through the labels, so that the scattered Internet (Internet) resources are connected into a logic whole. An HTML file is a descriptive text made up of HTML commands that can specify words, graphics, animations, sounds, tables, links, etc. Hypertext is a way of organizing information by associating words, charts in text with other information media by means of hyperlinks. The information media related to each other may be in the same text, other files, or files on a computer that is geographically remote. The information resource distributed at different positions is connected in a random mode by the information organization mode, so that convenience is provided for information retrieval.
Step 103, generating a test script according to the resolvable format file and a preset test script template, and distributing the test script to a plurality of different types of switches to be tested;
the preset test script template records a script template, a data interface template and a distribution rule template which are equal to templates required by the test script for generating test script codes; after the preset test script template can be modified through the modification/expansion instruction, the update of the preset test script template is realized.
After the resolvable format file is obtained, the data obtained by resolving the resolvable format file can be written into a preset test script template to generate a test script, wherein the test script comprises a series of instructions for being executed by the switch to be tested, and the switch to be tested is tested. And after the test script is generated, the test script can be distributed to the switch to be tested according to the characteristic of the mark of each switch to be tested, such as an IP (Internet Protocol ) address, an equipment identification code, a test type (if a part of functions are specific to a certain type of switch, the function is not involved in distribution, and the switch to be tested is not tested), and the like, so that the switch to be tested is tested.
Step 104, acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested;
after receiving the test script, the switch to be tested executes the test script to start testing. During the process of executing the test script by the switch to be tested, the switch to be tested generates a test log. The test log information generated by the switch to be tested can be obtained from the storage address (interval) of the switch to be tested, wherein the storage address (interval) stores the test log.
Step 105, screening the test log information according to the resolvable format file to generate error report log information;
and comparing the acquired test log information with log information recorded by the resolvable format file and having error conditions, screening out the matched test log information, and generating error report log information.
In addition, when the resolvable format file is compared with the recorded log information of the error condition, the fact that no match exists is found, and the error report log information can be blank information, namely the error report log information does not have data for substantially changing the switch defect library.
And step 106, updating the switch defect library by adopting the error report log information.
When the error log information is screened out, the defect of a new switch is found in the test process, and other switches can be tested in the follow-up process. Therefore, the fault library of the switch is updated by adopting error log information, and is supplemented, so that the content of the test in the test process can be more, and the verification result is more reliable.
In addition, when the error report log information is empty, the current test shows that no new switch defect is found, the current switch defect library is perfect, when the switch defect library is updated by adopting the empty error report log information, the content of the updated switch defect library is empty, or when the error report log information is detected to be empty, the switch defect library is not updated, and the current switch defect library is used.
When the switch is tested, the embodiment of the invention acquires the test case log and the case number from the switch defect library; binding the test case log and the case number to generate a resolvable format file; generating a test script according to the resolvable format file and a preset test script template, and distributing the test script to a plurality of different types of switches to be tested; acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested; screening the test log information according to the resolvable format file to generate error report log information; and updating the switch defect library by adopting the error report log information. According to the known problem types of different switches in the switch defect library, a test script is generated and distributed to the switch to be tested for execution, log information in the test process is compared and analyzed with the known problems, and an analysis result is updated to the defect library, so that the time for a tester to verify the known problem of one switch in other types of switches is saved, and the test efficiency is improved; and the newly found problems are classified into a switch defect library, the switch defect library is updated, and the flexibility of the switch defect library is improved.
Referring to fig. 2, a flowchart illustrating steps of another embodiment of a method for managing switch testing according to the present invention may specifically include the steps of:
step 201, obtaining a history switch test log;
the embodiment of the invention can be applied to the switch test management terminal. The switch test management terminal is connected with a plurality of switches. The connection between the switch test management terminal and the switch can be a wired connection, such as a connection by means of optical fibers, twisted pair wires and other physical cables; the connection may also be wireless, for example, by connecting the switch test management terminal to the same WLAN as the switch.
The switch test management terminal may obtain a history switch test log. The historical switch test log is a test log generated by the switch when the switch is tested in the past. The tester can input the historical switch test log into the switch test management terminal in a mode of externally connecting a storage hard disk and the like, so that the switch test management terminal obtains the historical switch test log; the test log of each switch may be obtained from the storage address (section) of each switch storing the test log as the history switch test log after the switch test management terminal is connected to the switch.
Step 202, constructing the switch defect library according to the historical switch test log;
after the historical switch test log is obtained, the possible defects of the switch can be determined based on the log analysis result in the historical switch test log, so that test cases corresponding to all the defects are recorded, and a switch defect library is constructed and generated.
Step 203, when the switch test is performed, obtaining a test case log and a case number from a switch defect library;
after the switch defect library is built, the switch test management terminal can start to test the switch to be tested.
When the switch test is carried out, the switch test management terminal acquires a test case log and a case number from the switch defect library.
Step 204, binding the test case log and the case number to generate a resolvable format file;
after the test case log and the case number are obtained, the test case log and the case number are bound, and an resolvable format file is generated, so that the resolvable format file is conveniently read in the process of generating the test script, and the test efficiency is improved. Wherein the parseable format file may be an HTML file or JSON file. In a preferred example, the parseable format file is a JSON file.
In an optional embodiment of the present invention, the binding the test case log and the case number, and generating the resolvable format file may specifically include the following sub-steps:
sub-step S2041, determining the use case number;
in practical application, there are a plurality of test case logs and case numbers, and at this time, the specific value of the currently used case number can be determined first. And sequentially increasing and determining all case numbers according to the number of the test case logs.
Sub-step S2042, associating said test case log with said case number;
and correlating the acquired test case log with the case number to form a mapping relation. When two or more test case logs are associated with defects corresponding to the test case logs, the two or more test case logs may be associated with one case number; separate use case numbers may be employed; this is not particularly limited.
And step S2043, writing the related test case log and the case number into a preset resolvable format data set to generate the resolvable format file.
And writing the associated test case log and case number into a preset resolvable format data set of the resolvable format according to a data frame corresponding to the resolvable format of the resolvable format file to generate the resolvable format file. The test case log and the case number are used as one function group data of the resolvable format file; is convenient for subsequent use.
The process of binding the test case log and case number is illustrated using exemplary code in combination with sub-step S2041 through sub-step S2043. The method is described by taking the example of binding the acquired test case log and the case number and generating a JSON file (resolvable format file):
data={
"case_number_1":{
"log_level":{
"log_info1":"XXX",
"log_info2":"XXX",
"log_info3":"XXX",
}
},
"case_number_2":{
"log_level":{
"log_info1":"XXX",
"log_info2":"XXX",
"log_info3":"XXX",
}
}
}
binding all the obtained test case logs and case numbers through the steps, and writing the test case logs and the case numbers into the JSON file to generate the resolvable format file.
Step 205, generating a test script according to the resolvable format file and a preset test script template;
the preset test script templates are test script templates of different types of switches in the same test scene. After the resolvable format file is obtained, the resolvable format file is resolved, data are read, and the data are written into a preset test script template to generate a test script.
In addition, for different types of switches, even if the same slave test cases are adopted in the preset test script templates, different test scripts are generated according to the types, but the test scripts have the same test content and are only different from the types of the switches used. Taking a server upgrade Maxwell (change data capture software) and Victoria (hard disk detection repair software) test as examples: and distinguishing Maxwell and Victoria by using the IP address, and writing corresponding upgrade images according to different IP addresses to generate different upgrade test scripts.
Step 206, after the test script is generated, generating test script notification information according to the test script;
after the test script is generated, test script notification information can be generated according to the information of the test script, and the test script notification information is used for notifying a tester to generate a new test script, and the tester can determine whether the newly generated test script is correct or whether a modified place exists through the test script notification information.
In addition, the switch test management terminal can be internally provided with a display component or externally connected with the display component; the test script notification information can be sent to the display component, the display component performs visual processing on the test script notification information, the test script notification information is displayed, and a tester can directly check the test script notification information through the display component.
Step 207, distributing the test script to a plurality of different types of switches to be tested in response to a confirmation operation for the test script notification information;
after checking the test script notification information, a tester can confirm the test script notification information; the confirmation operation includes, but is not limited to, a click operation, a voice confirmation instruction operation, a touch operation; those skilled in the art may set different confirmation operations according to actual requirements, which are not particularly limited.
The switch test management terminal can receive the confirmation operation aiming at the test script notification information, respond to the confirmation operation aiming at the test script notification information, and distribute corresponding test scripts to a plurality of different types of switches to be tested according to the characteristic of each switch mark so as to enable the plurality of different types of switches to be tested to test aiming at the same test scene.
Step 208, obtaining test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested;
after receiving the test script, the switch to be tested starts to execute the test script to test; in the process that each switch to be tested executes the test script to test, the switch test management terminal obtains the test log information generated by each switch to be tested from the storage address (interval) of each switch to be tested for storing the test log information, so as to determine whether an error occurs in the test process.
Step 209, screening the test log information according to the resolvable format file to generate error report log information;
after the test log information is obtained, whether the test log information related to the test log information is in error reporting is judged according to the resolvable format file, and the test log information is screened to generate the error reporting log information.
In an optional embodiment of the present invention, the filtering the test log information according to the resolvable format file to generate error log information may specifically include the following sub-steps:
sub-step S2091, comparing the resolvable format file with the test log information;
in practical applications, the test log information describes that the test is a test case used, and the resolvable format file also describes the test case. Therefore, the resolvable format file and the test log information can be compared, whether the test cases recorded in the resolvable format file are consistent with the test cases recorded in the test log information or not is compared, and the error identification exists in the test log information. Wherein, the error report mark can be characterized by adopting a specific field keyword. If a certain field is "0", it is the error reporting mark.
Sub-step S2092, when the test log information includes a fault report identifier that matches the resolvable format file, determines that the test log information is the fault report log information.
When the test cases recorded in the resolvable format file are compared with the test cases recorded in the test log information, and the test log information has error reporting identifiers, the test log information can be determined to comprise the error reporting identifiers matched with the resolvable format file, and at the moment, the test log information with the error reporting identifiers can be determined to be the error reporting log information.
Step 210, updating the switch defect library by adopting the error report log information;
and after the key information is extracted by adopting the error report log information screened after the test, the key information is tidied up and then the switch defect library is updated, so that the freshness and the flexibility of the switch defect library are maintained.
In an optional embodiment of the present invention, the updating the switch defect library using the error log information may specifically include the following sub-steps:
sub-step S2101, determining target error report log information according to the target keyword of the error report log information;
the error report log information records various information contents of error report, and the required target error report log information can be determined according to the target key words of the error report log information. For example, the target keyword is "error", and the error log information may be queried to record the log information corresponding to the "error" item as the target error log information.
Step S2102, converting the application number and the error application corresponding to the target error report log information into a file with an resolvable format to be updated according to a machine learning principle;
and converting the new target error report log into a resolvable file according to the case number and log information according to the principle of machine learning. Specifically, according to the existing switch defect library, the existing problem is obtained as a basic data preprocessing, an automatic test script is generated for the problem according to the existing template, a large number of repeated tests are carried out through the distribution rule, the generated test script is continuously trained, meanwhile, the test process (such as the time consumed by the test process) is recorded, according to the result of each test, the wrong use case number and the wrong use case are continuously optimized and determined, the test accuracy and efficiency are improved, after the preset expectations are reached (such as the accuracy reaches more than 99%, different expectations can be set in an expanding mode), the generated script is used as an ideal script to establish a new to-be-updated resolvable format file (when the difference between the newly generated script and the initial is too large, such as the difference is more than 60%, the number can also be modified by setting, the former template is gradually replaced as a new template),
Substep S2103, writing the resolvable format file to be updated into the switch defect library to complete the update of the switch defect library.
Writing the to-be-updated resolvable format file into a switch defect library, and storing the switch defect library according to a storage rule to complete updating of the switch defect library.
Step 211, receiving a test script template expansion instruction, wherein the test script template instruction comprises expansion data;
in the embodiment of the invention, when the preset test script template is required to be expanded, such as expanding a use case rule, dynamically adding and removing a switch to be tested and the like, a tester inputs a test script template expansion instruction to the switch test management terminal. And the switch test management terminal receives the test script template expansion instruction. The test script template instruction comprises expansion data; if the switch to be tested is dynamically increased, the expansion data comprises the operation of the switch to be tested and the switch identification corresponding to the increased switch to be tested.
And step 212, updating the preset test script template by using the expansion data.
And updating the preset test script template by using the expansion data, and generating a test script by using a new preset test script template after updating is completed, so that the flexibility of the test script template is improved.
The embodiment of the invention obtains the test log of the historical switch; constructing the switch defect library according to the historical switch test log; when the switch is tested, a test case log and a case number are obtained from a switch defect library; binding the test case log and the case number to generate a resolvable format file; generating a test script according to the resolvable format file and a preset test script template; after the test script is generated, generating test script notification information according to the test script; distributing the test script to a plurality of different types of switches to be tested in response to a confirmation operation for the test script notification information; acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested; screening the test log information according to the resolvable format file to generate error report log information; updating the switch defect library by adopting the error report log information; receiving a test script template expansion instruction, wherein the test script template instruction comprises expansion data; and updating the preset test script template by adopting the expansion data. According to the known problem types of different switches in the switch defect library, a test script is automatically generated and automatically executed, log information in the test process is compared and analyzed with the known problems, and an analysis result is updated to the switch defect library, so that the time for a tester to verify the known problems of one type of switch in other types of switches is saved, the newly discovered problems can be classified into the switch defect library through machine learning, the test efficiency and the flexibility of the switch defect library are improved, and the labor cost is reduced.
In order that those skilled in the art may better understand the embodiments of the present invention, the following description of the embodiments of the present invention is provided by way of example:
referring to fig. 3, a flowchart illustrating steps of an example of a switch test management method of the present invention is shown;
1. a defect library (switch defect library) of each type of switch is constructed.
2. The method comprises the steps that an automation platform (test management terminal) based on a defect library obtains case log information and case numbers of bug occurrence in the defect library, binds the case log information and the case numbers, writes the case log information and the case numbers into an resolvable file format, and sets test script templates of the same type of test scene of different types of switches in a system. The Maxwell and Victoria are distinguished by IP, and different upgrade images are written according to different IP addresses, specifically:
{
"ip":"XXX"
{
"target":"bios",
"imagepath":"XXX.inspur",
"isupdate":"1",
}
}
and generating test scripts and distributing the test scripts to the switches to be tested.
Wherein, referring to fig. 4, a script generation schematic diagram of an example of a switch test management method is shown;
acquiring case log information and case numbers from a defect library, binding the case log information and the case numbers, acquiring a log analysis result, and determining newly added case log information and case numbers; and writing all the case log information and the case numbers into a resolvable format file which is in JSON, HTML and other formats. The data in the parseable format file is then input into rules and code templates in the test script template to output the test script.
3. And (5) collecting logs.
Comparing the generated resolvable JSON file with a log collected in the test process, screening out the log appearing in the test log if the collected log has log information of error reporting of the JSON file, and notifying a tester.
4. Log analysis and backfilling the results.
And collecting the new error report log according to the key words of the error log mark in the collected log, converting the new error report log and log information into a resolvable file according to the use case number according to the principle of machine learning, writing the resolvable file into a defect library, and updating the resolvable file into a resolvable JSON file for retesting.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 5, there is shown a block diagram of an embodiment of a switch test management device of the present invention, which may specifically include the following modules:
a first obtaining module 501, configured to obtain a test case log and a case number from a switch defect library when performing a switch test;
a binding module 502, configured to bind the test case log and the case number, and generate a resolvable format file;
the test distribution module 503 is configured to generate a test script according to the resolvable format file and a preset test script template, and distribute the test script to a plurality of different types of switches to be tested;
a second obtaining module 504, configured to obtain test log information generated by the switch to be tested in a process of executing the test script by the switch to be tested;
the screening module 505 is configured to screen the test log information according to the resolvable format file, and generate error report log information;
a first updating module 506, configured to update the switch defect library using the error log information.
In an alternative embodiment of the invention, the apparatus further comprises:
the receiving module is used for receiving a test script template expansion instruction, wherein the test script template instruction comprises expansion data;
And the second updating module is used for updating the preset test script template by adopting the expansion data.
In an alternative embodiment of the invention, the apparatus further comprises:
the test script notification information generation module is used for generating test script notification information according to the test script after generating the test script;
and the response module is used for responding to the confirmation operation aiming at the test script notification information and executing the step of distributing the test script to a plurality of different types of switches to be tested.
In an alternative embodiment of the invention, the apparatus further comprises:
the third acquisition module is used for acquiring a historical switch test log;
and the construction module is used for constructing the switch defect library according to the historical switch test log.
In an alternative embodiment of the present invention, the binding module 502 includes:
a case number determination submodule for determining the case number;
the association sub-module is used for associating the test case log with the case number;
and the writing sub-module is used for writing the related test case log and the case number into a preset resolvable format data set to generate the resolvable format file.
In an alternative embodiment of the present invention, the filtering module 505 includes:
the comparison sub-module is used for comparing the resolvable format file with the test log information;
and the screening sub-module is used for determining the test log information as the error reporting log information when the test log information comprises the error reporting mark matched with the resolvable format file.
In an alternative embodiment of the present invention, the first updating module 506 includes:
the target error report log information determining sub-module is used for determining target error report log information according to the target keyword of the error report log information;
the conversion sub-module is used for converting the application number and the error application corresponding to the target error report log information into a file with an analytic format to be updated according to the principle of machine learning;
and the updating sub-module is used for writing the to-be-updated resolvable format file into the switch defect library so as to complete the updating of the switch defect library.
According to the embodiment of the invention, the test script is generated according to the known problem types of different switches in the switch defect library, and is distributed to the switch to be tested for execution, the log information in the test process is compared and analyzed with the known problems, and the analysis result is updated to the defect library, so that the time for verifying the known problems of one switch in other types of switches by a tester is saved, and the test efficiency is improved; and the newly found problems are classified into a switch defect library, the switch defect library is updated, and the flexibility of the switch defect library is improved.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention also provides electronic equipment, which comprises:
a processor 601 and a storage medium 602, said storage medium 602 storing a computer program executable by said processor 601, said processor 601 executing said computer program when the electronic device is running to perform a switch test management method according to any one of the embodiments of the present invention. The specific implementation manner and technical effects are partially similar to those of the method embodiment, and are not repeated here.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
The embodiment of the present invention further provides a computer readable storage medium 701, where the storage medium 701 stores a computer program, and when the computer program is executed by a processor, the method for managing switch test according to any one of the embodiments of the present invention is executed. The specific implementation manner and technical effects are partially similar to those of the method embodiment, and are not repeated here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing has described in detail the method, apparatus, electronic device and storage medium for testing and managing switches, and specific examples have been used herein to illustrate the principles and embodiments of the present invention, and the above description of the examples is only for aiding in understanding the method and core idea of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (10)

1. A method for testing and managing a switch, comprising:
when the switch is tested, a test case log and a case number are obtained from a switch defect library;
binding the test case log and the case number to generate a resolvable format file;
generating a test script according to the resolvable format file and a preset test script template, and distributing the test script to a plurality of different types of switches to be tested;
acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested;
Screening the test log information according to the resolvable format file to generate error report log information;
and updating the switch defect library by adopting the error report log information.
2. The method according to claim 1, wherein the method further comprises:
receiving a test script template expansion instruction, wherein the test script template instruction comprises expansion data;
and updating the preset test script template by adopting the expansion data.
3. The method according to claim 1, wherein the method further comprises:
after the test script is generated, generating test script notification information according to the test script;
and responding to the confirmation operation aiming at the notification information of the test script, and executing the step of distributing the test script to a plurality of different types of switches to be tested.
4. The method according to claim 1, wherein the method further comprises:
acquiring a historical switch test log;
and constructing the switch defect library according to the historical switch test log.
5. The method of any of claims 1-4, wherein the binding the test case log and the case number to generate a resolvable format file comprises:
Determining the case number;
associating the test case log with the case number;
writing the related test case log and the case number into a preset resolvable format data set to generate the resolvable format file.
6. The method of any of claims 1-4, wherein the filtering the test log information according to the resolvable format file to generate error log information comprises:
comparing the resolvable format file with the test log information;
and when the test log information comprises an error reporting mark matched with the resolvable format file, determining the test log information as the error reporting log information.
7. The method of any of claims 1-4, wherein said updating the switch defect library with the error log information comprises:
determining target error report log information according to the target keyword of the error report log information;
converting the application number and the error application corresponding to the target error report log information into a file with an resolvable format to be updated according to a machine learning principle;
and writing the to-be-updated resolvable format file into the switch defect library to finish updating the switch defect library.
8. A switch test management apparatus, comprising:
the first acquisition module is used for acquiring a test case log and a case number from a switch defect library when a switch test is performed;
the binding module is used for binding the test case log and the case number and generating a resolvable format file;
the test distribution module is used for generating a test script according to the resolvable format file and a preset test script template and distributing the test script to a plurality of different types of switches to be tested;
the second acquisition module is used for acquiring test log information generated by the switch to be tested in the process of executing the test script by the switch to be tested;
the screening module is used for screening the test log information according to the resolvable format file and generating error report log information;
and the first updating module is used for updating the switch defect library by adopting the error report log information.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor implements the steps of the switch test management method according to any one of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the switch test management method according to any of claims 1 to 7.
CN202211634511.XA 2022-12-19 2022-12-19 Switch test management method and device, electronic equipment and storage medium Pending CN116016270A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211634511.XA CN116016270A (en) 2022-12-19 2022-12-19 Switch test management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211634511.XA CN116016270A (en) 2022-12-19 2022-12-19 Switch test management method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116016270A true CN116016270A (en) 2023-04-25

Family

ID=86027554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211634511.XA Pending CN116016270A (en) 2022-12-19 2022-12-19 Switch test management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116016270A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117370216A (en) * 2023-12-08 2024-01-09 天津华来科技股份有限公司 Callback interface performance test method based on python language

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117370216A (en) * 2023-12-08 2024-01-09 天津华来科技股份有限公司 Callback interface performance test method based on python language

Similar Documents

Publication Publication Date Title
CN110928772B (en) Test method and device
CN107665171B (en) Automatic regression testing method and device
CN108628748B (en) Automatic test management method and automatic test management system
US11436133B2 (en) Comparable user interface object identifications
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN112241370B (en) API interface class checking method, system and device
CN113568839A (en) Method, device, equipment and medium for software testing and statistical test coverage rate
CN112540924A (en) Interface automation test method, device, equipment and storage medium
CN111552632A (en) Interface testing method and device
CN103649924A (en) Embedded apparatus, program generation apparatus, and program
CN116016270A (en) Switch test management method and device, electronic equipment and storage medium
CN115658452A (en) Buried point checking method, buried point checking device, readable storage medium and electronic equipment
CN113535538B (en) Method, device, electronic equipment and storage medium for automatically testing application full link
Nietzio et al. The unified Web evaluation methodology (UWEM) 1.2 for WCAG 1.0
WO2016190869A1 (en) Determining potential test actions
CN116866242A (en) Switch regression testing method, device and medium
CN111552648A (en) Automatic verification method and system for application
CN108829590B (en) Software testing method, device and system
CN111143724A (en) Data processing method, device, equipment and medium
CN115599683A (en) Automatic testing method, device, equipment and storage medium
CN115309661A (en) Application testing method and device, electronic equipment and readable storage medium
CN115454702A (en) Log fault analysis method and device, storage medium and electronic equipment
GB2397905A (en) Method for automatically generating and ordering test scripts
CN111008150A (en) Test report generation method, device and equipment
CN111506339A (en) Method and device for processing change information of Software Development Kit (SDK)

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