A switch automatic testing method and device

Through the combination of tree data structure and Jenkins API, automated switch test case sets and task construction are solved, and the operation complexity and manual error of Jenkins tool is realized, efficient and low-cost automatic switch testing is achieved, reducing learning costs and improving Test efficiency.

CN113485928BActive Publication Date: 2024-11-08INSPUR NETWORK TECH (SHANDONG) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202110780078.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-09
Publication Date
2024-11-08
Estimated Expiration
2041-07-09

AI Technical Summary

Technical Problem

Testing switches with Jenkins tools increases operator learning costs and reduces software testing quality, and relies on manual creation of tasks and scripting to risk errors.

Method used

The switch function module is assembled using a tree data structure, the test case set is automatically determined through recursive algorithms, and the test task is automatically built using the Jenkins API to obtain and display the test task status in real time, reducing the risk of manual operations and errors.

Benefits of technology

Without manually building test tasks and writing scripts, the automated test platform reduces user learning costs and operational complexity, improves testing efficiency, and displays test status in real time for easy management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113485928B_ABST
    Figure CN113485928B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a switch automated testing method and device, the method comprising: determining a switch test case set in response to received switch test parameters; obtaining the switch software version to be tested based on the switch software version path; constructing a Jenkins test task based on the test case set and the switch software version; obtaining the status information of the Jenkins test task in real time and displaying it on the front-end interface in real time. The technical problem that directly using the Jenkins tool to test the switch will increase the learning cost of the operator and reduce the quality of software testing is solved. The threshold for platform users can be lowered and the learning cost of platform users can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing, and in particular to a switch automation testing method and device. Background Art

[0002] Software testing is a process of operating a program under specified conditions to discover program errors, measure software quality, and evaluate whether it meets design requirements. In some large-scale software development processes, testing activities require a lot of time and cost. If manual testing is used, the efficiency of testing is very low. Testing tools can perform part of the test design, implementation, execution and comparison work. By using testing tools, the purpose of improving testing efficiency can be achieved.

[0003] Jenkins is a popular automated continuous integration management tool that integrates a wide range of plug-in management tools, such as Gitlab, python, and shell. However, due to the complexity of its operation and environment deployment, it has certain learning and maintenance costs for operators and administrators. Operators need to spend a lot of time and energy learning how to operate the Jenkins tool, and cannot focus on analyzing test reports and test data. In addition, manually creating Jenkins switch tasks, selecting test case sets, and writing test scripts will also lead to the risk of operational errors, which will reduce the quality of software testing. Summary of the invention

[0004] The embodiments of the present application provide a switch automated testing method and device, which are used to solve the following technical problems: directly using the Jenkins tool to test the switch will increase the learning cost of operators and reduce the quality of software testing.

[0005] The present application embodiment adopts the following technical solutions:

[0006] On the one hand, an embodiment of the present application provides a switch automated testing method, the method comprising: determining a test case set for the switch in response to received switch test parameters; obtaining a switch software version to be tested based on a storage path of the switch software version; constructing a Jenkins test task based on the test case set and the switch software version; and obtaining and displaying the status information of the Jenkins test task in real time.

[0007] In a feasible implementation manner, the switch test case set is determined in response to the received switch test parameters, specifically including: based on a tree data structure, all functional modules in the switch software are assembled into a tree structure; wherein each functional module corresponds to a node in the tree structure; each node in the tree structure is marked with a digital subscript; based on the switch test parameters, the corresponding node is searched in the tree structure to obtain the names of several functional modules that need to be tested; wherein the switch test parameters include one or more of the digital subscripts; and the names of the several functional modules that need to be tested are combined into a test case set for the switch.

[0008] In a feasible implementation, based on the switch test parameters, the corresponding nodes are searched in the tree structure to obtain the names of several functional modules that need to be tested, specifically including: pushing the root node of the tree structure into a stack; after each stacking operation, judging whether the numeric subscript of the last node pushed into the stack matches the switch test parameters; if not, obtaining all child nodes of the last node pushed into the stack; pushing the first child node of the last node pushed into the stack, performing the next loop, until the numeric subscript of the last node pushed into the stack matches the switch test parameters, and returning the name of the functional module corresponding to the last node pushed into the stack.

[0009] In a feasible implementation, before obtaining all child nodes of the last node pushed into the stack, the method further includes: if the last node pushed into the stack does not have any child nodes, popping the last node pushed into the stack, and pushing the next node of the node after being popped into the stack, and looping until the last node pushed into the stack has child nodes; wherein the next node is the node corresponding to the numerical subscript of the node after being popped plus one.

[0010] The embodiment of the present application assembles the functional modules of the switch through a tree structure, marks the functional modules with a key-value keyword marking method, and uses a recursive algorithm to quickly find the functional modules of the switch that need to be tested, so that the test case set can be automatically determined without manually assembling the test case set, thereby reducing the workload of the staff. Moreover, by assembling the functional modules of the switch through a tree structure, the correlation between the functional modules can also be retained.

[0011] In a feasible implementation, based on the test case set and the switch software version, a Jenkins test task is constructed, specifically including: based on the startup instruction, obtaining construction parameters; wherein the construction parameters include at least one or more of the following: switch topology configuration information, switch port configuration information, builder information; based on the test case set, determining several functional modules that need to be tested in the switch software version; based on the construction parameters, constructing Jenkins test tasks for the several functional modules.

[0012] In a feasible implementation manner, before constructing the Jenkins test tasks for the several functional modules based on the build parameters, the method further includes: determining whether the Jenkins pipeline task corresponding to the build parameters exists; if the Jenkins pipeline task corresponding to the build parameters does not exist, calling the python JenkinsAPI interface, copying the pre-created Jenkins pipeline task template, and generating the corresponding Jenkins pipeline task; and constructing the Jenkins test task through the Jenkins pipeline task.

[0013] In a feasible implementation, during the process of constructing the Jenkins test task, the method further includes: in response to a termination operation or execution operation of the front end, terminating the Jenkins test task by calling the python Jenkins API interface, or reconstructing the abnormally terminated Jenkins test task.

[0014] In a feasible implementation, after building a Jenkins test task based on the test case set and the switch software version, the method further includes: when there are more than one Jenkins test tasks running at the same time, using a preset regular expression to regularly match the build numbers of all Jenkins test tasks; creating a corresponding thread for each build number; and starting and executing the threads in sequence based on a preset time interval.

[0015] In a feasible implementation, the status information of the Jenkins test task is obtained and displayed in real time, specifically including: calling the python Jenkins API interface to obtain the status information of the Jenkins test task in real time; wherein the status information includes at least one or more of the following: build status information, build progress information, build parameter information, and builder information; and the status information of each Jenkins test task is obtained and displayed visually in real time.

[0016] On the other hand, an embodiment of the present application also provides a switch automation testing device, including: a data control module, used to determine a test case set of the switch based on the received switch test parameters; and, based on the switch software version path, to obtain the switch software version to be tested; a Jenkins control module, used to construct a Jenkins test task based on the test case set and the switch software version; a front-end control module, used to obtain the status information of the Jenkins test task in real time and display it on the front-end interface in real time.

[0017] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0018] The switch automation test platform provided by the embodiment of the present application does not require the platform user to manually construct switch test tasks, write test scripts, and manually select test case sets. The above operations can be automatically completed by the switch automation test platform, and the platform user only needs to perform simple interface operations, which can reduce the usage threshold and learning cost of the platform user. The switch automation test platform provided by the present application uses Python multi-threading technology to implement multiple test tasks simultaneously, thereby improving test efficiency. Quickly obtain the Jenkins task status in real time and display it on the front-end interface, so that the front-end user can view and manage the Jenkins test tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0020] Figure 1 A schematic diagram of the structure of a switch automation test device provided in an embodiment of the present application;

[0021] Figure 2 A flow chart of a switch automation testing method provided in an embodiment of the present application;

[0022] Figure 3 A schematic diagram of a tree structure provided in an embodiment of the present application;

[0023] Figure 4 A flowchart of a recursive algorithm for searching functional modules provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The embodiments of the present application provide a switch automatic testing method and device.

[0025] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0026] Figure 1 A schematic diagram of the structure of a switch automation test device provided in this application, such as Figure 1 As shown, the switch automatic testing device 100 includes a front-end control module 110 , a data control module 120 , and a Jenkins control module 130 .

[0027] Among them, the front-end control module 110 is used to provide a visual interface, so that the platform users can view the status information of the Jenkins test task through the visual interface, and the platform users can control the execution process of the Jenkins test task through the visual interface. It can also be used to display test reports and test data, so that developers or testers can analyze test results. The front-end control module 110 can be a self-designed WEB website, and the visual interface can be a UI interface, so the front-end control module 110 can also be called a WEB control layer.

[0028] The data control module 120 is used to perform corresponding data processing operations according to the request or data sent by the front-end control module 110. The data processing operations that the data control module 120 can perform include but are not limited to generating a test case set, obtaining the status information of the Jenkins test task, etc. The data control module 120 can also be called the data control layer.

[0029] The Jenkins control module 130 is used to build or stop Jenkins test tasks, connect switch hardware devices and test instruments through Python and shell scripts, initialize the test environment, issue commands to execute test case sets, and generate test reports and test logs and upload them to the front-end control module 110. The Jenkins control module 130 can be a Jenkins server. The Jenkins control module 130 can also be called a Jenkins control layer.

[0030] This application adopts the idea of ​​layered design, adopts the mainstream Element-ui+Vue.js+Django+Uwsgi front-end and back-end separation framework, and integrates the Jenkins automatic deployment tool to realize a switch automation test device based on Jenkins. The switch automation test device in this application is the switch automation test platform. The platform user only needs to perform simple operations in the front-end control module 110. All the underlying logic is completed in the background by the data control module 120 and the Jenkins control module 130. There is no need for the platform user to learn in depth how to build Jenkins test tasks, how to select test case sets, and how to write test scripts, which saves the platform user's time and learning costs and lowers the platform's usage threshold.

[0031] This application can be made through Figure 1 The switch automation testing device shown implements a switch automation testing method, such as Figure 2 As shown, the switch automatic testing method specifically includes S201-S207:

[0032] S201. Before executing each test task, the switch automatic test device detects the test environment.

[0033] Specifically, before the switch automatic test device executes the switch test task, the developer needs to deploy the Element-ui+Vue.js+Django+Uwsgi front-end and back-end separation framework environment in the device. Then deploy the test environment of the Jenkins server, which mainly includes master-slave node configuration, creation of switch Jenkins pipeline task template (Jenkinspipeline task template), pipeline groovy task script, etc.

[0034] Furthermore, before each switch test task, the switch automatic test device first detects the test environment of the Jenkins server through the detection script. If the test environment is normal, the switch test task will continue. If the test environment is abnormal, an alarm will be issued to remind the developer to repair the test environment. Generally, after the test environment is deployed once, manual maintenance is no longer required, and manual solutions are only required when abnormal situations occur.

[0035] S202: The switch automatic testing device determines a test case set of the switch based on the received switch test parameters.

[0036] Specifically, when developing a switch automation test device, since there are many functional modules in the switch software and the functional modules have certain correlations, in order to quickly find the specified functional modules and reflect the correlations between the functional modules, the data control module assembles all the functional modules in the switch software into a tree structure based on the tree data structure according to their correlations, and each functional module corresponds to a node in the tree structure. Then, each node in the tree structure is marked with a digital subscript through the key-value keyword notation method.

[0037] As a feasible implementation method, the above tree structure can refer to Figure 3 As shown, the root node of the tree structure is "all", i.e., all nodes. Each node in the second and third layers of the tree structure corresponds to each functional module of the switch, and stores the name of each functional module. Different functional modules of the switch correspond to the code for implementing different switch functions in the switch software. For example, "Port Isolate" is the port isolation module, which corresponds to the code for implementing the port isolation function in the switch software. Through the key-value keyword notation method, the numeric subscript is the keyword Key, and the name of the functional module stored in each node in the tree structure is the value value, and a one-to-one correspondence is performed. By searching for the numeric subscript, the name of the functional module stored in the node corresponding to the keyword can be returned.

[0038] It should be noted that Figure 3 The diagram only shows the assembly of some functional modules, and does not include all functional modules. The solution in this application is to assemble all functional modules of the switch into a tree structure. Figure 2 This is only an example and cannot be used to limit the specific content of the tree structure proposed in this application.

[0039] Furthermore, the front-end control module receives the switch test parameters input by the tester, wherein the switch test parameters include one or more digital subscripts. The data control module searches for nodes corresponding to the switch test parameters in the tree structure through a recursive algorithm to obtain the names of several functional modules to be tested. The names of several functional modules to be tested are combined into a test case set for the switch. If the switch test parameters include multiple digital subscripts, the multiple digital subscripts are sequentially input into the algorithm for searching, and after finding a functional module corresponding to a digital subscript, the functional module corresponding to another digital subscript is searched.

[0040] In one embodiment, if the switch test parameters input by the tester are 4, 9, and 14, the front-end control module sends the received switch test parameters to the data control module, and the data control module searches for the value corresponding to Key4, the value corresponding to Key9, and the value corresponding to Key14 in the tree structure through a recursive algorithm. Figure 3 As shown in the figure, the values ​​finally found are "Port", "PBR", and "Port Mirror", that is, the three functional modules "Port", "PBR", and "Port Mirror" are the functional modules that need to be tested. The data control module combines "Port", "PBR", and "Port Mirror" in the form of an array into a test case set for the switch.

[0041] As a feasible implementation method, Figure 4 As shown, the recursive algorithm for searching the functional module runs in the data control module. Specifically, the following steps may be included:

[0042] S401, push the root node of the tree structure into a stack, and set i = the numeric subscript of the root node. At this time, the root node is the last node pushed into the stack.

[0043] S402: Determine whether i matches the switch test parameter to be searched, that is, whether i is equal to the switch test parameter to be searched, if yes, execute S408. If no, execute S403.

[0044] S403: Determine whether the last node pushed into the stack has a child node, if yes, execute S404. If no, execute S406.

[0045] S404: traverse and obtain all child nodes of the node that is last pushed into the stack.

[0046] S405, push the first child node of the node pushed into the stack last, and set i = the numerical index of the first child node, repeat S402, and loop.

[0047] S406: Pop the last node pushed into the stack.

[0048] S407, set i=i+1, then push the node with the numerical subscript i into the stack, repeat S402, and loop.

[0049] S408. Return the function module name corresponding to the last node pushed into the stack, and the search process ends.

[0050] In one embodiment, Figure 3 , Figure 4As shown, if you need to find the function module name corresponding to the node with a digital subscript of 6, after entering 6 into the algorithm, the root node "all" will be pushed into the stack first. At this time, there is only one root node "all" in the stack, and i is set to the digital subscript 1 of the root node. Since i is not equal to 6, continue to determine whether the root node has child nodes. Since the root node "all" has child nodes, obtain all the child nodes of the root node "L2", "L3", and "Port", and then push the first child node "L2" into the stack. At this time, the stack has the root node "all" and the child node "L2", and "L2" is the last node to be pushed into the stack. Set i = the digital subscript 2 of "L2". Continue to determine whether i is equal to 6. Since i is not equal to 6 at this time, it is determined again whether the node "L2" has child nodes. Since "L2" has child nodes, traverse and obtain all the child nodes "acl", "arp", "mstp", and "mlag" of "L2". Push the first child node "acl" of "L2" into the stack, set i = 5, and then determine whether i is equal to 6 again. Since i is not equal to 6, it is determined whether the node "acl" has a child node. Since "acl" does not have a child node, "acl" is popped from the stack and i=i+1 is set, that is, i=6. Then the node "arp" with a subscript of 6 is pushed into the stack. At this time, the last node pushed into the stack is "arp". It is further determined whether i is equal to 6. Since i=6, this match is successful, and the function module name corresponding to the last node pushed into the stack is returned, that is, "arp".

[0051] It should be noted that the above embodiments are only the design ideas of the recursive algorithm and are not intended to limit the specific implementation method and specific implementation code of the algorithm.

[0052] S203: After determining the test case set, the switch automation testing device obtains the switch software version to be tested based on the switch software version path.

[0053] Specifically, after the environment is deployed, the tester uploads the switch software version to be tested to the FTP server and records the path where the switch software version is stored. After preparing the test case, the tester fills in the storage path of the switch software version and the switch topology configuration information in the corresponding position of the visual interface in the front-end control module, and clicks the corresponding button to start the Jenkins test task. After receiving the start instruction, the data control module obtains the switch software version to be tested according to the storage path of the received switch software version.

[0054] S204, the switch automatic testing device determines whether there is a Jenkins pipeline task in the Jenkins server, and if not, copies the Jenkins pipeline task template.

[0055] Specifically, after starting the Jenkins test task, the Jenkins control module detects whether there is a Jenkins pipeline task (Jenkins pipeline task) corresponding to this Jenkins test task in the Jenkins server. If it exists, the Jenkins test task is built based on the Jenkins pipeline task. If it does not exist, the python JenkinsAPI interface is called to quickly copy the Jenkins pipeline task template pre-created during environment deployment to generate a Jenkinspipeline task.

[0056] S205. The switch automation testing device builds a Jenkins test task based on the test case set and the switch software version.

[0057] Specifically, the Jenkins control module executes the prepared test case set, tests the functional module code corresponding to the test case set in the switch software version, and builds a Jenkins test task.

[0058] As a feasible implementation method, the Jenkins control module can run multiple Jenkins test tasks at the same time by creating multiple threads, and multiple Jenkins test tasks adopt a queue waiting mechanism. When there are more than one Jenkins test tasks running at the same time, a preset regular expression is used to match the build numbers of all Jenkins test tasks, and a corresponding thread is created for each build number, and then the threads are started and executed in sequence based on a preset time interval. For example, the next thread is started 0.5 seconds after the previous thread is started, so that each thread can be executed. In addition, the thread that builds the Jenkins test task is the main thread. During the execution of the main thread, a child thread may be generated due to certain operations of the tester on the front end, and the main thread and the child thread are ensured to maintain coordination through the thread synchronization method.

[0059] In one embodiment, the tester can control the Jenkins control module at any time in the front-end control module to interrupt the Jenkins test task being built, or rebuild the interrupted Jenkins test task.

[0060] S206. The switch automation test device obtains the status information of the Jenkins test task in real time and displays it on the front-end interface in real time.

[0061] Specifically, the front-end control module sends an axios request to the data control module, requesting to obtain the status information of the Jenkins test task. The data control module receives the request and connects to the Jenkins control module through the python Jenkins API interface. The Jenkins control module matches all the build numbers in the Jenkins test task through the python regular expression, and creates and starts the corresponding thread according to the acquired build number. The data control module calls the python Jenkins API to obtain the status information of each thread, and encapsulates it into json format and sends it to the front-end control module. The status information at least includes build status information, build progress information, build parameter information, builder information, etc., wherein the build status information specifically includes completed (idle), building (building), and pending (pending). The front-end control module displays the received json data on the visual interface for the tester to view. It should be noted that the front-end control module can quickly refresh the acquired status information in a very short time to ensure that the status information of the background build Jenkins is displayed in real time on the visual interface.

[0062] S207. The switch automation test device generates a test report and uploads it to the front-end interface, and sends it to the person in charge via email.

[0063] Specifically, after the Jenkins test task is built, the Jenkins control module uploads the test report to the front-end control module and writes the test data into the database, where the test data includes the switch software version information, task executor, which modules are tested by this Jenkins test task, switch topology configuration information, switch port configuration information, test report, etc. The corresponding testers are notified by email, and the test / developer accesses the front-end control module to perform data statistics and analysis. If a functional module fails to run, check the reasons for the failure. Possible reasons include script problems, environmental problems (Jenkins and test instruments), switch software bugs, etc.

[0064] Furthermore, after the tester completes the data analysis, the front-end control module stores all analysis results in the database to facilitate the next data analysis and screening of the test case set.

[0065] Furthermore, the switch automated testing device determines whether the tester has restarted the Jenkins test task. If so, the Jenkins test task is rebuilt and the test and analysis are performed again to form a task closed loop.

[0066] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0067] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0068] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application should be included in the scope of the claims of the present application.

Claims

1. A switch automation testing method, characterized in that: The method comprises: In response to the received switch test parameters, a test case set of the switch is determined, specifically including: Based on the tree data structure, all functional modules in the switch software are assembled into a tree structure; wherein each functional module corresponds to a node in the tree structure; Each node in the tree structure is marked with a digital subscript; based on the switch test parameters, a corresponding node is searched in the tree structure to obtain the names of several functional modules that need to be tested, specifically including: Push the root node of the tree structure into a stack; after each push operation, determine whether the numeric subscript of the last pushed node matches the switch test parameter; if not, obtain all child nodes of the last pushed node; push the first child node of the last pushed node into a stack, and perform the next loop until the numeric subscript of the last pushed node matches the switch test parameter, and return the name of the functional module corresponding to the last pushed node; wherein the switch test parameter includes one or more of the numeric subscripts; In the case that the last node pushed into the stack does not have a child node, the last node pushed into the stack is popped out of the stack, and the next node of the node after being popped out of the stack is pushed into the stack, and the loop is repeated until the last node pushed into the stack has a child node; wherein the next node is the node corresponding to the numerical subscript of the node after being popped out of the stack plus one; Combining the names of the several functional modules that need to be tested into a test case set of the switch; Based on the storage path of the switch software version, obtain the switch software version to be tested; Based on the test case set and the switch software version, build a Jenkins test task; The status information of the Jenkins test task is obtained in real time and displayed in real time.

2. A switch automation testing method according to claim 1, characterized in that: Based on the test case set and the switch software version, a Jenkins test task is constructed, specifically including: Based on the startup instruction, obtain construction parameters; wherein the construction parameters include at least one or more of the following: switch topology configuration information, switch port configuration information, and builder information; Based on the test case set, determining several functional modules that need to be tested in the switch software version; Based on the construction parameters, a Jenkins test task for the several functional modules is constructed.

3. A switch automation testing method according to claim 2, characterized in that: Before building a Jenkins test task for the plurality of functional modules based on the building parameters, the method further includes: Determine whether the Jenkins pipeline task corresponding to the build parameter exists; If the Jenkins pipeline task corresponding to the build parameter does not exist, call the python Jenkins API interface, copy the pre-created Jenkins pipeline task template, and generate the corresponding Jenkins pipeline task; The Jenkins test task is constructed through the Jenkins pipeline task.

4. A switch automation testing method according to claim 2, characterized in that: In the process of constructing the Jenkins test task, the method further includes: In response to the abort operation or execution operation of the front end, the Jenkins test task is aborted by calling the python Jenkins API interface, or the abnormally terminated Jenkins test task is rebuilt.

5. A switch automation testing method according to claim 1, characterized in that: After constructing a Jenkins test task based on the test case set and the switch software version, the method further includes: When there are more than one Jenkins test tasks running at the same time, the build numbers of all Jenkins test tasks are matched by the preset regular expression; Create a corresponding thread for each build number; Based on a preset time interval, the threads are started and executed in sequence.

6. A switch automation testing method according to claim 1, characterized in that: Obtain and display the status information of the Jenkins test task in real time, including: Call the python Jenkins API interface to obtain the status information of the Jenkins test task in real time; wherein the status information includes at least one or more of the following: build status information, build progress information, build parameter information, and builder information; The status information of each Jenkins test task obtained is displayed visually in real time.

7. A switch automation testing device based on a switch automation testing method according to claim 1, comprising: A data control module, configured to determine a test case set of the switch in response to the received switch test parameters; and, based on the switch software version path, obtaining the switch software version to be tested; A Jenkins control module, used to build a Jenkins test task based on the test case set and the switch software version; The front-end control module is used to obtain the status information of the Jenkins test task in real time and display it on the front-end interface in real time.

Citation Information

Patent Citations

  • Automatic testing method and device for software

    CN107992404A

  • Test case processing method and device

    CN109558317A

  • Automatic test framework and execution method of test case

    CN110399299A

  • Automation method and device for compatibility test

    CN110471831A

  • Automating functionality test cases

    US20130042222A1