CN114448848B - Switch testing method and device, electronic equipment and storage medium - Google Patents

Switch testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114448848B
CN114448848B CN202111542788.5A CN202111542788A CN114448848B CN 114448848 B CN114448848 B CN 114448848B CN 202111542788 A CN202111542788 A CN 202111542788A CN 114448848 B CN114448848 B CN 114448848B
Authority
CN
China
Prior art keywords
test
target
switch
target test
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111542788.5A
Other languages
Chinese (zh)
Other versions
CN114448848A (en
Inventor
徐亚洲
高磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202111542788.5A priority Critical patent/CN114448848B/en
Publication of CN114448848A publication Critical patent/CN114448848A/en
Application granted granted Critical
Publication of CN114448848B publication Critical patent/CN114448848B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • H04L43/065Generation of reports related to network devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q1/00Details of selecting apparatus or arrangements
    • H04Q1/02Constructional details
    • H04Q1/10Exchange station construction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q1/00Details of selecting apparatus or arrangements
    • H04Q1/18Electrical details
    • H04Q1/20Testing circuits or apparatus; Circuits or apparatus for detecting, indicating, or signalling faults or troubles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The application discloses a testing method and device of a switch, electronic equipment and a storage medium. The method comprises the following steps: receiving a switch test request, wherein the switch test request carries at least one target input parameter; determining target test contents corresponding to the target input parameters based on the corresponding relation between the preset parameters and the test contents; acquiring target test data corresponding to target test content; and testing the switch to be tested based on the target test data to obtain a test result corresponding to the switch to be tested. According to the embodiment of the application, the target test content is directly determined according to the target input content input by the user, then the target test data corresponding to the target test content is obtained, and the switch to be tested is tested by using the target test data, so that the switch is tested by automatically calling the test data based on the input parameters, the secondary development by a tester according to the test scene and the requirement is not required, and the test efficiency is improved.

Description

Switch testing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of switch testing technologies, and in particular, to a method and apparatus for testing a switch, an electronic device, and a storage medium.
Background
In the production and research and development test of the switch, the function test needs to be carried out on the whole machine to verify whether all hardware links, firmware and the like are normal. Depending on the test requirements, the developer needs to provide a series of test tools and instruction documents and pass them to the testers and production workers.
At present, when the function test is carried out on the whole machine of the switch, a tester relies on research and development to output a test tool and an application manual, then the tester carries out secondary development according to a test scene and requirements, writes a test script, calls the test tool, and completes the test of the whole machine.
In the current whole function test mode of the switch, the inventor finds that a tester needs to understand the use of a test tool and write a test script for testing, so that the labor cost and the communication cost are increased.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the application provides a testing method and device of a switch, electronic equipment and a storage medium.
According to an aspect of an embodiment of the present application, there is provided a method for testing a switch, including:
receiving a switch test request, wherein the switch test request carries at least one target input parameter;
determining target test contents corresponding to the target input parameters based on the corresponding relation between the preset parameters and the test contents;
acquiring target test data corresponding to the target test content;
And testing the switch to be tested based on the target test data to obtain a test result corresponding to the switch to be tested.
Further, the obtaining the target test data corresponding to the target test content includes:
Under the condition that the target test content comprises test duration and partial functions or all functions, determining the test cases corresponding to the partial functions or all functions as target test cases;
And taking the target test case and the test duration as the target test data.
Further, the obtaining the target test data corresponding to the target test content includes:
Under the condition that the target test content comprises test duration and file identification, acquiring a target configuration file according to the file identification;
Analyzing the target configuration file to obtain a target test case;
And taking the target test case and the test duration as the target test data.
Further, before the switch to be tested is tested based on the target test data to obtain a test result corresponding to the switch to be tested, the method further includes:
Detecting an update operation acting on the target test data;
under the condition that the updating operation is detected, acquiring a new test case;
and filling the new test cases into the target test cases in the target test data to obtain updated target test cases.
Further, under the condition that the update operation is detected, acquiring a new test case includes:
Under the condition that the updating operation is detected, acquiring an initial test case template;
detecting editing operation acting on the initial test case template;
And under the condition that the editing operation is detected, generating the new test case based on the edited initial test case template.
Further, the testing the switch to be tested based on the target test data to obtain a test result corresponding to the switch to be tested includes:
extracting test duration from the target test data;
and testing the switch to be tested by using the updated target test cases within the test duration to obtain the test result, wherein the test result is generated according to the subtest result corresponding to each test case in the updated target test cases.
Further, after the switch to be tested is tested based on the target test data to obtain a test result corresponding to the switch to be tested, the method further includes:
receiving a report generation request, wherein the report generation request carries at least one test report template;
writing the test result into the test report template to generate a test report;
And outputting the test report.
According to still another aspect of the embodiment of the present application, there is also provided a test apparatus for a switch, including:
The receiving module is used for receiving a switch test request, wherein the switch test request carries at least one target input parameter;
the determining module is used for determining target test contents corresponding to the target input parameters based on the corresponding relation between the preset parameters and the test contents;
the acquisition module is used for acquiring target test data corresponding to the target test content;
And the execution module is used for testing the switch to be tested based on the target test data to obtain a test result corresponding to the switch to be tested.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that performs the above steps when running.
According to another aspect of the embodiment of the present application, there is also provided an electronic device including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; and a processor for executing the steps of the method by running a program stored on the memory.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the above method.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the embodiment of the application, the target test content is directly determined according to the target input content input by the user, then the target test data corresponding to the target test content is obtained, and the switch to be tested is tested by using the target test data, so that the switch is tested by automatically calling the test data based on the input parameters, the secondary development by a tester according to the test scene and the requirement is not required, and the test efficiency is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flowchart of a testing method of a switch according to an embodiment of the present application;
fig. 2 is a flowchart of a testing method of a switch according to another embodiment of the present application;
fig. 3 is a block diagram of a testing device of a switch according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments, illustrative embodiments of the present application and descriptions thereof are used to explain the present application and do not constitute undue limitations of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another similar 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 apparatus 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 apparatus. 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 apparatus that comprises the element.
The embodiment of the application provides a testing method and device of a switch, electronic equipment and a storage medium. The method provided by the embodiment of the application can be applied to any needed electronic equipment, for example, the electronic equipment can be a server, a terminal and the like, is not particularly limited, and is convenient to describe and is called as the electronic equipment for short hereinafter.
According to an aspect of the embodiment of the application, a method embodiment of a testing method of a switch is provided. Fig. 1 is a flowchart of a testing method of a switch according to an embodiment of the present application, as shown in fig. 1, where the method includes:
step S11, receiving a switch test request, wherein the switch test request carries at least one target input parameter.
The testing method provided by the embodiment of the application is applied to the testing equipment, when the requirement for testing the switch exists, a user firstly writes the target input parameters in the testing equipment and triggers the switch testing request, and at the moment, the testing equipment can receive the switch testing request.
Step S12, determining target test contents corresponding to the target input parameters based on the corresponding relation between the preset parameters and the test contents.
In the embodiment of the application, after receiving the switch test request, the corresponding relation between the preset parameter and the test content is called, and the target test content corresponding to the target input parameter is inquired based on the corresponding relation.
As one example: and when the target input parameter is S, testing the single function of the switch by the corresponding target test content. When the target input parameter is T, the corresponding target test content is the test duration. And when the target input parameter is A, testing all functions of the switch by corresponding target test content. And when the target input parameter is F, testing the switch according to a preset configuration file by corresponding target test content.
Step S13, obtaining target test data corresponding to the target test content.
In the embodiment of the present application, step S13, obtaining target test data corresponding to target test content, includes the following steps A1-A2:
And step A1, determining the test cases corresponding to part of functions or all functions as target test cases under the condition that the target test content comprises test duration and part of functions or all functions.
In the embodiment of the application, determining the target test content according to the target input parameter comprises the following steps: under the conditions of test duration and partial or all functions, the test equipment directly acquires target test cases corresponding to the partial or all functions from the test case set.
In the embodiment of the present application, the test cases included in the test case set may be: exchanging chip flow test cases, CPU pressure test cases, power supply module test cases, fan test cases, optical module test case editing, FRU test cases and the like.
And step A2, taking the target test case and the test duration as target test data.
In the embodiment of the application, after the target test case for executing the switch test is determined, the target test case and the test duration are used as target test data, and the target test data are used for testing the switch to be tested.
In the embodiment of the present application, step S13, obtaining target test data corresponding to target test content, includes the following steps B1-B3:
and B1, under the condition that the target test content comprises the test duration and the file identification, acquiring a target configuration file according to the file identification.
In the embodiment of the application, determining the target test content according to the target input parameter comprises the following steps: under the conditions of test duration and file identification, the test equipment directly obtains a target configuration file according to the file identification, wherein the target configuration file can be uploaded to the test equipment in advance by a developer and comprises a plurality of test cases.
And step B2, analyzing the target configuration file to obtain a target test case.
In the embodiment of the application, after the test file determines the target configuration file, the target configuration file is analyzed to obtain the test case carried in the target configuration file, and the test case is determined as the target test case.
And step B3, taking the target test case and the test duration as target test data.
In the embodiment of the application, after the target test case for executing the switch test is determined, the target test case and the test duration are used as target test data, and the target test data are used for testing the switch to be tested.
And step S14, testing the switch to be tested based on the target test data to obtain a test result corresponding to the switch to be tested.
In the embodiment of the application, before the switch to be tested is tested based on the target test data to obtain the test result corresponding to the switch to be tested, the method further comprises the following steps C1-C3:
Step C1, detecting an updating operation acting on the target test data.
In the embodiment of the application, after the target test data is determined, the test equipment displays the target test data, and at this time, the test equipment detects whether an update operation acting on the target test data exists. It should be noted that, the update operation may be initiated by the user to the test device, and when the user needs to update the target test case in the target test data, the update operation may be initiated to the test device. Specifically, the embodiment of the application provides a method for detecting an update operation: firstly, detecting clicking operation acting on target test data, detecting the corresponding time length of the clicking operation, displaying an operation list if the time length is greater than or equal to a preset time length, detecting selected operation acting on the operation list at the moment, determining that the selected operation item is an updated operation item according to the selected operation, receiving an operation password associated with the updated operation item, and determining that the updated operation acting on the target test data exists currently if the operation password is matched with the preset operation password.
It should be noted that, the operation password may be a character string corresponding to each operation item preset by a worker, and by setting the operation password, the probability of random tampering of the test case in the target test data can be reduced, and the effectiveness of the subsequent switch test is effectively ensured.
In order to ensure the validity of a preset test case, the embodiment of the application sets a flow for detecting the updating operation, firstly determines whether a user needs to update target test data or not through the time length, if the time length is greater than the preset time length, displays an operation list to the user, determines an operation item selected by the user through detecting the selected operation of the user on the operation list, acquires an operation password input by the user if the selected operation item is the updating operation item, matches the operation instruction with the preset operation instruction, and finally determines whether to update the target test data or not.
And step C2, under the condition that the updating operation is detected, acquiring a new test case.
In the embodiment of the present application, step C2, in the case of detecting an update operation, acquires a new test case, includes the following steps C201 to C203:
step C201, under the condition that the updating operation is detected, acquiring an initial test case template.
In the embodiment of the application, under the condition that the test equipment determines that the update operation exists, the test equipment can call an initial test case template, wherein the initial test case template is a general test case template stored in the test equipment.
Step C202, detecting editing operation acting on the initial test case template.
In the embodiment of the application, after the test equipment calls the initial test case template, the initial test case template is displayed, and then whether editing operation acting on the initial test case template exists is detected.
In the embodiment of the application, the editing operation process of detecting the initial test case template is as follows: detecting whether a selected operation acting on the initial test case template exists or not, if so, detecting the selected position of the selected operation in the initial test case template, and if so, determining that an editing operation acting on the initial test case template exists. If the selected position is not matched with the preset position, determining that the editing operation of the initial test case template does not exist.
And step C203, generating a new test case based on the edited initial test case template under the condition that the editing operation is detected.
In the embodiment of the application, under the condition that the editing operation is detected, the editing progress corresponding to the initial test case template is detected, and under the condition that the editing is determined to be completed according to the editing progress, a new test case is generated based on the edited initial test case template.
And step C3, filling the new test cases into the target test cases in the target test data to obtain updated target test cases.
In the embodiment of the application, after the new test case is obtained, the new test case is filled into the target test case in the target test data, and the updated target test case is obtained.
As one example, the target test cases in the target test data include: exchanging chip flow test cases, CPU pressure test cases, power supply module test cases and fan test cases, wherein the new test cases comprise: the optical module test case is edited and the FRU test case is edited. The updated target test case includes: exchanging chip flow test cases, CPU pressure test cases, power supply module test cases and fan test cases, and editing optical module test cases and FRU test cases.
In the embodiment of the present application, step S14, testing the switch to be tested based on the target test data, to obtain a test result corresponding to the switch to be tested, includes the following steps D1-D2:
and D1, extracting the test duration from the target test data.
In the embodiment of the application, the target test data comprises the test duration and the target test case, so the test duration can be directly extracted from the target test data.
And D2, testing the switch to be tested by using the updated target test cases within the test duration to obtain test results, wherein the test results are generated according to the subtest results corresponding to each test case in the updated target test cases.
In the embodiment of the application, the switch to be tested is tested by using the updated target test case within the test duration, and because the updated target test case comprises a plurality of independent test cases, each test case is used for testing the switch, a sub-test result can be obtained, and then all the sub-test results are summarized to obtain a final test result.
According to the embodiment of the application, the target test content is directly determined according to the target input content input by the user, then the target test data corresponding to the target test content is obtained, and the switch to be tested is tested by using the target test data, so that the switch is tested by automatically calling the test data based on the input parameters, the secondary development by a tester according to the test scene and the requirement is not required, and the test efficiency is improved.
In the embodiment of the present application, fig. 2 is a flowchart of a testing method of a switch provided in the embodiment of the present application, as shown in fig. 2, after testing a switch to be tested based on target test data to obtain a test result corresponding to the switch to be tested, the method further includes:
step S21, receiving a report generation request, wherein the report generation request carries at least one test report template.
In the embodiment of the application, after the test equipment finishes the test of the exchange to be tested by calling the target test data, the report generation request triggered by the user can be received. Specifically, whether the user clicks the report output button is detected, if the user clicks the report output button, at this time, it is determined that an initial report generation request is generated, a plurality of candidate test report templates are displayed, whether a selected operation acting on the plurality of candidate test report templates exists is detected, and the selected test report template is determined according to the selected operation. A final report generation request is then generated based on the test report template.
And S22, writing the test result into a test report template to generate a test report.
Step S23, outputting a test report.
In the embodiment of the application, the test equipment writes the obtained test result into the test report template according to the report generation request, generates the final test report, and outputs the generated test report, wherein the test report can be displayed or sent to the appointed client according to the preset file format.
The method provided by the embodiment of the application can modify the test cases according to the test requirements, and the test contents are specified in the form of input parameters, so that the multi-scenario test requirements are met; the cost of secondary development is reduced, the test efficiency is improved, and in addition, the test report template is selectable and supports multi-type report export.
Fig. 3 is a block diagram of a testing apparatus for a switch according to an embodiment of the present application, where the testing apparatus may be implemented as part or all of an electronic device by software, hardware, or a combination of both. As shown in fig. 3, the apparatus includes:
and the receiving module 31 is configured to receive a switch test request, where the switch test request carries at least one target input parameter.
The determining module 32 is configured to determine target test contents corresponding to the target input parameters based on a correspondence between preset parameters and the test contents.
The acquiring module 33 is configured to acquire target test data corresponding to the target test content.
And the execution module 34 is configured to test the switch to be tested based on the target test data, so as to obtain a test result corresponding to the switch to be tested.
In the embodiment of the application, the acquisition module is used for determining the test cases corresponding to part of functions or all functions as target test cases when the target test content comprises the test duration and the part of functions or all functions; and taking the target test case and the test duration as target test data.
In the embodiment of the application, the acquisition module is used for acquiring the target configuration file according to the file identifier under the condition that the target test content comprises the test duration and the file identifier; analyzing the target configuration file to obtain a target test case; and taking the target test case and the test duration as target test data.
In an embodiment of the present application, the test device of the switch further includes a detection module, where the detection module includes:
An execution unit for detecting an update operation acting on the target test data;
the acquisition unit is used for acquiring a new test case under the condition that the updating operation is detected;
and the processing unit is used for filling the new test cases into the target test cases in the target test data to obtain updated target test cases.
In the embodiment of the application, an acquisition unit is used for acquiring an initial test case template under the condition that an updating operation is detected; detecting editing operation acting on an initial test case template; and under the condition that the editing operation is detected, generating a new test case based on the edited initial test case template.
In the embodiment of the application, the execution module is used for extracting the test duration from the target test data; and testing the switch to be tested by using the updated target test cases within the test duration to obtain test results, wherein the test results are generated according to the subtest results corresponding to each test case in the updated target test cases.
In the embodiment of the application, the test device of the switch further comprises a report generating module, which is used for receiving a report generating request, wherein the report generating request carries at least one test report template; writing the test result into a test report template to generate a test report; and outputting a test report.
The method provided by the embodiment of the application can modify the test cases according to the test requirements, and the test contents are specified in the form of input parameters, so that the multi-scenario test requirements are met; the cost of secondary development is reduced, the test efficiency is improved, and in addition, the test report template is selectable and supports multi-type report export.
The embodiment of the application also provides an electronic device, as shown in fig. 4, the electronic device may include: the device comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 are in communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501, when executing the computer program stored in the memory 1503, implements the steps of the above embodiments.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or may include 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, abbreviated as CPU), a network processor (Network Processor, abbreviated as NP), etc.; but may also be a digital signal processor (DIGITAL SIGNAL Processing, DSP), application Specific Integrated Circuit (ASIC), field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present application, a computer readable storage medium is provided, in which instructions are stored, which when run on a computer, cause the computer to perform the method for testing a switch according to any of the above embodiments.
In yet another embodiment of the present application, a computer program product containing instructions that, when run on a computer, cause the computer to perform the method of testing a switch as described in any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK), etc.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
The foregoing is only a specific embodiment of the application to enable those skilled in the art to understand or practice the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for testing a switch, comprising:
Receiving a switch test request, wherein the switch test request carries at least one target input parameter, and the target input parameter is used for identifying test contents;
determining target test contents corresponding to the target input parameters based on the corresponding relation between the preset parameters and the test contents, wherein the test contents comprise: testing duration, partial functions or all functions, and file identification;
obtaining target test data corresponding to the target test content, wherein the target test data comprises: test duration and test cases;
Testing the switch to be tested based on the target test data to obtain a test result corresponding to the switch to be tested;
Before the switch to be tested is tested based on the target test data to obtain a test result corresponding to the switch to be tested, the method further comprises the following steps:
Detecting an update operation acting on the target test data;
under the condition that the updating operation is detected, acquiring a new test case;
Filling the new test cases into the target test cases in the target test data to obtain updated target test cases;
The step of testing the switch to be tested based on the target test data to obtain a test result corresponding to the switch to be tested comprises the following steps:
extracting test duration from the target test data;
and testing the switch to be tested by using the updated target test cases within the test duration to obtain the test result, wherein the test result is generated according to the subtest result corresponding to each test case in the updated target test cases.
2. The method according to claim 1, wherein the obtaining the target test data corresponding to the target test content includes:
Under the condition that the target test content comprises test duration and partial functions or all functions, determining the test cases corresponding to the partial functions or all functions as target test cases;
And taking the target test case and the test duration as the target test data.
3. The method according to claim 1, wherein the obtaining the target test data corresponding to the target test content includes:
Under the condition that the target test content comprises test duration and file identification, acquiring a target configuration file according to the file identification;
Analyzing the target configuration file to obtain a target test case;
And taking the target test case and the test duration as the target test data.
4. The method of claim 1, wherein the obtaining the new test case if the update operation is detected comprises:
Under the condition that the updating operation is detected, acquiring an initial test case template;
detecting editing operation acting on the initial test case template;
And under the condition that the editing operation is detected, generating the new test case based on the edited initial test case template.
5. The method according to claim 1, wherein after testing the switch under test based on the target test data, to obtain a test result corresponding to the switch under test, the method further comprises:
receiving a report generation request, wherein the report generation request carries at least one test report template;
writing the test result into the test report template to generate a test report;
And outputting the test report.
6. A test apparatus for a switch, comprising:
The system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a switch test request, wherein the switch test request carries at least one target input parameter, and the target input parameter is used for identifying test contents;
the determining module is configured to determine target test content corresponding to the target input parameter based on a correspondence between a preset parameter and the test content, where the test content includes: testing duration, partial functions or all functions, and file identification;
the acquisition module is used for acquiring target test data corresponding to the target test content, wherein the target test data comprises: test duration and test cases;
The execution module is used for testing the switch to be tested based on the target test data to obtain a test result corresponding to the switch to be tested;
The apparatus further comprises: a detection module, the detection module comprising:
An execution unit for detecting an update operation acting on the target test data;
the acquisition unit is used for acquiring a new test case under the condition that the updating operation is detected;
the processing unit is used for filling the new test cases into the target test cases in the target test data to obtain updated target test cases;
The execution module is used for extracting test duration from the target test data; and testing the switch to be tested by using the updated target test cases within the test duration to obtain the test result, wherein the test result is generated according to the subtest result corresponding to each test case in the updated target test cases.
7. A storage medium comprising a stored program, wherein the program when run performs the method of any one of the preceding claims 1 to 5.
8. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; wherein:
A memory for storing a computer program;
A processor for performing the method of any of claims 1-5 by running a program stored on a memory.
CN202111542788.5A 2021-12-16 2021-12-16 Switch testing method and device, electronic equipment and storage medium Active CN114448848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111542788.5A CN114448848B (en) 2021-12-16 2021-12-16 Switch testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111542788.5A CN114448848B (en) 2021-12-16 2021-12-16 Switch testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114448848A CN114448848A (en) 2022-05-06
CN114448848B true CN114448848B (en) 2024-06-07

Family

ID=81364712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111542788.5A Active CN114448848B (en) 2021-12-16 2021-12-16 Switch testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114448848B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068926A (en) * 2015-08-04 2015-11-18 腾讯科技(深圳)有限公司 Program test method and device thereof
CN107066391A (en) * 2017-05-09 2017-08-18 武汉联影医疗科技有限公司 The processing method and system of test case
WO2017197925A1 (en) * 2016-05-19 2017-11-23 中兴通讯股份有限公司 Method and device for testing traffic pressure
CN107832226A (en) * 2017-11-23 2018-03-23 中国平安人寿保险股份有限公司 Report-generating method, device, equipment and computer media based on performance test
CN107908543A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Applied program testing method, device, computer equipment and storage medium
CN108268348A (en) * 2017-12-08 2018-07-10 广州视源电子科技股份有限公司 Interface testing method and device, mobile terminal and storage medium
CN110134583A (en) * 2019-04-11 2019-08-16 口碑(上海)信息技术有限公司 Software test and data processing method and device
CN110851308A (en) * 2019-10-21 2020-02-28 香港乐蜜有限公司 Test method, test device, electronic equipment and storage medium
CN111475401A (en) * 2020-03-19 2020-07-31 平安国际智慧城市科技股份有限公司 Test method and related equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8370809B2 (en) * 2010-03-18 2013-02-05 Salesforce.Com, Inc. System, method and computer program product for automated test case generation and scheduling
US9529699B2 (en) * 2013-06-11 2016-12-27 Wipro Limited System and method for test data generation and optimization for data driven testing

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068926A (en) * 2015-08-04 2015-11-18 腾讯科技(深圳)有限公司 Program test method and device thereof
WO2017197925A1 (en) * 2016-05-19 2017-11-23 中兴通讯股份有限公司 Method and device for testing traffic pressure
CN107066391A (en) * 2017-05-09 2017-08-18 武汉联影医疗科技有限公司 The processing method and system of test case
CN107908543A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Applied program testing method, device, computer equipment and storage medium
CN107832226A (en) * 2017-11-23 2018-03-23 中国平安人寿保险股份有限公司 Report-generating method, device, equipment and computer media based on performance test
CN108268348A (en) * 2017-12-08 2018-07-10 广州视源电子科技股份有限公司 Interface testing method and device, mobile terminal and storage medium
CN110134583A (en) * 2019-04-11 2019-08-16 口碑(上海)信息技术有限公司 Software test and data processing method and device
CN110851308A (en) * 2019-10-21 2020-02-28 香港乐蜜有限公司 Test method, test device, electronic equipment and storage medium
CN111475401A (en) * 2020-03-19 2020-07-31 平安国际智慧城市科技股份有限公司 Test method and related equipment

Also Published As

Publication number Publication date
CN114448848A (en) 2022-05-06

Similar Documents

Publication Publication Date Title
CN107844421B (en) Interface testing method and device, computer equipment and storage medium
CN107766190B (en) Interface testing method and device, computer equipment and storage medium
CN107193750B (en) Script recording method and device
CN107562610B (en) Method, device, terminal and medium for acquiring page loading time
CN111045952B (en) Software testing method, flow playback device, terminal equipment and readable storage medium
CN110688300A (en) Compatibility testing method, device, equipment and storage medium
CN111611172A (en) Project test defect analysis method, device, equipment and storage medium
CN105022694A (en) Test case generation method and system for mobile terminal test
CN106557419B (en) Program testing method and device
CN110806965A (en) Automatic test method, device, equipment and medium
CN105117340B (en) URL detection methods and device for iOS browser application quality evaluations
CN112882933A (en) Script recording method, device, equipment and storage medium
CN110704311A (en) Application program testing method and device, electronic equipment and readable storage medium
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN110888799B (en) Software testing method and device
CN114448848B (en) Switch testing method and device, electronic equipment and storage medium
CN111008058A (en) Page display method and device
CN108563578B (en) SDK compatibility detection method, device, equipment and readable storage medium
CN113360366A (en) Web page testing method, testing device, electronic equipment and storage medium
CN109144841B (en) Method and device for identifying advertisement application, computer equipment and storage medium
CN113672497B (en) Method, device and equipment for generating non-buried point event and storage medium
CN110532186B (en) Method, device, electronic equipment and storage medium for testing by using verification code
CN113094277A (en) Chip test case management method and device
CN112948259A (en) Application testing method and device, electronic equipment and storage medium
CN114860549B (en) Buried data verification method, buried data verification device, buried data verification equipment and storage medium

Legal Events

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