Automated Testing Method and System for Power Information and Communication Equipment
By designing an automated test system for power information and communication equipment, using multi-tenant task scheduling and network topology configuration on the web front-end and server side, the problems of poor stability and low efficiency in manual testing are solved, and efficient and stable automated testing is achieved.
Patent Information
- Application Number
- CN202010807829.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-12
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2040-08-12
AI Technical Summary
The testing methods of existing power information and communication equipment mainly rely on manual testing, resulting in poor stability, low efficiency and high maintenance costs, making it difficult to meet the automated testing needs of large batches of equipment.
Design an automated testing system for power information and communication equipment, including web front-end and server-end, realize multi-tenant task scheduling and network topology configuration for automated testing, support multi-user parallel testing, and port operation and test results are recorded through physical layer switches.
It realizes automated testing of power information and communication equipment, improves test efficiency and result stability, meets the unmanned testing needs of large-scale equipment, and reduces labor costs.
Smart Images

Figure CN112115044B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automated testing, and particularly relates to a method and system for automated testing of power information and communication equipment. Background Art
[0002] With the advancement of the "Internet +" work, the smart grid supported by communication networks and computer information networks has become the future trend, and power information and communication equipment plays a crucial role in it. System testing of power information and communication equipment is an important link to ensure the functions, performance, and stability of such equipment.
[0003] Currently, the testing means of power information and communication equipment are mainly manual testing. This testing method requires a large amount of human participation. Due to many subjective factors, the test results of different testers may vary greatly, with poor stability, high maintenance costs, and low efficiency. Summary of the Invention
[0004] The present invention provides a method and system for automated testing of power information and communication equipment to solve the problems of poor stability and low efficiency in the testing of power information and communication equipment in the prior art.
[0005] In a first aspect, the present invention provides an automated testing system for power information and communication equipment, including:
[0006] A web front-end and a server-side;
[0007] The web front-end is used to implement human-computer interaction in business functions such as commission management, task management, sample management, use case management, instrument management, user management, statistics management, and log management related to automated testing;
[0008] The server-side is used to implement automated configuration of the test topology based on a physical layer switch and multi-tenant task scheduling based on a disassembled task state machine, implement the test process, and obtain the test results of the power information and communication equipment under test from the test instrument.
[0009] In a second aspect, the present invention provides a method for automated testing of power information and communication equipment, including:
[0010] Form a local area network by connecting the device under test and the test tool through a physical layer switch;
[0011] Pre-configure test cases with unique identifiers on the test software system and support parallel testing by multiple users;
[0012] For test cases corresponding to different test devices, occupy and release the physical switch ports by calling the physical layer switch API interface;
[0013] When multiple users conduct parallel tests, a multi-tenant task scheduling mechanism based on a disassembled task state machine is used to allocate tasks and receive tasks.
[0014] The automated test method and system for power information and communication equipment of the present invention, in combination with the characteristics of automated testing of power information and communication equipment, achieve automated testing for power information and communication equipment such as routers, switches, EPONs, servers, load balancers, and communication power supplies, meeting the automated testing requirements for the detection of power information and communication equipment; when executing test cases, it realizes the automatic switching of the test network topology, achieving the goal of unattended testing; through a task queue, isolation settings are made for the test tasks of multiple tenants, thus ensuring the real-time control of tasks by multiple tenants; the testing efficiency is high and the stability of test results is good. Brief Description of the Drawings
[0015] By referring to the following drawings, the exemplary embodiments of the present invention can be more fully understood:
[0016] Figure 1 It is a schematic diagram of the composition of the automated test system for power information and communication equipment according to an embodiment of the present invention;
[0017] Figure 2 It is a schematic diagram of the operation of the automated test system for power information and communication equipment according to an embodiment of the present invention;
[0018] Figure 3 It is a schematic flowchart of the automated test method for power information and communication equipment according to an embodiment of the present invention;
[0019] Figure 4 It is a test flowchart of the automated test system for power information and communication equipment according to an embodiment of the present invention. Detailed Embodiments
[0020] Now, the exemplary embodiments of the present invention will be introduced with reference to the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely, and to fully convey the scope of the present invention to those skilled in the art. The terms in the exemplary embodiments shown in the drawings are not limitations on the present invention. In the drawings, the same units / components are denoted by the same reference numerals.
[0021] Unless otherwise specified, the terms (including scientific and technical terms) used herein have the ordinary meaning understood by those skilled in the art. Additionally, it can be understood that the terms defined in the commonly used dictionary should be understood to have a meaning consistent with the context of their related fields, and should not be understood as idealized or overly formal meanings.
[0022] Description of Some Terms:
[0023] DUT(Device Under Test): Device Under Test
[0024] In order to improve the test efficiency, the importance and value of automated testing have reached a broad consensus in the industry. However, due to the high technical content and numerous influencing factors required for automated testing, the current coverage is not ideal, whether in operators or equipment manufacturers.
[0025] In order to improve the automated testing efficiency of a large number of devices, the automated testing method and system for power information and communication devices provided by the present invention utilize a pre-designed test procedure to input the link relationship between multiple sets of devices under test and test tools, enabling unattended operation between tests.
[0026] After startup, the automated testing method and system support multiple testers to use the test tools simultaneously to conduct tests on multiple sets of multiple devices respectively, enabling multiple testers to work in parallel and improving the device utilization rate of the test tool.
[0027] Specifically, test cases are written according to relevant standards of power communication, and different automated test scripts are implemented within the automated testing method and system. The automated testing method and system call different test cases to carry out test projects.
[0028] Such as Figure 1 and Figure 2 shown, an embodiment of the present invention provides an automated testing system for power information and communication devices, including:
[0029] A web front-end and a server-side;
[0030] The web front-end is used to implement the human-computer interaction in business functions related to automated testing, such as commission management, task management, sample management, use case management, instrument management, user management, statistics management, and log management.
[0031] The server-side is used to implement the automated configuration of the test topology based on a physical layer switch and the multi-tenant task scheduling based on a disassembled task state machine, execute the test process, and obtain the test results of the power information and communication devices under test from the test instruments.
[0032] Furthermore, the software framework of the automated testing method and system includes:
[0033] A background database processing module, a business process management module, a test case management module, a test tool management module, and a test report management module;
[0034] The background database processing module includes a MySQL database, which is used to store and query commission information, task information, sample information, user information, test results, test logs, test cases, and test tools, and to process data and present it on the page;
[0035] The business process management module is used to implement test commission and task management, test case and test tool management, test automation process control, automatic test report generation, and test record upload;
[0036] The test case management module is used to script test cases and associate test cases with commissions. Among them, test cases are defined and called in the Json file format;
[0037] The test tool management module supports test instruments including power information communication devices under test such as physical layer switches; it is used to detect the status of each interface of the test tool at intervals and control the occupation and release of interfaces;
[0038] The test report management module is used to, according to the presentation form of the test results predefined in the test cases, after the test execution ends, select one of the multiple execution results as the final result, fill this result into the corresponding position of the Excel template, and package and compress the original test records and this test result according to the commission for storage.
[0039] Furthermore, the server side includes a user application management unit, a service management unit, a resource management unit, and a test management support unit:
[0040] The user application management unit enables multiple testers to perform multiple test tasks simultaneously; the user application management unit realizes multiple automatic test modules through the automatic test application management proxy interface; each automatic test module corresponds to a web page, and in the background, each test application is realized through a service proxy;
[0041] The service management unit realizes functions such as protocol adaptation, service registration, service routing, traffic control, service quality, and interface management agency through bus access; in the background, the following functions are respectively realized through the use case management agency, the tool management agency, and the test report management agency:
[0042] Realized through the testreport service: record processing, presentation, result confirmation, selection, report template call, and test report original record;
[0043] Realized through the Tools service: addition of instruments and physical layer switches, port status monitoring, port occupation and release, and call of instruments and physical layer switches;
[0044] Implemented through the Testcase service: test case development, use case debugging and uploading, association with commissions, and use case execution;
[0045] The resource management unit, in the background, realizes the following functions through the resource management agent:
[0046] Access and manage user information and commission information in the database DB through the customer server;
[0047] Access and manage task information and sample information in the database DB through the task server;
[0048] Access and manage test cases, test results, test tools, and test calendars in the database DB through the test server;
[0049] The test management support unit enters the information of the test instrument and the device under test into the database DB or retrieves the information of the test instrument and the device under test from the database.
[0050] Furthermore, the processing flow of the automated test method and system includes:
[0051] Commission creation: When testing a device of a certain model, create a corresponding commission; the commission contains basic customer information and sample information;
[0052] Use case association: After creating the test commission, associate test cases with the commission; among them,
[0053] The automated test method and system have pre-uploaded multiple test cases in.zip format; each test case contains and only contains one use case information, configuration parameters, pre-test script, formal test script, and also includes one or more xml test instrument configuration files, optional use case descriptions, and instruction document files;
[0054] Task assignment: Assign each commission associated with test cases to each tester as a test task to be executed, where the test task records information about the completion time requirement;
[0055] Task reception: The test task is assigned to the relevant tester; if there is no objection, accept the task; otherwise, cancel the task, and this task will be reassigned to other testers;
[0056] Each tester can respectively access the WEB front-end management and execute the test tasks under their names;
[0057] Test configuration: Associate each test task with the power information communication device under test and the test instrument, determine the associated test cases, and configure the use case parameters;
[0058] Test Execution: When executing test tasks, pre-tests or formal tests can be performed; according to the test strategy, for test cases that fail during execution, the number of automatic retests can be set; during the test process, testers can pause or terminate the test;
[0059] Test Result Generation: After the test execution ends, test records are automatically generated, and the required test results are selected and confirmed from multiple test records; if the test results are normal, a test report is generated.
[0060] Test Report Submission: After generating the test report, it is submitted to the unified detection management system through an interface call.
[0061] Furthermore, when the server-side performs multi-tenant task scheduling based on the disassembly task state machine, it also includes an execution engine and a scheduling module;
[0062] The task is disassembled into multiple subtasks according to the execution stage of the task; among them, the execution engine executes each task with a single subtask as the minimum execution unit;
[0063] Maintain the overall state machine of the task, including:
[0064] Initialize the task queue, and the scheduling module is responsible for listening to this task queue,
[0065] After the scheduling module reads a task from the task queue, it initializes the corresponding execution unit and modifies the task state machine;
[0066] Among them, the scheduling module listens to the operations of testers on tasks through the web front-end;
[0067] If the operation on the task is a termination operation, the scheduling module notifies the execution unit to terminate. After the execution unit saves the information and exits, the scheduling module modifies the state machine;
[0068] If the operation on the task is a pause operation, the scheduling module notifies the execution unit to suspend. After the execution unit finishes the current subtask, it suspends, and the scheduling module modifies the state machine;
[0069] If the operation on the task is a resume operation, it notifies the execution unit to resume. The execution unit is re-awakened to execute, and the scheduling module modifies the state machine to in-execution;
[0070] After all subtasks are executed, save the task result information, the scheduling module modifies the task state machine to completed, and destroys the execution unit.
[0071] Furthermore, when performing multi-tenant task scheduling based on the disassembly task state machine, task disassembly includes:
[0072] Verify all configurations of tasks for each tenant, and perform completeness verification in the task configuration according to the dependencies of each phase included therein;
[0073] For the configurations of each subtask, substitute and replace the configuration items therein respectively to generate new configurations, and package the obtained new configurations with the subtask information to generate new tasks;
[0074] Among them, task decomposition depends on the decomposability of the task, and there are context dependencies between tasks.
[0075] Further, when the server side implements the automated configuration of the test topology based on the physical layer switch,
[0076] According to the test requirements, call the physical layer switch API interface to perform port occupancy and release operations; among them, the encapsulation of the physical layer switch API includes:
[0077] Map and associate two ports; isolate the ports and do not connect them to other ports; set the port to UP; set the port to DOWN; retrieve the structure body of all physical layer switch ports and modify the topology according to the content.
[0078] Further, when designing the data structure of the physical layer switch, for a single port of the physical layer switch, the structure body of the data structure used has a member; when there is a member in the structure body, it also means isolating this physical layer switch port and not connecting it to other ports;
[0079] For the port group of the physical layer switch, the structure body of the data structure used has two or more members; when there are two members in the structure body, it also means connecting these two physical layer switch ports.
[0080] Further, during automated testing, the test environment is composed of a test instrument, a power information and communication device under test, a physical layer switch, and the automated test system;
[0081] Among them, a test instrument, a power information and communication device under test, a physical layer switch, and the server side of the automated test system are set in the computer room;
[0082] The WEB side of the automated test system is set outside the computer room.
[0083] Further, the power information and communication device under test includes: routers, switches, EPONs, servers, load balancers, communication power supplies, etc.
[0084] The automated testing method and system implement the automated testing method, system architecture scheme, and functional module division for power information and communication equipment; according to the characteristics of power information and communication equipment, an automated testing method and system processing flow for power information and communication equipment is formed, meeting the automated testing requirements for the detection of power information and communication equipment; based on the network topology switching of the physical layer switch, by designing a data structure, defining the mapping rules of ports, and encapsulating the physical layer switch API, it is convenient for interface docking with the automated testing method and system, thus ensuring the automatic switching of the test network topology when executing test cases and achieving the purpose of unattended testing; based on the decomposability of the task set, after task decomposition, the overall state machine of the task is maintained by controlling the execution of subtasks, and the tasks of multiple tenants are isolated through a task queue, thus ensuring the real-time control of tasks by multiple tenants.
[0085] As Figure 1 shown, the automated testing method and system for power information and communication equipment adopt a B / S architecture and are implemented in the form of a Web GUI for users to browse and operate, thus realizing the functions of automatic detection management of equipment such as test entrustment, task management, personnel management, test statistics, and test logs.
[0086] The automated testing method and system for power information and communication equipment consist of two parts: a web front-end and a server-side. The web front-end mainly realizes the human-computer interaction in business functions related to automated testing, such as entrustment management, task management, sample management, use case management, instrument management, user management, statistics management, and log management; the server-side realizes the automated configuration of the test topology based on the physical layer switch, and implements functions such as test process control, pre-test, process data extraction, test result recording, and system interaction. The server-side also realizes the multi-tenant task scheduling based on the decomposed task state machine.
[0087] As Figure 1 and Figure 2 shown, the software framework of the automated testing method and system includes five main functional modules: a background database processing module, a business process management module, a test case management module, a test tool management module, and a test report management module. The specific composition and functions of each module are as follows:
[0088] 1) Background database processing module
[0089] The database Database uses a MySQL database, which can store and query information such as entrustment information, task information, sample information, user information, test results, test logs, test cases, and test tools, and process and present the data on the page.
[0090] 2) Business process management module
[0091] This business process management module includes:
[0092] a) Test entrustment and task management sub-module
[0093] b) Test case and test tool management sub-module
[0094] c) Test automation process control sub-module
[0095] d) Test report automatic generation sub-module
[0096] e) Test record upload sub-module
[0097] 3) Test case management module
[0098] This test case management module mainly realizes:
[0099] a) Scripting of test cases, uploading test cases individually or in batches as needed, and editing or adjusting case parameters;
[0100] b) Associating test cases with the entrustment, that is, clarifying what content is to be tested for this entrustment;
[0101] c) Selecting which test cases to execute during a single execution process and confirming the selection based on the test execution results.
[0102] The test cases adopt a modular design concept, allowing for flexible addition / removal of test case sets, which is convenient for later maintenance and use. Specifically, the test cases are defined and called in detail in the Json file format.
[0103] Specifically, JSON (JavaScript Object Notation) is a lightweight data interchange format. JSON adopts a text format that is completely independent of the language, and these characteristics make JSON an ideal data interchange language.
[0104] 4) Test tool management module
[0105] This test tool management module mainly supports test instruments such as Spirent TestCenter, and DUTs such as Avalanche and switches, including: adding the chassis IP address of the corresponding test tool to the automated test method and system; automatically detecting the status of each interface of the test tool every 10 seconds after detecting the test tool, and providing functions for interface occupancy and release.
[0106] Specifically, the server side creates a dedicated sub-thread pool to monitor whether the physical status of each port of the test instrument is up or down. Through port division, the Ethernet link between the test instrument and different DUTs can be dynamically implemented. Specifically, communicate with the test instrument to change the physical status of each port of the test instrument to up or down.
[0107] Specifically, the decision on port occupancy or release is specified by the test script.
[0108] Specifically, during the test execution process, traffic construction, control, and statistics can also be implemented through the test tool API interface call, and log output is generated for debugging when an exception is reported.
[0109] In the automated test method and system of this embodiment, according to different test cases, the test network is built by the test script to implement different topological structures for performing automatic tests on multiple devices.
[0110] Specifically, during implementation, the test networking environment is composed of a Testcenter test instrument, a device under test DUT, and the automated test method and system of this embodiment.
[0111] The devices under test in the automated test method and system of this embodiment include: routers, switches, EPONs, servers, load balancers, communication power supplies, etc.
[0112] Specifically, during implementation, devices under test DUTs, test instruments, physical layer switches, etc. are set in the computer room; a test WEB end is set outside the computer room.
[0113] Automatically implement the change of the topological structure of the test instrument according to the test script without manual switching.
[0114] 5) Test report management module
[0115] The presentation form of the test result will be predefined in the test case. After the test execution ends, select one of the multiple execution results as the final result, fill this result into the corresponding position of the Excel template, and package and compress the original test record and this Excel test result according to the entrustment for storage; the test result can be downloaded, and the test report can be uploaded to the unified detection management system through the HTTP interface call.
[0116] As Figure 2 shown, the automated test method and system support user permission management, integrate resource information such as entrustment information, user information, task information, sample information, test cases, test results, test tools, test calendars, etc., support test report services, test tool services, and test case services, and implement functions such as test case management agent, test instrument tool management agent, test report management agent, etc.
[0117] On the server side, it includes a user application management unit, which enables multiple testers to perform multiple test tasks simultaneously and separately; specifically, the user application management unit realizes multiple automatic test modules through the automatic test application management agent interface; each automatic test module corresponds to a web page, and in the background, each test application is realized through a service agent.
[0118] On the server side, it also includes a service management unit, which realizes functions such as protocol adaptation, service registration, service routing, traffic control, service quality, and interface management agent through bus access. In the background, the following functions are respectively realized through the use case management agent, tool management agent, and test report management agent:
[0119] Realized through the testreport service: record processing, presentation, result confirmation, selection, report template invocation, and original record of the test report;
[0120] Realized through the Tools service: addition of instruments and physical layer switches, monitoring of port status, occupation and release of ports, invocation of instruments and physical layer switches;
[0121] Realized through the Testcase service: test case development, case debugging and uploading, association with delegation, case execution;
[0122] On the server side, it also includes a resource management unit, which realizes the following functions through the resource management agent in the background:
[0123] Access and manage user information and delegation information in the database DB through the customer server;
[0124] Access and manage task information and sample information in the database DB through the task server;
[0125] Access and manage test cases, test results, test tools, and test calendars in the database DB through the test server;
[0126] On the server side, it also includes a test management support unit, which enters the information of the test instrument and the device under test into the database DB or retrieves the information of the test instrument and the device under test from the database;
[0127] Among them, the external detection system is connected with protocol adaptation.
[0128] Such as Figure 3 As shown, the automatic test method for power information and communication equipment in the embodiment of the present invention includes:
[0129] Step S100: Form a local area network with the device under test and the test tool through a physical layer switch;
[0130] Step S200: Pre-configure test cases with unique identifiers on the test software system and support parallel testing by multiple users;
[0131] Step S300: For test cases corresponding to different test devices, perform occupancy and release operations on physical switch ports by calling the physical layer switch API interface;
[0132] Step S400: When multiple users perform parallel testing, allocate tasks and receive tasks based on the multi-tenant task scheduling mechanism of the disassembled task state machine.
[0133] This automated testing method for power information and communication equipment has the same technical concept, the same technical solution and technical effects as the above-mentioned automated testing system for power information and communication equipment, which will not be elaborated here.
[0134] As Figure 4 shown, the processing flow of this automated testing system includes:
[0135] 1) Entrustment creation: To test a device of a certain model, one corresponding entrustment is required. This entrustment contains basic customer information, sample information, etc. This step creates an entrustment for testing the device of this model.
[0136] 2) Test case association: After creating the test entrustment, associate test cases with this entrustment.
[0137] It should be understood that a variety of test cases in.zip format have been pre-uploaded in this test system. Each test case contains and only contains one set of case information, configuration parameters, pre-test scripts, formal test scripts, and also includes one or more xml test instrument configuration files, optional case descriptions and documentation files.
[0138] After uploading, the background will decompress the case file, and will parse the *.json configuration parameter file therein, obtain the parameters and information of this case, and write them into the Mysql database. When the case is deleted, its corresponding database record will be deleted.
[0139] Test cases are used to indicate the test content and test steps. For the device under test, i.e., the switch, they also indicate the port connection relationship.
[0140] After associating test cases with the entrustment, the list of test cases corresponding to the sample has been determined, and the test cases can be assigned to specific testers.
[0141] 3) Task assignment: After test case association, test tasks are assigned. Specifically, it includes which testers these test cases are assigned to, which test cases each tester needs to complete and the completion time requirements, etc.
[0142] 4) Task Receiving: The test task is assigned to the relevant tester; if there is no objection, the task is accepted; otherwise, the task is cancelled and will be reassigned to other testers.
[0143] After each test case is received by the tester, it becomes a test task corresponding to each tester respectively; each tester accesses the WEB front-end management separately and executes the test tasks under their names.
[0144] 5) Test Configuration: This includes associating each test task with the DUT (such as a switch), test instruments, configuring the DUT, selecting the associated test cases, and configuring the case parameters.
[0145] Specifically, when adding the chassis of a physical layer switch using the web front-end, enter the IP address of the chassis to add or select the chassis. After adding or selecting the chassis of the physical layer switch, the information of all ports of each board card under this chassis is displayed on the web front-end. In subsequent tests, settings for port occupation and port release are required.
[0146] Specifically, when adding test instruments using the web front-end, enter the IP address of the chassis to add or select the chassis; after adding or selecting the chassis of the test instrument, the information of all ports of each board card under this chassis is displayed on the web front-end; and the test instrument ports that can be occupied or released can be set.
[0147] Specifically, when adding DUT devices using the web front-end, select the DUT name (for example, the first device must select DUT1, and so on), set the sending interval (that is, the interval time between each command sent to the DUT, in ms); and obtain the topology relationship record file (such as a script file) of the test cases occupying ports corresponding to each DUT device.
[0148] 6) Test Execution: When executing the test task, pre-testing or formal testing can be performed. According to the test strategy, for test cases that fail to execute, the number of automatic retests can be set; during the test process, the test can be paused or terminated.
[0149] Specifically, pre-testing is a test service provided to preliminarily assess the test environment and the matching situation of test cases in advance. No formal report is generated for pre-testing, and there is only one formal test, and a formal report is generated.
[0150] 7) Test Result Generation: After the test execution is completed, test records are automatically generated. Select the required test results from multiple test records and confirm; if the test results are normal, a test report is generated; if the test results are abnormal, the test can be retested.
[0151] Specifically, it automatically determines whether the test results of test cases are normal according to pre-stored test standards and specifications (such as the standards and specifications announced by the State Grid Corporation of China).
[0152] 8) Submission of test report: After generating the test report, it can be submitted to the unified detection management system through interface calls.
[0153] Reasonable task scheduling is the key to improving the level of automated testing. This automated testing system does not adopt the common time scheduling strategy for multi-tenant task scheduling, but adopts multi-tenant task scheduling based on the disassembled task state machine, realizing multi-tenant interactive task scheduling, making tenants transparent and unaware of each other, and a single tenant can perform real-time interactive operations on its own tasks.
[0154] Specifically, the task is disassembled into multiple subtasks according to the execution stage of the task. The execution engine executes each task with a single subtask as the smallest execution unit and simultaneously maintains the overall state machine of the task.
[0155] Specifically, the multi-tenant task scheduling based on the disassembled task state machine includes two parts: task disassembly and state machine maintenance.
[0156] Specifically, when facing the test tasks of multiple tenants, task disassembly is carried out separately for each tenant, and the configurations of each subtask are regenerated according to the task configurations of each tenant, and reorganized and packaged into new tasks. Specifically, it includes:
[0157] 1.1) Verification of task configuration
[0158] Verify all the configurations of the tasks of each tenant, and perform completeness verification in the task configuration according to the dependencies of each stage included therein. For example, the task configurations are set AS{a = 1, b = 2, c = 3}, BS{a = 1, b = 2, c = 3}, CS{a = 1, b = 2, c = 3}, and the dependencies of each stage are AS1, AS2....ASn, BS1, BS2....BSn, CS1, CS2....CSn, then verify whether AS1, AS2....ASn, BS1, BS2....BSn, CS1, CS2....CSn are subsets of S respectively.
[0159] 1.2) Generation of subtask configuration
[0160] For the configurations of each subtask in the first step, AS1, AS2....ASn, BS1, BS2....BSn, CS1, CS2....CSn, substitute and replace the configuration items a, b, c respectively to generate new configurations AS1, AS2....ASn, BS1, BS2....BSn, CS1, CS2....CSn, and package the obtained configurations with the subtask information to generate a new task.
[0161] Specifically, the decomposition of a task mainly depends on the decomposability of the task. For example, the task is a task set that contains a series of tasks, and there may be context dependencies between the tasks. Then, the configurations of each subtask are regenerated according to the task configuration and reorganized and packaged into a new task. Specifically, it includes the following steps:
[0162] 1.1) Verify the task configuration
[0163] Verify all the configurations of the task, and perform completeness verification in the task configuration according to the dependencies of each stage included. For example, if the task configuration is the set S{a = 1, b = 2, c = 3}, and the dependencies of each stage are S1, S2....Sn, then verify whether S1, S2, Sn are subsets of S respectively.
[0164] 1.2) Generate subtask configurations
[0165] For the configurations of each subtask S1...Sn in the first step, substitute and replace the configuration items a, b, c in S to generate new configurations S1`, S2`...Sn`, and package the obtained subtask information to generate a new task.
[0166] 2) Maintenance of the task state machine
[0167] The maintenance of the task state machine schedules and executes according to the newly generated task after packaging, mainly including the following steps:
[0168] Step 1: Initialize the task queue, and the scheduling module is responsible for listening to this task queue;
[0169] Step 2: After pushing the tasks corresponding to each tester obtained to the task queue, listen to the task state machine;
[0170] Step 3: After the scheduling module reads the task from the task queue, initialize the execution unit and modify the task state machine;
[0171] Step 4: The scheduling module listens to the operations of the tester on the task through the web front end.
[0172] If it is a termination operation, notify the execution unit to terminate. After the execution unit saves the information, it exits, and the scheduling module modifies the state machine. If it is a suspension operation, notify the execution unit to suspend. After the execution unit finishes the current subtask, it suspends, and the scheduling module modifies the state machine. If it is a resume operation, notify the execution unit to resume. The execution unit is re-awakened to execute, and the scheduling module modifies the state machine to the executing state.
[0173] Step Five: After all subtasks are executed, save the task result information, modify the task state machine to completed, and destroy the execution unit.
[0174] In summary, based on the decomposability of the task set, this automated testing system maintains the overall task state machine by controlling the execution of subtasks after task decomposition, isolates the tasks of multiple tenants through a task queue, thereby ensuring the real-time control of tasks by multiple tenants; while achieving a friendly and convenient human-computer interaction, it improves the testing efficiency; realizes the interactive task scheduling of multiple tenants, making the tenants transparent and unaware of each other, and a single tenant can perform real-time interactive operations on its own tasks, enhancing the usage experience of testers.
[0175] Furthermore, this automated testing system realizes the automatic switching of the network topology based on the physical layer switch. When each test task is executed, it automatically connects according to the logical topology and the resource connection lines used in the test cases. Specifically, it automatically and dynamically changes the network topology structure according to the test content, saving the time for testers to frequently travel back and forth to the computer room to insert / change connection wires, making the automated testing truly unattended, avoiding testing problems caused by wiring errors, and improving the testing reliability and efficiency. This automated testing system also provides a means to build the topology through the platform during manual testing.
[0176] Specifically, all interface connection information is statically entered by the system administrator. Specifically, according to the test requirements, by calling the API interface of the physical layer switch, operations such as port occupation and release are performed; according to the test content, the network topology structure is dynamically changed, improving the testing efficiency.
[0177] Specifically, when designing the data structure of the physical layer switch, according to the predefined rules, the mapping relationship of the interfaces is established, such as the connection / disconnection of a single port, the connection / disconnection of two ports, etc.; and according to the mapping relationship of the ports, the predefined network topology structure is automatically regenerated.
[0178] Specifically, for a single port of the physical layer switch, the data structure used is as follows:
[0179] {
[0180] ‘chassis’: <chassis_number> ‘Slot’: <slot_number>,
[0181] ‘Port’: <port_number>,
[0182] }
[0183] For example, the data structure {'chassis': '1','slot': '1', 'port': '1'} represents port 1 on interface 1 of chassis 1. For the port group of a physical layer switch, the data structure used is as follows:
[0184] [{'chassis': '1','slot': '1', 'port': '1'}, {'chassis': '1','slot': '1', 'port': '2'}],
[0185] Among them, there are two members in the data structure, indicating that the ports of these two physical layer switches (i.e., port 1 on interface 1 of chassis 1 and port 2 on interface 1 of chassis 1) are connected.
[0186] Furthermore, in the data structure [{'chassis': '1','slot': '1', 'port': '3'}], there is one member, which can also indicate that this physical layer switch port (i.e., port 3 on interface 1 of chassis 1) is independent and not connected to other ports.
[0187] For all physical layer switch ports, for example, when there are 3 ports port on slot 1 of rack 1, the following data structure (i.e., structure) is used:
[0189] [{'chassis': '1','slot': '1', 'port': '1'}, {'chassis': '1','slot': '1', 'port': '2'}],
[0190] [{'chassis': '1','slot': '1', 'port': '3'}],
[0191] .
[0192] 2) Physical layer switch API encapsulation
[0193] In order to interface with the automated test system, it is necessary to encapsulate the APIs for various operations on the physical layer switch, making it convenient for third-party automated test systems to call and thus simplifying the operations. The main APIs to be encapsulated include:
[0194] 2.1) Map and associate two ports;
[0195] 2.2) Isolate the port and disconnect it from other ports;
[0196] 2.3) Bring the port up;
[0197] 2.4) Bring the port down;
[0198] 2.5) Retrieve the structures of all physical layer switch ports and modify the topology according to the content.
[0199] 2.6) Apply the modification
[0200] The network topology automatic switching method of the automated test system based on the physical layer switch solves the problem of low test efficiency caused by the complex and diverse network topology environment during the testing of a large number of devices, and realizes flexible automatic topology change.
[0201] Compared with implementing network topology changes through network switches and through automatic configuration of network switches, the network topology automatic switching method of the automated test system based on the physical layer switch does not involve the difficulty of network protocol interaction and can avoid the impact of port automatic switching on the test environment.
[0202] The network topology switching method of the automated test system based on the physical layer switch dynamically controls the connection relationship between the physical layer switch and the ports of the test instruments according to the port connection relationships recorded in the test cases, automatically switches the network topology structure during the test, improves the test efficiency, and enables the automated test to truly achieve unattended operation.
[0203] The present invention has been described above by referring to a few embodiments. However, as is well known to those skilled in the art, as defined by the appended patent claims, other embodiments equivalent to those disclosed above of the present invention equally fall within the scope of the present invention.
[0204] Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless otherwise explicitly defined therein. All references to "a / the [device, component, etc.]" are to be interpreted openly as at least one instance of the device, component, etc., unless otherwise explicitly stated. The steps of any method disclosed herein need not be performed in the exact order disclosed, unless explicitly stated.
Claims
1. An automated test system for power information and communication equipment, characterized in that, Including: Web front-end and server-side; The web front-end is used to implement human-computer interaction in commission management, task management, sample management, use case management, instrument management, user management, statistics management, and log management related to automated testing; The server-side is used to implement automated configuration of the test topology based on the physical layer switch and multi-tenant task scheduling based on the disassembly task state machine, execute the test process, and obtain the test results of the power information communication device under test from the test instrument; During automated testing, the test environment consists of a test instrument, a power information communication device under test, a physical layer switch, and the automated test system; Among them, test instruments, power information communication devices under test, physical layer switches, and the server-side of the automated test system are set in the computer room; The web end of the automated test system is set outside the computer room; The power information communication device under test includes at least one of the following: router, switch, EPON, server, load balancer, and communication power supply; The processing flow of the automated test system includes: Commission creation: When testing a device of a certain model, create a corresponding commission; the commission contains basic customer information and sample information; Use case association: After creating the test commission, associate test use cases with the commission; among them, The automated test system has pre-uploaded multiple test use cases in.zip format; each test use case contains and only contains one use case information and configuration parameters, pre-test script, formal test script, and also includes one or more xml test instrument configuration files, optional use case descriptions, and instruction document files; Task assignment: Assign each commission associated with test use cases to each tester as a to-be-executed test task, where the test task records the information of the completion time requirement; Task reception: The test task is assigned to the relevant tester; if there is no objection, accept the task; otherwise, cancel the task, and this task will be re-assigned to other testers so that each tester can respectively access the web front-end management and execute the test tasks under their names; Test configuration: Associate each test task with the power information communication device under test and the test instrument, determine the associated test use cases, and configure the use case parameters; Test execution: When executing the test task, perform pre-test or formal test; according to the test strategy, set the number of automatic retests for the test use cases that fail to execute; during the test process, the tester pauses or terminates the test; Among them, when each test task is executed, it automatically connects to the resources used by the test use case according to the logical topology; it automatically and dynamically changes the test network topology according to the test content, saving the time for testers to frequently go back and forth to the computer room to insert / change the wiring, enabling the automated test to truly be unattended and avoiding test problems caused by wiring errors; Test result generation: After the test execution ends, automatically generate test records, select the required test results from multiple test records and confirm; if the test results are normal, generate a test report; Test report submission: After generating the test report, submit the test report to the unified detection management system through interface call; When the server side performs multi-tenant task scheduling based on the disassembly task state machine, it includes an execution engine and a scheduling module; The task is disassembled into multiple subtasks according to the execution stage of the task; among them, the execution engine executes each task with a single subtask as the minimum execution unit; Maintain the overall state machine of the task, including: Initialize the task queue, and the scheduling module is responsible for listening to this task queue, After the scheduling module reads a task from the task queue, it initializes the corresponding execution unit and modifies the task state machine; Among them, the scheduling module listens to the operations of testers on the task through the web front end; If the operation on the task is a termination operation, the scheduling module notifies the execution unit to terminate. After the execution unit saves the information, it exits, and the scheduling module modifies the state machine; If the operation on the task is a suspension operation, the scheduling module notifies the execution unit to suspend. After the execution unit finishes the current subtask, it suspends, and the scheduling module modifies the state machine; If the operation on the task is a resume operation, it notifies the execution unit to resume. The execution unit is re-awakened to execute, and the scheduling module modifies the state machine to the executing state; After all subtasks are executed, save the task result information. The scheduling module modifies the task state machine to completed and destroys the execution unit.
2. The automated test system according to claim 1, wherein The software framework of the automated test system includes: a background database processing module, a business process management module, a test case management module, a test tool management module, and a test report management module; The background database processing module includes a MySQL database, which is used to store and query commission information, task information, sample information, user information, test results, test logs, test cases, and test tools, and process and present the data on the page; The business process management module is used to implement test commission and task management, test case and test tool management, test automation process control, automatic test report generation, and test record uploading; The test case management module is used to script the test cases and associate the test cases with the commission. Among them, the test cases are defined and called in the Json file format; The test tool management module supports multiple power information communication devices under test, and is used to detect the status of each interface of the test tool at intervals, and control the occupation and release of the interfaces; The test report management module is used to select one of the multiple execution results as the final result according to the presentation form of the test results predefined in the test cases after the test execution ends, fill this result into the corresponding position of the Excel template, and package and compress the original test records and this test result according to the commission for storage.
3. The automated test system according to claim 1, wherein The server side includes a user application management unit, a service management unit, a resource management unit, and a test management support unit: The user application management unit enables multiple testers to perform multiple test tasks simultaneously. Among them, the user application management unit implements multiple automatic test modules through the automatic test application management agent interface; each automatic test module corresponds to a web page, and each test application is implemented through a service agent in the background; The service management unit realizes protocol adaptation, service registration, service routing, traffic control, service quality, and interface management agent through bus access; in the background, the following functions are realized through the use case management agent, tool management agent, and test report management agent respectively: Realized through the testreport service: record processing, presentation, result confirmation, selection, report template invocation, and original test report record; Realized through the Tools service: adding meters and physical layer switches, monitoring port status, occupying and releasing ports, and invoking meters and physical layer switches; Realized through the Testcase service: test case development, case debugging and uploading, association with entrustment, and case execution; The resource management unit realizes the following functions through the resource management agent in the background: Access and manage user information and entrustment information in the database DB through the customer server; Access and manage task information and sample information in the database DB through the task server; Access and manage test cases, test results, test tools, and test calendars in the database DB through the test server; The test management support unit enters the information of the test instrument and the power information communication device under test into the database DB or retrieves the information of the test instrument and the power information communication device under test from the database.
4. The automated test system according to claim 1, wherein In the multi-tenant task scheduling based on the disassembly task state machine, task disassembly includes: Verify all configurations of the tasks of each tenant, and perform completeness verification in the task configuration according to the dependencies of each stage included therein; For the configuration of each subtask, substitute and replace the configuration items therein to generate a new configuration, and package the obtained new configuration and subtask information to generate a new task; Among them, task disassembly depends on the disassemblability of the task, and there are context dependencies between tasks.
5. The automated test system according to claim 1, wherein When the server side realizes the automatic configuration of the test topology based on the physical layer switch, According to the test requirements, call the physical layer switch API interface to perform the occupation and release operations of the ports; among them, the encapsulation of the physical layer switch API includes: Map and associate two ports; make the ports independent and not connected to other ports; port UP; port DOWN; retrieve the structure of all physical layer switch ports and modify the topology according to the content.
6. The automated test system according to claim 5, wherein When designing the data structure of the physical layer switch, For a single port of a physical layer switch, there is a member in the structure of the data structure used; when there is a member in the structure, it also means that this physical layer switch port is independent and not connected to other ports. For a port group of a physical layer switch, there are two or more members in the structure of the data structure used; when there are two members in the structure, it also means that these two physical layer switch ports are connected.
7. An automated test method for power information and communication equipment, characterized in that, Applying the power information communication device automation test system as described in claim 1, comprising: Forming a local area network by connecting the power information communication device under test, test instruments, and the power information communication device automation test system through a physical layer switch. Pre-configuring test cases with unique identifiers on the test software system and supporting multi-user parallel testing. For test cases corresponding to different test devices, perform operations of occupying and releasing physical switch ports by calling the physical layer switch API interface. When multi-user parallel testing is carried out, based on the multi-tenant task scheduling mechanism of the disassembled task state machine, tasks are allocated and received.
Citation Information
Patent Citations
Distributed test method, system and test server
CN101447892A
Automated testing platform and testing method of Android mobile-applications
CN107315683A
Local micropower wireless interconnection and intercommunication test system in electricity consumption information acquisition system
CN111210606A