Equipment testing method and server
By collecting and simulating file system messages and using macvlan technology to construct virtual clients, the complexity of file system testing under resource constraints is solved, and efficient multi-client scenario simulation and testing are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-28
AI Technical Summary
In file system testing, limited physical resources make it difficult to simulate a large number of client scenarios, resulting in high testing complexity and difficulty in fully verifying the robustness of the file system.
By collecting message information, constructing virtual clients using macvlan technology, and simulating multi-client scenarios through log replay and fuzzing, file system testing is conducted.
It reduces resource dependencies, simplifies file system testing complexity, and improves the comprehensiveness and accuracy of testing.
Smart Images

Figure CN121940326A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of communication technology, and in particular to a device testing method and a server. Background Technology
[0002] In the storage field, file storage plays a crucial role. Taking Ceph as an example, its distributed file system (CephFS) constructs a virtual shared file system through a metadata service layer (MDS) and an underlying RADOS object storage, providing access to users based on network protocols such as POSIX-compliant FUSE clients, NFS, or SMB. Files in the file system contain data (content) and metadata (attributes). In real-world production scenarios, metadata is diverse (e.g., creation time, permissions, extended attributes), and operations on single attributes are complex and varied (e.g., operations on file size may involve truncation, sparse file processing, appending, etc.). Furthermore, in practical applications, a large number of users may simultaneously access the same file system or even the same file, placing stringent requirements on distributed locking mechanisms and significantly increasing the testing complexity of the file system. In laboratory environments, limited by physical resources, systematically verifying the robustness of the file system under stress scenarios becomes a significant challenge. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this specification provides a device testing method and a server.
[0004] According to a first aspect of the embodiments of this specification, a device testing method is provided, the method comprising: Receive the access files sent by the client in sequence and obtain the message information of the access files; Based on the message information, a virtual client is constructed using virtualization; Simulate virtual clients sending access messages to themselves in sequence and perform tests.
[0005] The message information includes: source IP information, destination IP information, RPC header, and some or all of the NFS operation parameters.
[0006] The construction of a virtual client through virtualization includes: A virtual client is constructed based on the message information using macvlan.
[0007] The step of sequentially simulating virtual clients sending access messages to themselves and conducting tests includes: The order in which virtual clients send access messages is obtained by logging back; Send access messages to yourself in the order described and perform the test.
[0008] The method further includes, before simulating virtual clients sending access messages to themselves sequentially and conducting tests: The processed access message is obtained by fuzzing each field of the access message to be sent. Use the processed access messages to perform fuzzy message testing.
[0009] As can be seen from the above embodiments, by collecting, restoring, distorting, and modifying packets, and using network virtualization technology to simulate multiple clients, the network file system can be tested. Under certain scale testing conditions, this effectively reduces resource dependence and, from a simulation perspective, conditionally reduces the complexity of file system testing.
[0010] According to a second aspect of the embodiments of this specification, a server is provided, the server comprising: The receiving module is used to receive access files sent by the client in sequence and obtain the message information of the access files; The processing module is used to construct a virtual client through virtualization based on the message information; The sending module is used to simulate virtual clients sending access messages to itself in sequence and to perform tests.
[0011] The message information includes: source IP information, destination IP information, RPC header, and some or all of the NFS operation parameters.
[0012] Specifically, the processing module is used to construct a virtual client based on message information using macvlan.
[0013] Specifically, the sending module is used to obtain the order in which the virtual client sends access messages through log revisit; Send access messages to yourself in the order described and perform the test.
[0014] The sending module is further configured to obtain the processed access message by performing fuzzy processing on each field of the access message to be sent; Use the processed access messages to perform fuzzy message testing.
[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the description, serve to explain the principles of this specification.
[0017] Figure 1This is a schematic flowchart illustrating a device testing method according to an exemplary embodiment of this specification.
[0018] Figure 2 This is a schematic flowchart illustrating a device testing method according to an exemplary embodiment of this specification. Detailed Implementation
[0019] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification as detailed in the appended claims.
[0020] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0021] It should be understood that although the terms first, second, third, etc., may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0022] Currently, virtual machines are generated through cloud computing platforms such as OpenStack and VMware, resources are allocated to the virtual machines, and network shared file systems are accessed through normal client mounting processes. Alternatively, multiple virtual clients can be deployed through containerization technologies (such as Docker / Kubernetes), and toolchains (such as FIO's multi-threaded mode and VDbench's multi-client mode) can be used to simulate high-concurrency read and write operations.
[0023] However, in practical applications, the following problems exist: 1. The number of virtual machines that a single server can create is relatively limited. Generally, it is common for a physical server to virtualize dozens of virtual machines. If you want to simulate a larger number of clients, such as thousands, this test scenario will also be limited by the resources of the physical server.
[0024] 2. Due to the high complexity of file system traversal testing, it is almost impossible to perform traversal in actual testing, and missed tests often occur during testing activities.
[0025] As mentioned above, under the current network shared file system mechanism, the more files involved, the more file attributes involved in the operations, and the more clients accessing the system simultaneously, the higher the complexity of the file system in handling these operations, and the more operation processing flows are involved.
[0026] To address the aforementioned technical problems, this disclosure provides a device testing method, such as... Figure 1 As shown, the method includes: S101 receives the access file sent by the client in sequence and obtains the message information of the access file; S102 constructs a virtual client through virtualization based on the message information; S103 simulates virtual clients sending access messages to itself in sequence and performs tests.
[0027] In this embodiment, a message recording switch can also be set. When the message recording switch is turned on, when the server receives an access request, the message information of the received access file is recorded synchronously. A new message is constructed based on the message information through the protocol standard library, and the logic and timing of message interaction are restored through the file handle and the message reception time.
[0028] Specifically, the message information can be the NFS request message received by the file storage NAS head (taking the NFS network file system as an example). The NAS head synchronously records the message information in the form of a log, including the source IP and destination IP information at the IP layer, the RPC header (XID, version number, program number, procedure number, etc.), and the NFS operation parameters (including version number, procedure type, offset, file handle, etc.).
[0029] In this embodiment, after obtaining the message information of each of the above clients, a virtual client can be constructed using macvlan based on the message information.
[0030] macvlan is a virtual network technology provided by the Linux kernel that allows the creation of multiple virtual network interfaces (called macvlan sub-interfaces) on a single physical network interface. Each sub-interface has its own independent MAC address and IP address and is directly connected to the physical network. It is primarily used for high-performance network isolation scenarios for containers or virtual machines.
[0031] In this embodiment, a large number of IPs are simulated using macvlan to simulate a scenario of multi-client service traffic.
[0032] In this embodiment, the timing of message reception or the sequence of client-sent access messages can be used to record the message logs. The logic and order of message sending are then replayed from the logs. Specifically, the following operations are performed: The client user is identified through the message's source IP, the file handle is used to identify the file to be operated on, and the message response time is used to confirm the sequence, thus locking down the individual user's operation on a specific file. The code accesses the official NFS protocol library to construct messages (using a virtualized IP to achieve multi-client access). The content and logic of the sent messages are determined using the extracted information, achieving the desired reconstruction effect.
[0033] As can be seen from the above embodiments, the file system test based on customer scenarios collects messages through the set message recording device, restores traffic through the message restoration device, and distributes it to multiple clients to restore the customer usage scenario.
[0034] In this embodiment, after obtaining the virtual message sent by the virtual client through virtualization, the various fields of the virtual message (such as XID, file size, etc.) can be obfuscated to generate new messages, thereby testing the robustness of the file system through simulation testing.
[0035] In this embodiment, a specific divergence logic is specified for divergence testing. Messages are collected using a designated message recording device, and the number of FH (Functional Hierarchy) messages and operation type characteristics are analyzed. For example, if there are many messages with the operation type "setattr," more "setattr" messages need to be constructed during message construction.
[0036] Based on the above-described method embodiments, this disclosure provides a testing process, such as... Figure 2 As shown, the server is configured with a message logging switch, which is normally turned on to synchronously record message information in the form of logs. Several virtual IPs are generated through virtualization to simulate virtual clients. Subsequently, messages can be distributed, restored, or obfuscated based on the message logs, and related file system tests can be completed.
[0037] As can be seen from the above embodiments, by collecting packets and then restoring, distorting, and modifying them, and by using network virtualization technology to simulate multiple clients, the network file system can be tested. Under certain scale testing conditions, this effectively reduces resource dependence and, from a simulation perspective, conditionally reduces the complexity of file system testing.
[0038] Based on the above method embodiments, this disclosure provides a server, the server comprising: The receiving module is used to receive access files sent by the client in sequence and obtain the message information of the access files; The processing module is used to construct a virtual client through virtualization based on the message information; The sending module is used to simulate virtual clients sending access messages to itself in sequence and to perform tests.
[0039] The message information includes: source IP information, destination IP information, RPC header, and some or all of the NFS operation parameters.
[0040] Specifically, the processing module is used to construct a virtual client based on message information using macvlan.
[0041] Specifically, the sending module is used to obtain the order in which the virtual client sends access messages through log revisit; Send access messages to yourself in the order described and perform the test.
[0042] The sending module is further configured to obtain the processed access message by performing fuzzy processing on each field of the access message to be sent; Use the processed access messages to perform fuzzy message testing.
[0043] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0044] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0045] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not claimed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this specification are indicated by the following claims.
[0046] It should be understood that this specification is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this specification is limited only by the appended claims.
[0047] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
Claims
1. A device testing method, characterized in that, The method includes: Receive the access files sent by the client in sequence and obtain the message information of the access files; Based on the message information, a virtual client is constructed using virtualization; Simulate virtual clients sending access messages to themselves in sequence and perform tests.
2. The method according to claim 1, characterized in that, The message information includes: source IP information, destination IP information, RPC header, and some or all of the NFS operation parameters.
3. The method according to claim 1, characterized in that, The construction of a virtual client through virtualization includes: A virtual client is constructed based on the message information using macvlan.
4. The method according to claim 1, characterized in that, The sequential simulation of virtual clients sending access messages to themselves and the subsequent testing include: The order in which virtual clients send access messages is obtained by logging back; Send access messages to yourself in the order described and perform the test.
5. The method according to claim 1, characterized in that, Before simulating virtual clients sending access messages to themselves sequentially and conducting tests, the method further includes: The processed access message is obtained by fuzzing each field of the access message to be sent. Use the processed access messages to perform fuzzy message testing.
6. A server, characterized in that, The server includes: The receiving module is used to receive access files sent by the client in sequence and obtain the message information of the access files; The processing module is used to construct a virtual client through virtualization based on the message information; The sending module is used to simulate virtual clients sending access messages to itself in sequence and to perform tests.
7. The server according to claim 6, characterized in that, The message information includes: source IP information, destination IP information, RPC header, and some or all of the NFS operation parameters.
8. The server according to claim 6, characterized in that, The processing module is specifically used to construct a virtual client based on message information via macvlan.
9. The server according to claim 6, characterized in that, The sending module is specifically used to obtain the order in which the virtual client sends access messages through log revisit; Send access messages to yourself in the order described and perform the test.
10. The server according to claim 6, characterized in that, The sending module is also used to obtain the processed access message by fuzzing each field of the access message to be sent; Use the processed access messages to perform fuzzy message testing.