Method and system for testing communication system
Through container technology, simulated network elements are generated, and a communication link with the network elements of the communication system under test is established, which solves the problems of network element software version consistency and abnormal scenario triggering difficulties in the existing technology, and realizes efficient and accurate testing of the communication system.
Patent Information
- Application Number
- PCT/CN2024/131060
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-27
- Filing Date
- 2024-11-08
- Publication Date
- 2025-06-05
AI Technical Summary
In the existing communication system testing methods, it is difficult to ensure the consistency of the software version using real network elements, and it is difficult to trigger abnormal scenarios; while test tools that simulate multiple network elements have high stability requirements, low testing efficiency and cannot support the testing of multiple network elements.
The container that simulates network elements is generated through container technology, a communication link with the network elements of the communication system under test is established, message interaction is controlled according to preset test cases, and received message messages are tested to achieve sufficient and effective testing of the communication system.
The ability to independently test different network elements is realized, and the test is closer to the real scenario, ensuring the adequacy and effectiveness of the test, improving the testing efficiency and accuracy, and supporting various types of network element tests.
Smart Images

Figure CN2024131060_05062025_PF_FP_ABST
Abstract
Description
A communication system testing method and system
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on the Chinese patent application with application number 202311595569.2 and application date of November 27, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field
[0003] The present application relates to the field of communication technology, and in particular to a testing method and system for a communication system. Background Art
[0004] With the development of communication technology, communication systems have continuously evolved from 2G to 5G. End-to-end communication systems composed of various network elements are applied to numerous industries to meet customers' business needs. An end-to-end communication system typically involves multiple network elements, which communicate using different communication protocols.
[0005] There are two common approaches to automated testing. One involves using real network elements to build an end-to-end environment, executing test scripts on the terminal side and inspecting the returned messages. This approach requires obtaining the software versions of each network element in advance. Testers then install the software versions, build an end-to-end test environment, and run automated testing tools on the terminal side. In the other approach, automated testing tools simultaneously simulate the roles of multiple network elements, communicating with the tested network element to test message transmission and reception.
[0006] However, the inventors have discovered that the existing technology has at least the following problems: In the first solution, when using real network elements to build an end-to-end automated testing solution, it is necessary to ensure that stable software versions of each network element are prepared in advance. However, in general, each network element is developed by a different team, and some network elements are even developed by external companies. It is difficult to ensure that stable business services can be provided according to the R&D plan. It is difficult to troubleshoot problems and the delivery-related costs are very high. In addition, since the connection is to real network elements, it is difficult to trigger the test of some abnormal scenarios. In the second solution, an automated testing tool is used to simulate multiple network elements at the same time. The networking method is very different from the actual networking. Some test scenarios cannot be constructed. In addition, this solution has high requirements for the stability of the test tool and the test PC. Once the tool runs incorrectly, it cannot be automatically recovered, which affects the test efficiency. In addition, this type of test tool usually only supports testing one type of network element. Testing different network elements requires the installation of multiple test tools.
[0007] Summary of the Invention
[0008] The purpose of the embodiments of the present application is to provide a testing method and system for a communication system, which can independently test different network elements of the communication system by simulating network elements in the communication system through containers, and the testing is closer to real-world scenarios, ensuring the adequacy and effectiveness of the testing.
[0009] To achieve the above objectives, an embodiment of the present application provides a method for testing a communication system, comprising:
[0010] Generate a container for simulating a network element in the communication system under test based on container technology to construct a simulated network element;
[0011] Establishing a communication link between the simulated network element and the network element under test in the communication system under test;
[0012] Controlling message interaction between the simulated network element and the tested network element according to a preset test case;
[0013] When the simulated network element receives the message message sent by the tested network element, obtaining the message message received by the simulated network element;
[0014] The message is tested to obtain a test result of the communication system under test.
[0015] As an improvement to the above solution, the simulated network element includes a transmitting end network element and a receiving end network element; then establishing a communication link between the simulated network element and the network element under test in the communication system under test includes:
[0016] Controlling the transmitting network element to send a request message for establishing a communication link to the network element under test at the opposite end, and completing the establishment of the communication link between the transmitting network element and the network element under test after receiving a response message from the network element under test;
[0017] The listening port of the receiving network element is started, and a response message is returned when a request message for establishing a communication link is received from the tested network element at the opposite end, thereby completing the establishment of the communication link between the receiving network element and the tested network element.
[0018] As an improvement to the above solution, the simulated network element includes a transmitting network element and a receiving network element; and controlling the message interaction between the simulated network element and the network element under test according to a preset test case includes:
[0019] Determining, according to a preset test case, a tested network element at the opposite end of the transmitting network element and a first message packet to be sent, and controlling the transmitting network element to send the first message packet to the tested network element at the opposite end; and receiving a second message packet returned by the tested network element at the opposite end in response to the first message packet;
[0020] The receiving end network element is controlled to receive a third message packet sent by the network element under test at the opposite end; and in response to the third message packet, a fourth message packet is returned to the network element under test at the opposite end.
[0021] As an improvement to the above solution, a communication protocol stack is integrated in the simulation network element, and the communication protocol stack supports multiple protocol interfaces; the first message packet can be found by searching for the corresponding first message packet name and a preset message template;
[0022] Then, determining the tested network element at the opposite end of the transmitting network element and the first message packet to be sent according to a preset test case, and controlling the transmitting network element to send the first message packet to the tested network element at the opposite end, includes:
[0023] Determine, according to a preset test case, a tested network element at the opposite end of the transmitting network element and a first message message name of the first message message to be sent;
[0024] Controlling the sending end network element to search for a corresponding preset message template according to the name of the first message packet, and generate the first message packet;
[0025] A target protocol interface is determined according to the network element type of the network element under test at the opposite end, and the first message packet is protocol-encapsulated through the communication protocol stack and then sent to the network element under test at the opposite end through the target protocol interface.
[0026] As an improvement to the above solution, determining the tested network element at the opposite end of the transmitting network element and the name of the first message message to be sent according to a preset test case includes:
[0027] Obtain a preset test case, and determine, based on the test case, a simulated network element serving as a sending network element, a destination address of a tested network element at the opposite end of the sending network element, and a first message message name of a first message message to be sent;
[0028] Establishing a control signaling channel with the sending network element according to the address of the sending network element;
[0029] generating control signaling according to the destination address of the tested network element at the opposite end of the transmitting network element and the name of the first message, and sending the destination address and the first message name to the transmitting network element through the control signaling channel;
[0030] The sending end network element is controlled to search for the tested network element at the opposite end according to the destination address.
[0031] As an improvement to the above solution, a communication protocol stack is integrated into the simulation network element, and the communication protocol stack supports multiple protocol interfaces; the third message packet can be found by searching for the corresponding third message packet name and a preset message template;
[0032] The controlling the receiving-end network element to receive the third message sent by the tested network element of the opposite end includes:
[0033] Controlling the receiving end network element to receive a buffered message sent by the tested network element of the opposite end, and performing protocol depacketization on the buffered message through the communication protocol stack to parse and obtain the third message packet name;
[0034] According to the name of the third message, the corresponding preset message template is searched to generate the third message.
[0035] As an improvement to the above solution, the number of the simulated network elements is more than one, and the simulated network elements are deployed in a distributed manner; each of the simulated network elements corresponds to a topic tag, and the topic tag is used to represent the source of the message message;
[0036] Then, when the simulated network element receives the message message sent by the tested network element, obtaining the message message received by the simulated network element includes:
[0037] When any of the simulated network elements receives a message message sent by the tested network element, matching the message message with a corresponding topic tag according to the topic tag corresponding to the simulated network element;
[0038] Get all messages matching the subject tag.
[0039] As an improvement to the above solution, the method of generating a container for simulating a network element in a communication system based on container technology to construct a simulated network element includes:
[0040] Generate container images based on container technology;
[0041] Create a corresponding container according to the container image;
[0042] According to the pre-configured network element type, the network element in the communication system under test is simulated by the container to construct a simulated network element.
[0043] The present application also provides a communication system test system, including a network element manager, a task scheduler, and a use case execution engine:
[0044] The network element manager is configured to generate a container for simulating a network element in the communication system under test based on container technology to construct a simulated network element; and to establish a communication link between the simulated network element and the network element under test in the communication system under test;
[0045] The task scheduler is configured to control message interaction between the simulated network element and the network element under test according to a preset test case; and when the simulated network element receives a message sent by the network element under test, obtain the message received by the simulated network element and send it to the use case execution engine;
[0046] The use case execution engine is used to test the message packet and obtain a test result of the communication system under test.
[0047] As an improvement to the above solution, the test system further includes a message queue; the number of the simulated network elements is more than one, and the simulated network elements are deployed in a distributed manner; each of the simulated network elements corresponds to a topic tag, and the topic tag is used to represent the source of the message message;
[0048] Then, when the simulated network element receives the message message sent by the tested network element, obtaining the message message received by the simulated network element and sending it to the use case execution engine includes:
[0049] When any of the simulated network elements receives a message sent by the tested network element, the message queue matches the corresponding topic tag for the message according to the topic tag corresponding to the simulated network element, and sends all message messages that have been matched with the topic tag to the task scheduler;
[0050] The task scheduler sends all message packets that have passed through the message queue for subject tag matching to the use case execution engine.
[0051] Compared with the prior art, the test method and system of the communication system disclosed in the present application create a simulated network element in the form of a container image for testing the communication system, and propose a technical solution for controlling message sending and checking response messages, support inter-container communication protocols, meet the testing requirements of simulating end-to-end communication systems, support the distributed deployment of a large number of simulated network elements on multiple servers, and build corresponding test scenarios according to requirements, so as to be closer to the real network environment, meet the requirements of performance testing, and ensure the adequacy and effectiveness of the test. In addition, by building simulated network elements through container images, different network elements in the communication system can be flexibly simulated. Through a set of test frameworks, multiple types of network element tests can be implemented, with high testing efficiency and functional decoupling. Problem services can be monitored and restarted separately to avoid the failure of all test tasks. In addition, due to the distributed deployment of simulated network elements, message queues are set to implement label classification of message packets received by each simulated network element, avoiding the problem of message confusion caused by the task scheduler processing the sending and receiving operations of multiple network elements at the same time, ensuring the accuracy of the message packet inspection results, and improving the accuracy of the communication system test. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] FIG1 is a flow chart of a method for testing a communication system according to an embodiment of the present application;
[0053] FIG2 is a schematic diagram of a framework of a test system used in the test method in an embodiment of the present application;
[0054] FIG3 is a schematic diagram showing the principle of a method for testing a communication system according to an embodiment of the present application;
[0055] FIG4 is a schematic structural diagram of a test system for a communication system provided in an embodiment of the present application;
[0056] FIG5 is a schematic structural diagram of a test device for a communication system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0058] In the description of this application, it should be understood that the terms "center", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on this application.
[0059] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. Throughout this application, unless otherwise specified, "plurality" means two or more.
[0060] In the description of this application, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in this application based on the specific circumstances.
[0061] 1 is a flow chart of a method for testing a communication system provided in an embodiment of the present application. The method for testing a communication system provided in an embodiment of the present application includes steps S11 to S15:
[0062] S11. Generate a container for simulating a network element in the communication system under test based on container technology to construct a simulated network element;
[0063] S12. Establishing a communication link between the simulated network element and the network element under test in the communication system under test;
[0064] S13. Controlling message interaction between the simulated network element and the tested network element according to a preset test case;
[0065] S14. When the simulated network element receives the message message sent by the tested network element, obtain the message message received by the simulated network element;
[0066] S15: Test the message to obtain a test result of the tested communication system.
[0067] Referring to FIG2 , which is a schematic diagram of the framework of the test system applied by the test method in the embodiment of the present application, the test method of the communication system in the embodiment of the present application is applied to the test system of the communication system, and the test system includes a network element manager, a task scheduler, and a use case execution engine. Steps S11 and S12 are mainly performed by the network element manager, that is, the network element manager is used to generate a container for simulating the network element in the communication system under test based on the container technology to construct a simulated network element; and establish a communication link between the simulated network element and the tested network element in the communication system under test; Steps S13 and S14 are mainly performed by the task scheduler, that is, the task scheduler is used to control the message interaction between the simulated network element and the tested network element according to the preset test case; and when the simulated network element receives the message message sent by the tested network element, the simulated network element obtains the message message received by the simulated network element and sends it to the use case execution engine; Step S15 is mainly performed by the use case execution engine, that is, the use case execution engine is used to test the message message to obtain the test result of the communication system under test.
[0068] Specifically, the network element manager is responsible for the generation, destruction, and service logic processing of simulated network elements. The network element manager generates containers based on container technology and uses them to simulate network elements in the communication system under test. The number of simulated network elements can be more than one, and they can be distributed across multiple servers as needed.
[0069] The use case execution engine initializes and generates corresponding instances based on the test resources and configuration information specified by the user to provide corresponding test cases. The use case execution engine manages the life cycle of the test cases, is responsible for the initialization, execution and final cleanup of the test cases, and can capture unhandled exceptions in the test cases so that they do not affect the execution of other use cases.
[0070] During the testing process of the communication system, when the use case execution engine runs the test script, the task scheduler controls the simulated network element in the container to communicate and interact with the network element under test, obtains the message packets received by the simulated network element, and sends them to the user execution engine for inspection, thereby implementing the test of the network element under test and completing the test of the communication system.
[0071] By adopting the technical means of the embodiments of the present application, the test framework for testing the communication system creates simulated network elements in the form of container images, which can support the distributed deployment of a large number of simulated network elements on multiple servers, and build corresponding test scenarios according to needs, including abnormal scenarios, etc., so as to be closer to the real network environment, meet the needs of performance testing, and ensure the adequacy and effectiveness of the test. In addition, by building simulated network elements through container images, different network elements in the communication system can be flexibly simulated. Various types of network element tests can be implemented through a set of test frameworks, with high test efficiency and functional decoupling. The problematic services can be monitored and restarted separately to avoid the failure of all test tasks.
[0072] As a preferred implementation, based on the above embodiment, step S11, that is, generating a container for simulating a network element in a communication system based on container technology to construct a simulated network element, includes steps S111 to S113:
[0073] S111. Generate container images based on container technology;
[0074] S112. Create a corresponding container according to the container image;
[0075] S113 . According to the pre-configured network element type, the network element in the communication system under test is simulated by the container to construct a simulated network element.
[0076] In an embodiment of the present application, the communication system further includes a configuration center for unified configuration management. Each simulated network element is a service application. During the construction of the simulated network element, the service application is packaged into a Docker image based on information such as the simulated network element type pre-configured by the configuration center. A container is then created, and port mapping of the image is enabled for communication with other network elements, thereby constructing the simulated network element.
[0077] As an example, the test framework of the embodiment of the present application is developed based on the Spring boot framework. In order to package the service application into a Docker image, the SpringBoot project is first compiled and built to generate a jar in the target directory; a new dependency folder is created in the target directory, and the jar is unzipped to the dependency folder; and a Dockerfile file is created, which contains a series of instructions that will be executed when building the image. The network element manager reads the simulated network element type configured in the configuration center, queries the corresponding Dockerfile file, executes the docker build command to build the Docker image, and then executes the docker run command to run the image to create a container. According to the external interface provided by the simulated network element, the port mapping of the image is enabled for communication with other network elements to build a simulated network element.
[0078] It's important to note that simulated network elements run in containers, isolated from other programs. Multiple instances of simulated network elements can be created in batches based on testing needs. When hardware resources are limited in the deployment environment, they can be distributed across other servers to meet performance testing requirements. At the end of the test, the network element manager destroys the container, freeing up resources.
[0079] Optionally, the configuration center saves the configuration items in a file in the form of key-value pairs. The main configuration parameters include: network element type, network element ID, local IP address, local port number, peer IP address, peer port number and protocol type, etc. The data types corresponding to each configuration parameter are string, integer, string, integer, string, integer and string respectively.
[0080] As a preferred embodiment, the simulated network element is divided into a transmitting network element and a receiving network element; then step S12, i.e., establishing a communication link between the simulated network element and the network element under test in the communication system under test, includes steps S121 and S1212:
[0081] S121. Control the transmitting network element to send a request message for establishing a communication link to the network element under test at the opposite end, and complete the establishment of the communication link between the transmitting network element and the network element under test after receiving a response message from the network element under test;
[0082] S122: Start the listening port of the receiving network element, and return a response message when receiving a request message for establishing a communication link sent by the measured network element at the opposite end, thereby completing the establishment of the communication link between the receiving network element and the measured network element.
[0083] In an embodiment of the present application, in order to solve the communication problem between network elements, it is necessary to establish a communication link between the simulated network element and the real network element in the communication system under test. After the network element is initialized, the network element manager reads the link configuration data from the configuration center and establishes a communication link between the simulated network element and the opposite network element. There are two situations: when the simulated network element acts as a client, it automatically sends a request message for establishing a communication link to the opposite network element under test after startup, and completes the establishment of the communication link after receiving a successful response; when the simulated network element acts as a server, it starts port monitoring, and after receiving the request message for establishing a communication link sent by the opposite network element under test, returns a response message, thereby realizing the establishment of a communication link between network elements.
[0084] By adopting the technical means of the embodiments of the present application, a communication link with the network element under test at the opposite end is realized according to the different types of simulated network elements constructed, so as to realize message interaction between the simulated network element and the network element under test and complete the test of the network element under test.
[0085] As a preferred implementation scheme, step S13, i.e., controlling the message interaction between the simulated network element and the tested network element according to the preset test case, includes steps S131 and S132:
[0086] S131. Determine, based on a preset test case, a tested network element at the opposite end of the transmitting network element and a first message packet to be sent, and control the transmitting network element to send the first message packet to the tested network element at the opposite end; and receive a second message packet returned by the tested network element at the opposite end in response to the first message packet.
[0087] S132: Control the receiving network element to receive a third message packet sent by the network element under test at the opposite end; and return a fourth message packet to the network element under test at the opposite end in response to the third message packet.
[0088] See Figure 3, which is a schematic diagram of the principles of the testing method of the communication system in the embodiment of the present application. In the embodiment of the present application, the corresponding simulated network element is constructed by the network element manager according to the test requirements, and a communication link between the simulated network element and the network element under test is established. The task scheduler further controls the message interaction between the simulated network element and the network element under test, and subsequently tests the network element under test by detecting the messages.
[0089] As an example, assume that simulated network element 1 and simulated network element 2 are currently constructed, where simulated network element 1 is a transmitting network element and simulated network element 2 is a receiving network element. Regarding the interaction between simulated network element 1 and the network element under test, the network element under test acts as the receiving end. According to a preset test case, the task scheduler controls simulated network element 1 to send a first message packet REQ1 to the network element under test. The network element under test responds to the first message packet and returns a second message packet RSP1, which is received by simulated network element 1. Regarding the interaction between simulated network element 2 and the network element under test, the network element under test acts as the transmitting end. The network element under test sends a third message packet REQ2 to simulated network element 2, which is received by simulated network element 2. In response to the third message packet, the simulated network element 2 returns a fourth message packet RSP2.
[0090] It can be understood that the above scenarios are only examples. In actual applications, multiple simulated network elements and their network element types can be set according to needs, which will not affect the beneficial effects achieved by this application.
[0091] Preferably, a communication protocol stack is integrated in the simulation network element, and the communication protocol stack supports multiple protocol interfaces; the first message packet can be found by searching for the corresponding first message packet name and a preset message template.
[0092] Then step S131, i.e., determining the tested network element at the opposite end of the transmitting network element and the first message packet to be sent according to the preset test case, and controlling the transmitting network element to send the first message packet to the tested network element at the opposite end, includes:
[0093] Determine, according to a preset test case, a tested network element at the opposite end of the transmitting network element and a first message message name of the first message message to be sent;
[0094] Controlling the sending end network element to search for a corresponding preset message template according to the name of the first message packet, and generate the first message packet;
[0095] A target protocol interface is determined according to the network element type of the network element under test at the opposite end, and the first message packet is protocol-encapsulated through the communication protocol stack and then sent to the network element under test at the opposite end through the target protocol interface.
[0096] In this embodiment, a communication protocol stack is integrated into the simulated network element, supporting multiple protocol interfaces. Message templates are also provided to define various messages in the communication protocol. Protocol messages are encoded according to ASN encoding rules and saved as .asn files. File conversion tools are used to convert the .asn files into .msg files, allowing them to be read by the simulated network element.
[0097] When the network element service needs to send a message, it determines the protocol interface for sending data based on the type of the opposite network element, and then determines whether the link status corresponding to the protocol interface is normal. After finding the corresponding message template through the message name, it sends the message. The communication protocol stack encapsulates the message and sends it to the opposite network element.
[0098] Similarly, the third message message can be found by searching for the corresponding third message message name and the preset message template.
[0099] The controlling the receiving-end network element to receive the third message sent by the tested network element of the opposite end includes:
[0100] Controlling the receiving end network element to receive a buffered message sent by the tested network element of the opposite end, and performing protocol depacketization on the buffered message through the communication protocol stack to parse and obtain the third message packet name;
[0101] According to the name of the third message, the corresponding preset message template is searched to generate the third message.
[0102] In this embodiment of the present application, when a network element service needs to receive a message, it reads the cached message from the receive cache module. The communication protocol stack first performs protocol unpacking, then determines the message type based on the message header field, parses the message according to the message type, reads the message name, searches for the corresponding message template, and associates the parsed binary code stream with the element name defined in the message template, facilitating verification during testing. Through these steps, message exchange between network elements is achieved.
[0103] By adopting the technical means of the embodiments of the present application, the test framework for testing the communication system creates simulated network elements in the form of container images, supports communication protocols between containers, meets the testing requirements of simulated end-to-end communication systems, supports the distributed deployment of a large number of simulated network elements on multiple servers, and constructs corresponding test scenarios according to requirements, thereby being closer to the real network environment and ensuring the adequacy and effectiveness of the test.
[0104] As a preferred implementation, in step S132, that is, determining the tested network element at the opposite end of the transmitting network element and the name of the first message message to be sent according to the preset test case, includes:
[0105] Obtain a preset test case, and determine, based on the test case, a simulated network element serving as a sending network element, a destination address of a tested network element at the opposite end of the sending network element, and a first message message name of a first message message to be sent;
[0106] Establishing a control signaling channel with the sending network element according to the address of the sending network element;
[0107] generating control signaling according to the destination address of the tested network element at the opposite end of the transmitting network element and the name of the first message, and sending the destination address and the first message name to the transmitting network element through the control signaling channel;
[0108] The sending end network element is controlled to search for the tested network element at the opposite end according to the destination address.
[0109] It should be noted that since the traditional test framework simulates network elements centrally deployed on the same host, no separate scheduling is required. In the embodiment of the present application, the simulated network elements are distributedly deployed in the form of containers and can be distributed on multiple hosts, which is closer to the deployment form of real network elements. However, it is necessary to solve the problem of how to control each simulated network element to send messages.
[0110] The embodiment of the present application controls each simulated network element to send messages through a task scheduler. When the test script requires a simulated network element as a sending network element to send data, the task scheduler first determines the simulated network element as the sending network element and checks whether the control signaling channel with the sending network element has been established. If not, the address of the simulated network element is searched in the service registration center, a control signaling channel is established based on the TCP protocol, and then the control signaling is sent. The signaling content is: {source address, destination address, message message name}, wherein the source address is the address information of the sending network element, the destination address is the address information of the tested network element on the opposite end of the sending network element, and the message message name corresponds to the message message to be sent. After receiving the control signaling, the sending network element searches for the type of the tested network element on the opposite end according to the destination address to determine the protocol interface for sending data, and implements the message message name and the preset message template to find the corresponding message message, and sends the message message through the protocol interface.
[0111] As a preferred embodiment, each of the simulated network elements corresponds to a topic tag, and the topic tag is used to represent the message source of the message. Then step S14, that is, when the simulated network element receives the message sent by the tested network element, obtaining the message received by the simulated network element includes:
[0112] When any of the simulated network elements receives a message message sent by the tested network element, the corresponding topic tag is matched for the message message according to the topic tag corresponding to the simulated network element; and all message messages matched by the topic tag are obtained.
[0113] It should be noted that since there can be multiple simulated network elements in the embodiment of the present application, and they are distributed and deployed on multiple hosts in the form of containers, it is also necessary to solve the problem of how to check the message message after the simulated network element receives the message message sent by the network element under test.
[0114] Since the inspection of the message packets sent by the network element under test in the test script is flexibly set according to the checkpoints of the test case, it is not suitable for implementation in the simulated network element container. If it is directly returned to the task scheduler, the task scheduler needs to process the sending and receiving operations of multiple network elements at the same time, which may easily lead to message confusion and make it impossible to determine the source of each message packet.
[0115] Therefore, in this embodiment of the present application, the test system also sets up a message queue RabbitMQ, which includes an Exchange module and a Queue module. The Exchange and Queue are associated in the message queue through a BindingKey, so that RabbitMQ knows how to correctly route messages to the specified Queue. Each simulated network element is a producer in the message queue and corresponds to a topic label. The topic label is used as the BindingKey to associate the Exchange and Queue.
[0116] When any of the simulated network elements receives a message sent by the network element under test, the simulated network element sends the message to a preset message queue. The message queue matches the message with a corresponding subject tag based on the subject tag corresponding to the simulated network element. The task scheduler obtains all message messages that have been matched with subject tags through the message queue and sends them to the use case execution engine. Upon receiving all message messages, the use case execution engine can determine the source of the message based on the matching subject tag of each message message, and perform a correctness check on the message message to complete the test of the network element under test.
[0117] As an example, referring to Figure 3, after the simulated network element receives the message message sent by the tested network element at the opposite end (including the second message message RSP1 returned after the tested network element responds, or the third message message REQ2 sent actively), it parses the message and encapsulates the parsed message name and information element in JSON format. When the simulated network element sends the message message to the Exchange module, it sets the routingkey to the subject corresponding to the simulated network element. When the BindingKey and RoutingKey match, the message will be routed to the corresponding Queue queue. The task scheduler monitors each queue, uses different queues to identify the source of the message, and then identifies the corresponding message message by the message message name. It reads the information element according to the check items in the test script for correctness check to implement the test of the tested network element.
[0118] By adopting the technical means of the embodiments of the present application, the test framework for testing the communication system creates simulated network elements in the form of container images, and proposes a technical solution for controlling message sending and checking response messages. This can support the distributed deployment of a large number of simulated network elements on multiple servers, and build corresponding test scenarios according to requirements, thereby being closer to the real network environment and meeting the needs of performance testing. In addition, due to the distributed deployment of simulated network elements, the label classification of the message packets received by each simulated network element is achieved by setting up a message queue, avoiding the problem of message confusion caused by the task scheduler processing the sending and receiving operations of multiple network elements at the same time, ensuring the accuracy of the message packet inspection results, and improving the accuracy of the communication system test.
[0119] As a preferred embodiment, based on any of the above embodiments, after steps S11 to S15, the method further includes step S16:
[0120] S16: Record and display the test results of the communication system under test.
[0121] In an embodiment of the present application, the test system also includes a log reporting module for recording and displaying the test results of the communication system under test. Specifically, the log of the test framework is managed through centralized registration, and the logs registered using the modules are uniformly output to the log file. The test cases also need to centrally register the logs, and the relevant modules used by the test cases are recorded in the log where the test cases are located, and the logs generated during the execution of the test cases are output. The test report uses a tree mapping method to record the test case number, test steps and test results.
[0122] 4 is a schematic diagram of the structure of a communication system test system provided in an embodiment of the present application. The embodiment of the present application provides a communication system test system 20, including a network element manager 21, a task scheduler 22, and a use case execution engine 23:
[0123] The network element manager 21 is configured to generate a container for simulating a network element in the communication system under test based on container technology to construct a simulated network element; and to establish a communication link between the simulated network element and the network element under test in the communication system under test;
[0124] The task scheduler 22 is configured to control message interaction between the simulated network element and the network element under test according to a preset test case; and when the simulated network element receives a message sent by the network element under test, obtain the message received by the simulated network element and send it to the use case execution engine;
[0125] The use case execution engine 23 is used to test the message packet and obtain a test result of the communication system under test.
[0126] By adopting the technical means of the embodiments of the present application, the test framework for testing the communication system creates simulated network elements in the form of container images, which can support the distributed deployment of a large number of simulated network elements on multiple servers, and build corresponding test scenarios according to needs, including abnormal scenarios, etc., so as to be closer to the real network environment, meet the needs of performance testing, and ensure the adequacy and effectiveness of the test. In addition, by building simulated network elements through container images, different network elements in the communication system can be flexibly simulated. Various types of network element tests can be implemented through a set of test frameworks, with high test efficiency and functional decoupling. The problematic services can be monitored and restarted separately to avoid the failure of all test tasks.
[0127] As a preferred embodiment, the test system further includes a message queue; the number of the simulated network elements is more than one, and the simulated network elements are deployed in a distributed manner; each of the simulated network elements corresponds to a topic tag, and the topic tag is used to represent the source of the message message;
[0128] Then, when the simulated network element receives the message message sent by the tested network element, obtaining the message message received by the simulated network element and sending it to the use case execution engine includes:
[0129] When any of the simulated network elements receives a message sent by the tested network element, the message queue matches the corresponding topic tag for the message according to the topic tag corresponding to the simulated network element, and sends all message messages that have been matched with the topic tag to the task scheduler;
[0130] The task scheduler sends all message packets that have passed through the message queue for subject tag matching to the use case execution engine.
[0131] As a preferred implementation manner, the simulated network element includes a transmitting end network element and a receiving end network element; then establishing a communication link between the simulated network element and the network element under test in the communication system under test includes:
[0132] Controlling the transmitting network element to send a request message for establishing a communication link to the network element under test at the opposite end, and completing the establishment of the communication link between the transmitting network element and the network element under test after receiving a response message from the network element under test;
[0133] The listening port of the receiving network element is started, and a response message is returned when a request message for establishing a communication link is received from the tested network element at the opposite end, thereby completing the establishment of the communication link between the receiving network element and the tested network element.
[0134] As a preferred implementation manner, the simulated network element includes a transmitting end network element and a receiving end network element; then, controlling the message interaction between the simulated network element and the network element under test according to a preset test case includes:
[0135] Determining, according to a preset test case, a tested network element at the opposite end of the transmitting network element and a first message packet to be sent, and controlling the transmitting network element to send the first message packet to the tested network element at the opposite end; and receiving a second message packet returned by the tested network element at the opposite end in response to the first message packet;
[0136] The receiving end network element is controlled to receive a third message packet sent by the network element under test at the opposite end; and in response to the third message packet, a fourth message packet is returned to the network element under test at the opposite end.
[0137] As a preferred embodiment, a communication protocol stack is integrated in the simulation network element, and the communication protocol stack supports multiple protocol interfaces; the first message packet can be found by searching the corresponding first message packet name and a preset message template;
[0138] Then, determining the tested network element at the opposite end of the transmitting network element and the first message packet to be sent according to a preset test case, and controlling the transmitting network element to send the first message packet to the tested network element at the opposite end, includes:
[0139] Determine, according to a preset test case, a tested network element at the opposite end of the transmitting network element and a first message message name of the first message message to be sent;
[0140] Controlling the sending end network element to search for a corresponding preset message template according to the name of the first message packet, and generate the first message packet;
[0141] A target protocol interface is determined according to the network element type of the network element under test at the opposite end, and the first message packet is protocol-encapsulated through the communication protocol stack and then sent to the network element under test at the opposite end through the target protocol interface.
[0142] As a preferred implementation manner, the determining, according to a preset test case, the tested network element of the opposite end of the transmitting network element and the name of the first message message to be sent includes:
[0143] Obtain a preset test case, and determine, based on the test case, a simulated network element serving as a sending network element, a destination address of a tested network element at the opposite end of the sending network element, and a first message message name of a first message message to be sent;
[0144] Establishing a control signaling channel with the sending network element according to the address of the sending network element;
[0145] generating control signaling according to the destination address of the tested network element at the opposite end of the transmitting network element and the name of the first message, and sending the destination address and the first message name to the transmitting network element through the control signaling channel;
[0146] The sending end network element is controlled to search for the tested network element at the opposite end according to the destination address.
[0147] As a preferred embodiment, the third message message can be found by searching the corresponding third message message name and a preset message template;
[0148] The controlling the receiving-end network element to receive the third message sent by the tested network element of the opposite end includes:
[0149] Controlling the receiving end network element to receive a buffered message sent by the tested network element of the opposite end, and performing protocol depacketization on the buffered message through the communication protocol stack to parse and obtain the third message packet name;
[0150] According to the name of the third message, the corresponding preset message template is searched to generate the third message.
[0151] As a preferred embodiment, the method of generating a container for simulating a network element in a communication system based on container technology to construct a simulated network element includes:
[0152] Generate container images based on container technology;
[0153] Create a corresponding container according to the container image;
[0154] According to the pre-configured network element type, the network element in the communication system under test is simulated by the container to construct a simulated network element.
[0155] By adopting the technical means of the embodiments of the present application, the test framework for testing the communication system creates simulated network elements in the form of container images, and proposes technical solutions for controlling message sending and checking response messages, supporting communication protocols between containers, meeting the testing requirements of simulating end-to-end communication systems, supporting the distributed deployment of a large number of simulated network elements on multiple servers, and building corresponding test scenarios according to requirements, thereby being closer to the real network environment and meeting the requirements of performance testing. In addition, due to the distributed deployment of simulated network elements, the label classification of message packets received by each simulated network element is realized by setting up message queues, avoiding the problem of message confusion caused by the task scheduler processing the sending and receiving operations of multiple network elements at the same time, ensuring the accuracy of the message packet inspection results, and improving the accuracy of the communication system test.
[0156] Refer to Figure 5, which is a structural diagram of a communication system testing device provided in an embodiment of the present application. The embodiment of the present application also provides a communication system testing device 30, including a processor 31, a memory 32, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the communication system testing method described in any one of the above embodiments.
[0157] It should be noted that the communication system testing device provided in the embodiment of the present application is used to execute all the process steps of the communication system testing method of the above embodiment. The working principles and beneficial effects of the two correspond one to one, and therefore will not be repeated.
[0158] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the communication system testing method as described in any one of the above embodiments.
[0159] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0160] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications are also considered to be within the scope of protection of the present application.
Claims
1. A communication system testing method, characterized in that: include: Generate a container for simulating a network element in the communication system under test based on the container technology to construct a simulated network element; Establishing a communication link between the simulated network element and the network element under test in the communication system under test; According to a preset test case, controlling the message interaction between the simulated network element and the tested network element; When the simulated network element receives the message message sent by the tested network element, obtaining the message message received by the simulated network element; The message is tested to obtain a test result of the communication system under test.
2. The communication system testing method according to claim 1, characterized in that: The simulated network element includes a transmitting end network element and a receiving end network element; then the establishing of a communication link between the simulated network element and the network element under test in the communication system under test includes: Controlling the transmitting end network element to send a request message for establishing a communication link to the network element under test at the opposite end of the transmitting end network, and completing the establishment of the communication link between the transmitting end network element and the network element under test after receiving a response message from the network element under test; and / or The listening port of the receiving network element is started, and a response message is returned upon receiving a request message for establishing a communication link sent by the network element under test at the opposite end of the receiving network element, thereby completing the establishment of a communication link between the receiving network element and the network element under test.
3. The communication system testing method according to claim 1, characterized in that: The simulated network element includes a transmitting end network element and a receiving end network element; then, according to a preset test case, controlling the message interaction between the simulated network element and the network element under test includes: According to a preset test case, determine the network element under test at the opposite end of the sending network element and the first message packet to be sent, and control the sending network element to send the first message packet to the network element under test at the opposite end; and receive a second message packet returned by the network element under test at the opposite end in response to the first message packet; and / or Control the receiving end network element to receive a third message packet sent by a network element under test at the opposite end of the receiving end network element; and return a fourth message packet to the network element under test at the opposite end in response to the third message packet.
4. The communication system testing method according to claim 3, characterized in that: The simulation network element integrates a communication protocol stack, and the communication protocol stack supports multiple protocol interfaces; the first message message is obtained by searching the corresponding first message message name and a preset message template; Then, according to the preset test case, determining the network element under test at the opposite end of the sending network element and the first message packet to be sent, and controlling the sending network element to send the first message packet to the network element under test at the opposite end, includes: According to the preset test case, determining the tested network element of the opposite end of the sending network element and the first message message name of the first message message to be sent; Control the sending end network element to search for a corresponding preset message template according to the name of the first message message, and generate the first message message; According to the network element type of the network element under test at the opposite end, a target protocol interface is determined, and after the first message packet is protocol-encapsulated through the communication protocol stack, it is sent to the network element under test at the opposite end through the target protocol interface.
5. The communication system testing method according to claim 4, characterized in that: The determining, according to the preset test case, the network element under test of the opposite end of the transmitting end network element and the first message message name of the first message message to be sent includes: Obtain the preset test case, and determine, according to the test case, a simulated network element as a sending end network element, a destination address of a tested network element at the opposite end of the sending end network element, and a first message message name of a first message message to be sent; Establishing a control signaling channel with the sending end network element according to the address of the sending end network element; Generate control signaling according to the destination address of the tested network element at the opposite end of the transmitting network element and the name of the first message packet, and send the destination address and the first message packet name to the transmitting network element through the control signaling channel; The sending end network element is controlled to search for the tested network element of the opposite end according to the destination address.
6. The communication system testing method according to claim 3, characterized in that: The simulation network element integrates a communication protocol stack, and the communication protocol stack supports multiple protocol interfaces; the third message message is obtained by searching the corresponding third message message name and a preset message template; The controlling the receiving end network element to receive a third message sent by a tested network element at the opposite end of the receiving end network element includes: Control the receiving end network element to receive the cache message sent by the tested network element of the opposite end, and perform protocol unpacking on the cache message through the communication protocol stack to parse and obtain the third message message name; According to the name of the third message, the corresponding preset message template is searched to generate the third message.
7. The communication system testing method according to any one of claims 1 to 6, characterized in that: The number of the simulated network elements is more than one, and the simulated network elements are deployed in a distributed manner; each of the simulated network elements corresponds to a topic label, and the topic label is used to represent the message source of the message; Then, when the simulated network element receives the message message sent by the tested network element, obtaining the message message received by the simulated network element includes: When any of the simulated network elements receives a message message sent by the network element under test, matching the message message with a corresponding topic tag according to the topic tag corresponding to the simulated network element; Get all messages matching the subject tag.
8. The communication system testing method according to claim 1, characterized in that: The method of generating a container for simulating a network element in a communication system based on container technology to construct a simulated network element includes: Generate container images based on container technology; Create a corresponding container according to the container image; According to the preconfigured network element type, the network element in the communication system under test is simulated through the container to construct the simulated network element.
9. A communication system test system, characterized in that: Includes network element manager, task scheduler and use case execution engine: The network element manager is used to generate a container for simulating a network element in the communication system under test based on the container technology, so as to construct a simulated network element; and, establishing a communication link between the simulated network element and the network element under test in the communication system under test; The task scheduler is used to control the message interaction between the simulated network element and the tested network element according to a preset test case; and when the simulated network element receives the message message sent by the tested network element, obtaining the message message received by the simulated network element and sending it to the use case execution engine; The use case execution engine is used to test the message packet to obtain a test result of the communication system under test.
10. The communication system test system according to claim 9, characterized in that: The test system further includes a message queue; the number of the simulated network elements is more than one, and the simulated network elements are deployed in a distributed manner; each of the simulated network elements corresponds to a topic label, and the topic label is used to characterize the message source of the message; Then, when the simulated network element receives the message message sent by the tested network element, obtaining the message message received by the simulated network element and sending it to the use case execution engine includes: When any of the simulated network elements receives a message sent by the tested network element, the message queue matches the corresponding topic tag for the message according to the topic tag corresponding to the simulated network element, and sends all the messages matched by the topic tag to the tested network element. The information message is sent to the task scheduler; The task scheduler sends all message packets that pass through the message queue for subject tag matching to the use case execution engine.
Citation Information
Patent Citations
Method and system for testing network element simulators
CN104796302A
Internet of Things performance test method and system
CN113079061A
Virtual network element test method and device, electronic equipment and readable storage medium
CN114745749A
Method, system and device for testing consistency of network protocols and electronic equipment
CN116668346A
Method and system for testing communication system
CN118828629A