A cluster file system testing method and device
Through the cluster file system testing method, the information in the configuration file is used to create and select test items and perform system call operations, which solves the problem that existing tools cannot test the cluster file system, and realizes the adaptability of the test results checksum system.
Patent Information
- Application Number
- CN202010429487.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-20
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-05-20
AI Technical Summary
Existing file system testing tools cannot effectively test cluster file systems, lack compatibility and portability, and are difficult to adapt to storage expansion functions in different system environments.
A cluster file system testing method is proposed. By reading the global configuration information in the configuration file and the configuration information of the items to be tested, creating a collection of test items, selecting target test items, and testing them to obtain test results, including the file , directory and soft connection system call operations to verify the test results to ensure accuracy.
It realizes effective testing of the cluster file system, provides a verification mechanism for test results, improves the compatibility and portability of the test, and can adapt to the storage expansion function in different system environments.
Smart Images

Figure CN111737109B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer technology, and in particular, to a cluster file system testing method and device. Background Art
[0002] A cluster file system is a file system that runs on multiple computers and communicates with each other through networks, RDMA, etc., so as to integrate and virtualize all storage space resources in the cluster and provide file access services to the outside world. A cluster file system can expand storage functions. In different application scenarios, cluster file systems must have compatibility and portability to adapt to different system environments and meet the corresponding storage expansion functions.
[0003] Currently, existing file system compatibility testing tools can implement system kernel file system testing, such as POSIX file system testing tools, but there is no method that can test cluster file systems. Summary of the invention
[0004] In view of this, an object of one or more embodiments of this specification is to provide a cluster file system testing method and device, which can test a cluster file system.
[0005] Based on the above purpose, one or more embodiments of this specification provide a cluster file system testing method, including:
[0006] Reading a configuration file; the configuration file includes global configuration information and configuration information of the item to be tested;
[0007] Creating a test item set including at least one item to be tested according to the global configuration information;
[0008] Selecting a target test item from the test item set according to the configuration information of the test item;
[0009] The target test item is tested to obtain a test result.
[0010] Optionally, the global configuration information includes initialization configuration information for testing the cluster file system; the configuration information of the item to be tested includes system call operation content and operation ratio of the item to be tested.
[0011] Optionally, creating a test item set including at least one item to be tested according to the global configuration information includes: adding the system call operation content of the item to be tested to an idle operation list according to the global configuration information.
[0012] Optionally, selecting a target test item from the test item set according to the configuration information of the item to be tested includes:
[0013] According to the operation ratio of the item to be tested, randomly selecting a target test item from the idle operation list;
[0014] Creating an operation group according to the selected target test item; the operation group includes at least one operation item of the target test item;
[0015] The operation group is added to a test waiting queue.
[0016] Optionally, the operation item includes an operation object, an operation object type, an operation prerequisite, and whether the operation object already exists; the operation prerequisite is randomly determined to be open or close. If the operation object is a file or a directory, when the operation prerequisite is open, the operation item does not need to execute the system call operation content of opening the file or opening the directory; when the operation prerequisite is closed, the operation item needs to execute the system call content of opening the file or opening the directory.
[0017] Optionally, after reading the configuration file, the method further includes: verifying the configuration file, and if the configuration file passes the verification, creating a test item set including at least one item to be tested according to the global configuration information;
[0018] Verifying the configuration file includes: determining whether it contains a test directory for mounting a cluster file system and a verification directory for mounting a verification file system, if not, the verification fails; determining whether the sum of the operation ratios of each type of operation of each item to be tested is 100%, if not, the verification fails; determining whether the accuracy of each operation ratio is consistent with the accuracy of the operation ratio configured in the global configuration information, if not, the verification fails.
[0019] Optionally, the configuration file is verified. If the configuration file passes the verification, the method further includes: clearing the test directory and the verification directory; and creating a test item set including at least one item to be tested according to the global configuration information.
[0020] Optionally, test the target test item and obtain test results, including:
[0021] Taking out an operation group from the test waiting queue;
[0022] Determine each operation item in the operation group;
[0023] Parsing the operation item to determine the operation to be performed by the operation object;
[0024] An operation is performed on the operation object to obtain a test result.
[0025] Optionally, the method further includes: verifying the test result, including:
[0026] Based on the operation of the operation object of the operation item, the same operation is performed on the same operation object of the file system for verification to obtain the operation result;
[0027] Compare test results with operational results;
[0028] If they are consistent, the verification passes; otherwise, the inconsistent operation results and test results are output to the verification result log.
[0029] The embodiment of this specification also provides a cluster file system testing device, including:
[0030] A reading module, used to read a configuration file; the configuration file includes global configuration information and configuration information of the item to be tested;
[0031] A creation module, used to create a test item set including at least one item to be tested according to the global configuration information;
[0032] A selection module, used to select a target test item from the test item set according to the configuration information of the item to be tested;
[0033] The test module is used to test the target test item and obtain the test result.
[0034] As can be seen from the above, the cluster file system testing method and device provided by one or more embodiments of this specification reads a configuration file including global configuration information and configuration information of the item to be tested, creates a test item set including at least one item to be tested according to the global configuration information, selects a target test item from the test item set according to the configuration information of the item to be tested, tests the target test item, and obtains a test result. This specification can realize testing of a cluster file system. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only one or more embodiments of the present specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A schematic diagram of a method flow of one or more embodiments of this specification;
[0037] Figure 2 A block diagram of the device structure of one or more embodiments of this specification;
[0038] Figure 3 A structural block diagram of an electronic device according to one or more embodiments of the present specification. DETAILED DESCRIPTION
[0039] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0040] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of this specification should be understood by people with ordinary skills in the field to which this disclosure belongs. The "first", "second" and similar words used in one or more embodiments of this specification do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0041] like Figure 1 As shown, one or more embodiments of this specification provide a cluster file system testing method, including:
[0042] S101: Read a configuration file; the configuration file includes global configuration information and configuration information of the item to be tested;
[0043] In this embodiment, in order to implement cluster file system testing, a configurable configuration file is created, and the configuration file includes global configuration information and various configuration information of items to be tested in the cluster file system.
[0044] In some embodiments, the global configuration information includes initialization configuration information for testing the cluster file system. The configuration information of the item to be tested includes the system call operation content and operation ratio of the item to be tested; the item to be tested of the cluster file system includes one or more of files, targets, soft links, etc. The configuration information of the file in the configuration file includes the system call operation content and operation ratio of the file that needs to be opened, and the system call operation content and operation ratio of the file that does not need to be opened; the configuration information of the directory in the configuration file includes the system call operation content and operation ratio of the directory that needs to be opened, and the system call operation content and operation ratio of the directory that does not need to be opened; the configuration information of the soft connection in the configuration file includes the system call operation content and operation ratio of the soft connection, etc.
[0045] S102: Create a test item set according to the global configuration information;
[0046] In this embodiment, according to the global configuration information in the configuration file, a test item set including at least one item to be tested is created, including: according to the global configuration information in the configuration file, the system call operation content of the item to be tested is added to the idle operation list; the idle operation list stores parameters such as the type (directory, file and soft link) and name of the item to be tested, the system call operation type, the total number of operations, the file type, and the specific operation behavior corresponding to the system call operation type, and each parameter is set according to the relevant configuration information in the configuration file.
[0047] S103: Selecting a target test item from the created test item set according to the configuration information of the item to be tested;
[0048] In this embodiment, target test items are selected from the created test item set according to the configuration information of the items to be tested, including: randomly selecting target test items from the test item set according to the operation ratio corresponding to each item to be tested, and adding the selected target test items to the test waiting queue.
[0049] S104: Test the target test item to obtain a test result.
[0050] In this embodiment, after selecting the target test item, the target test item is tested and the test result is obtained. In some methods, the target test item is tested and the test result is obtained, including: when it is determined that the test waiting queue is full, each target test item in the test waiting queue is tested, and the test result is obtained after the test is completed.
[0051] In this embodiment, in order to implement testing of the cluster file system, a configuration file for testing each item to be tested in the cluster file system is first established. During testing, the configuration file is read, and a test item set is created according to the global configuration information in the configuration file. Then, a target test item is selected from the created test item set according to the configuration information of the item to be tested, and the target test item is tested. After the test is completed, the test result of the item to be tested in the cluster file system is obtained, thereby implementing the testing function of the cluster file system and providing a basis for optimizing the cluster file system.
[0052] In this embodiment, after the configuration file is read in step S101, the process further includes: verifying the configuration file, and if the configuration file passes the verification, executing step S102 to create a test item set according to the configuration file.
[0053] In some embodiments, as shown in Table 1, the configuration file specifically includes configuration items such as a test directory (a mount directory of a cluster file system storage pool), a verification directory (a mount directory of a file system used to verify the cluster file system test results, such as a disk or disk array mount directory of a kernel file system), global configuration information, file configuration information, directory configuration information, and soft connection configuration information. Among them, the global configuration information includes file operation ratio, directory operation ratio, soft connection operation ratio, log level, operation ratio precision, data block size written / read, maximum / minimum value of data block written / read, maximum directory depth, number of directories created initially, number of files created initially, number of soft connections created initially, total number of items to be tested, mount point of the cluster file system, mount point of the file system used to verify the cluster file system test results, log directory (used to save various logs generated during the test process), number of working threads, length of the test waiting queue, number of items to be tested that need to open files, number of items to be tested that do not need to open files, number of items to be tested that need to open directories, number of items to be tested that do not need to open directories, number of items to be tested that are softly connected, operation ratio of opening directories, operation ratio of creating new directories, operation ratio of opening files, operation ratio of creating new files, etc.
[0054] Among them, during the test process, the execution results of each step are recorded in the corresponding log file, and the corresponding log level is set for each log file. The log level determines the reliability of the information output during the execution of the corresponding step. The larger the log level value, the more detailed the output. Each log file can be used to trace the execution process to improve the test efficiency.
[0055] As shown in Table 1, the configuration information of the file includes the system call operation content that needs to open the file and the operation ratio of each operation content, and the system call operation content that does not need to open the file and the operation ratio of each operation content. Among them, the system call operation content that needs to open the file includes write, read, fallocate, ftruncate, fsync, fsetxattr, fgetxattr, fremovexattr, flock, fchown, fchmod, futimes, fstat, etc.; the sum of the operation ratios of all system call operation contents that need to open the file should be 100%, and the accuracy of each operation ratio should reach the accuracy of the configured operation ratio. The system call operation content that does not need to open the file includes rename, symlink, link, truncate, setxattr, getxattr, removexattr, access, chown, chmod, utimes, stat, unlink, statfs, etc.; the sum of the operation ratios of all system call operation contents that do not need to open the file should be 100%, and the accuracy of each operation ratio should reach the accuracy of the configured operation ratio.
[0056] The configuration information of the directory includes the system call operation content that needs to open the directory and the operation ratio of each operation content, and the system call operation content that does not need to open the directory and the operation ratio of each operation content. Among them, the system call operation content that needs to open the directory includes fsync, fsetxattr, fgetxattr, fremovexattr, readdir, flock, fchown, fchmod, futimes, fstat, etc.; the sum of the operation ratios of all system call operation content that needs to open the directory should be 100%, and the accuracy of each operation ratio should reach the accuracy of the configured operation ratio. The system call operation information that does not need to open the directory includes access, rename, symlink, setxattr, getxattr, removexattr, chown, chmod, utimes, rmdir, stat, statfs, etc.; the sum of the operation ratios of all system call operation content that does not need to open the directory should be 100%, and the accuracy of each operation ratio should reach the accuracy of the configured operation ratio.
[0057] The configuration information of the soft link includes the system call operation content of the soft link and the operation ratio of each operation content. The system call operation content of the soft link includes readlink and unlink, and the sum of the operation ratios of the two operation contents should be 100%. The accuracy of the two operation ratios should reach the accuracy of the configured operation ratios.
[0058]
[0059]
[0060]
[0061] Table 1
[0062] As shown in Table 1, the file size generated during the test is determined by the two configuration items MAX_OP_SIZE and MINI_OP_SIZE. The file size range that can be generated is [MINI_OP_SIZE, MAX_OP_SIZE+1024*1024], which can be used to estimate the size of the file system (integrated file system or file system used for verification) required in the test. The values of the three configuration items, namely the number of files, the number of directories, and the number of soft links created during initialization, can be equal. Optionally, the value can be one order of magnitude smaller than the total number of items to be tested, which can ensure the test effect and make reasonable use of system resources. During the test, the size of the data block written each time must be consistent with the size of the data block read each time, and the size of the data block must be divisible by MAX_OP_SIZE or MINI_OP_SIZE.
[0063] In some embodiments, the configuration file is verified, including: determining whether a test directory and a verification directory are included, if not (the test directory and / or verification directory is not specified, or the specified directory does not exist), the verification fails; determining whether the sum of the operation ratios of each type of operation (system call operations that require opening files, system call operations that do not require opening files, system call operations that require opening directories, system call operations that do not require opening operations, and system call operations that are softly linked) is 100%, if there is at least one type of operation whose sum of operation ratios is not 100%, the verification fails; determining whether the accuracy of each operation ratio meets the accuracy of the configured operation ratio, if there is at least one operation ratio whose accuracy does not meet the accuracy of the configured operation ratio, the verification fails.
[0064] In some methods, during specific tests, the global configuration information and / or various configuration information of the items to be tested in the configuration file may be modified according to the actual test content and test requirements to achieve the test purpose. For example, during each test, configuration items such as the number of files or directories to be tested, the operation ratio of the system call operation content, the size of the file read / write data block, and the accuracy of the operation ratio in the configuration file are modified to achieve the effect of flexible configuration and dynamic testing, so that the cluster file system test method of this embodiment has good compatibility and scalability.
[0065] In this embodiment, after reading the configuration file in step S101, it also includes: verifying the configuration file. If the verification passes, clearing the test directory and the verification directory according to the test directory and verification directory information in the configuration file for testing purposes; if the configuration file verification fails, outputting prompt operation information to the file verification log according to the failed verification items.
[0066] In this embodiment, in step S103, selecting a target test item from a test item set according to the configuration information of the item to be tested includes:
[0067] According to the operation ratio of each item to be tested in the configuration file, the target test item is randomly selected from the idle operation list;
[0068] Create an operation group based on the selected target test items;
[0069] Add the operation group to the test waiting queue.
[0070] In some embodiments, the operation group includes at least one operation item of the target test item, and the operation item includes options such as the operation object, the operation object type, the operation premise, and whether the operation object already exists. Among them, the operation premise can be set to open or close. In order to better simulate the actual test environment, the operation premise is randomly determined to be open or closed. For the operation object being a file or a directory, when the operation premise is open, the operation item does not need to execute the system call operation content of opening the file or opening the directory. When the operation premise is closed, the operation item needs to execute the system call content of opening the file or opening the directory. For example, the operation object is a specific file, the operation object type is a file, and the specific file already exists. According to the random number, the operation premise is determined to be open. Then, during the test, the file does not need to execute the system call operation content of opening the file.
[0071] In this embodiment, according to the operation ratio of each item to be tested in the configuration file, the target test item is randomly selected from the idle operation list, and an operation group is created according to the selected target test item. The operation group is added to the test waiting queue. By randomly selecting the target test item from all items to be tested, it is possible to simulate the actual operation of the user on the cluster file system.
[0072] In some embodiments, an operation group is added to a test waiting queue. When it is determined that the test waiting queue is full, the operation group is taken out of the test waiting queue to perform operations on the operation objects in the operation group, which can fully utilize system resources, reduce test time, and improve test efficiency.
[0073] In this embodiment, in step S104, the target test item is tested to obtain a test result, including:
[0074] Take the operation group from the test waiting queue;
[0075] Determine each operation item in the operation group;
[0076] Parse the operation items to determine the operations that the operation objects need to perform;
[0077] Perform operations on the operation object and obtain test results.
[0078] In this embodiment, during the test, an operation group is taken from the test waiting queue, each operation item in the operation group is parsed, and options such as the operation object, the operation object type, the operation premise, and whether the operation object already exists are obtained, and the operation to be performed on the operation object is determined, and the operation is performed on the operation object to obtain the test result. Among them, if the operation object is a file or a directory, according to whether the operation premise is open or close, it is determined whether to execute the system call operation content of opening the file or opening the directory.
[0079] For example, for directory operations: randomly select whether to operate on an existing directory or to create a new directory. If it is an operation on an existing directory, select an idle directory from the idle operation list, add the idle directory to the busy directory list, and increase the reference count of the idle directory's parent directory and all grandparent directories by one; randomly determine whether the operation of the idle directory is to open the directory (determine the operation premise according to the random number), if so, select the number of operation items from the operation content that needs to open the directory according to the number of operation items in the global configuration information that need to open the directory (Table 1 example is 3), and add the selected operation items to the test waiting queue; if the operation of the idle directory is not to open the directory, select the number of operation items from the operation content that does not need to open the directory according to the number of operation items in the global configuration information that do not need to open the directory, and add the selected operation items to the test waiting queue. For the operation of creating a new directory, select the parent directory of the new directory from the existing directory, create a new directory under the parent directory and randomly generate a directory name, construct the operation item of the new directory, add the operation item to the test waiting queue, and increase the reference count of its parent directory and all ancestor directories by 1. According to the waiting queue length configured in the global configuration information, when it is determined that the test waiting queue is full, the operation log thread is used to import all operation items in the test waiting queue into the operation log, the scheduling thread is used to retrieve all operation items from the operation log, and the working thread is used to perform corresponding operations on each operation item; after the operations of all operation items are executed, the reference count of the parent directory and ancestor directory involved in the directory operation is reduced by 1, and the directory in the busy directory list is moved into the idle operation list.
[0080] For file operations: Randomly select whether to operate on an existing file or to create a new file. If it is an operation on an existing file, select an idle file from the idle operation list, add the idle file to the busy file list, and increase the reference count of the idle file's parent directory and all grandparent directories by one; Randomly determine whether the operation of the idle file is to open the file (determine the operation premise according to the random number). If so, select the number of operation items from the operation content that needs to open the file according to the number of operation items in the global configuration information that need to open the file (Table 1 example is 500), and add the selected operation items to the test waiting queue; If the operation of the idle file is not to open the file, select the number of operation items from the operation content that does not need to open the file according to the number of operation items in the global configuration information that do not need to open the file, and add the selected operation items to the test waiting queue. For the new file operation, select the parent directory of the new file from the existing file, create a new file under the parent directory and randomly generate a file name, construct the operation item of the new file, add the operation item to the test waiting queue, and increase the reference count of its parent directory and all ancestor directories by 1. When it is determined that the test waiting queue is full, the operation log thread is used to import all operation items in the test waiting queue into the operation log, the scheduling thread is used to retrieve all operation items from the operation log, and the working thread is used to perform corresponding operations on each operation item; after the operations of all operation items are executed, the reference counts of the parent directory and ancestor directory involved in the file operation are reduced by 1, and the files in the busy file list are moved into the idle operation list.
[0081] For soft link operations, select an idle soft link from the existing soft link operation list in the idle operation list, construct an operation item for the idle soft link, add the operation item to the test waiting queue, and add the soft link to the busy soft link list, and increase the reference count of its parent directory and grandparent directory by one; when it is determined that the test waiting queue is full, use the operation log thread to import all operation groups in the test waiting queue into the operation log, use the scheduling thread to extract all operation items from the operation log, and use the working thread to perform corresponding operations on each operation item; after the operations of all operation items are executed, reduce the reference count of the parent directory and ancestor directory involved in the soft link operation by 1, and move the soft link in the busy soft link list into the idle operation list.
[0082] In this embodiment, the cluster file system testing method further includes: verifying the test result, including:
[0083] Based on the operation of the operation object of the operation item, the same operation is performed on the same operation object of the file system for verification to obtain the operation result;
[0084] Compare test results with operational results;
[0085] If they are consistent, the verification passes; otherwise, the inconsistent operation results and test results are output to the verification result log.
[0086] In this embodiment, based on the test results of the test items of the cluster file system, the operation results of the file system used for verification are compared and verified, and the verification results with inconsistent results are output to the verification result log, which can realize simultaneous testing and comparison of the cluster file system and the system kernel file system, reduce time cost, and improve test efficiency. Moreover, through the simultaneous operation and result comparison of the cluster file system and the system kernel file system, the differences in the execution of system call operations between the two can be determined, and then the cluster file system is optimized according to the recorded differences, thereby improving the compatibility and portability of the cluster file system.
[0087] Optionally, the system kernel file system includes, for example, UFS, ZFS, ext3, XFS, NTFS and other file systems, which are not specifically limited in this specification.
[0088] It should be noted that the method of one or more embodiments of this specification can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of one or more embodiments of this specification, and the multiple devices will interact with each other to complete the described method.
[0089] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0090] like Figure 2 As shown, the embodiment of this specification also provides a cluster file system testing device, including:
[0091] A reading module, used to read a configuration file; the configuration file includes global configuration information and configuration information of the item to be tested;
[0092] A creation module, used to create a test item set including at least one item to be tested according to the global configuration information;
[0093] A selection module, used to select a target test item from the test item set according to the configuration information of the item to be tested;
[0094] The test module is used to test the target test items and obtain the test results.
[0095] For the convenience of description, the above devices are described in terms of functions divided into various modules. Of course, when implementing one or more embodiments of this specification, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0096] The apparatus of the above-mentioned embodiment is used to implement the corresponding method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0097] Figure 3 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0098] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0099] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0100] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0101] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0102] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0103] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0104] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0105] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. In line with the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present specification as described above, which are not provided in detail for the sake of simplicity.
[0106] In addition, to simplify the description and discussion, and in order not to obscure one or more embodiments of the present specification, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device may be shown in the form of a block diagram so as to avoid obscuring one or more embodiments of the present specification, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which one or more embodiments of the present specification will be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that one or more embodiments of the present specification may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0107] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0108] One or more embodiments of this specification are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification should be included in the scope of protection of this disclosure.
Claims
1. A cluster file system testing method, characterized in that: include: Reading a configuration file; the configuration file includes global configuration information and configuration information of the item to be tested; wherein the global configuration information includes initialization configuration information for testing the cluster file system, and the configuration information of the item to be tested includes the system call operation content of the item to be tested and the operation ratio of each operation content to the type of operation to which it belongs; Verifying the configuration file includes: determining whether it contains a test directory for mounting a cluster file system and a verification directory for mounting a verification file system, if not, the verification fails; determining whether the sum of the operation ratios of each type of operation of each item to be tested is 100%, if there is at least one type of operation whose sum of the operation ratios is not 100%, the verification fails; determining whether the accuracy of each operation ratio meets the accuracy of the operation ratio configured in the global configuration information, if not, the verification fails; If the configuration file is verified, a test item set including at least one item to be tested is created according to the global configuration information; Selecting a target test item from the test item set according to the configuration information of the test item, including: randomly selecting a target test item from the test item set according to the operation ratio corresponding to each test item, and adding the selected target test item to a test waiting queue; The target test item is tested to obtain a test result.
2. The method according to claim 1, characterized in that Creating a test item set including at least one item to be tested according to the global configuration information includes: adding the system call operation content of the item to be tested to an idle operation list according to the global configuration information.
3. The method according to claim 2, characterized in that According to the operation ratio corresponding to each item to be tested, a target test item is randomly selected from the test item set, and the selected target test item is added to the test waiting queue, including: According to the operation ratio of the item to be tested, randomly selecting a target test item from the idle operation list; Creating an operation group according to the selected target test item; the operation group includes at least one operation item of the target test item; The operation group is added to a test waiting queue.
4. The method according to claim 3, characterized in that The operation item includes an operation object, an operation object type, an operation prerequisite, and whether the operation object already exists; the operation prerequisite is randomly determined to be open or close. If the operation object is a file or a directory, when the operation prerequisite is open, the operation item does not need to execute the system call operation content of opening the file or opening the directory; when the operation prerequisite is closed, the operation item needs to execute the system call content of opening the file or opening the directory.
5. The method according to claim 1, characterized in that If the configuration file is verified, the method further includes: clearing the test directory and the verification directory; and creating a test item set including at least one item to be tested according to the global configuration information.
6. The method according to claim 3, characterized in that Test the target test items and obtain test results, including: Taking out an operation group from the test waiting queue; Determine each operation item in the operation group; Parsing the operation item to determine the operation to be performed by the operation object; An operation is performed on the operation object to obtain a test result.
7. The method according to claim 6, characterized in that Also includes: Verify the test results, including: Based on the operation of the operation object of the operation item, the same operation is performed on the same operation object of the file system for verification to obtain the operation result; Compare test results with operational results; If they are consistent, the verification passes; otherwise, the inconsistent operation results and test results are output to the verification result log.
8. A cluster file system testing device, characterized in that: include: A reading module is used to read a configuration file; the configuration file includes global configuration information and configuration information of the item to be tested; wherein the global configuration information includes initialization configuration information for testing the cluster file system, and the configuration information of the item to be tested includes the system call operation content of the item to be tested and the operation ratio of each operation content to the operation of the type to which it belongs; The device is also used to verify the configuration file, including: determining whether it contains a test directory for mounting a cluster file system and a verification directory for mounting a verification file system, if not, the verification fails; determining whether the sum of the operation ratios of each type of operation of each item to be tested is 100%, if there is at least one type of operation whose sum of the operation ratios is not 100%, the verification fails; determining whether the accuracy of each operation ratio meets the accuracy of the operation ratio configured in the global configuration information, if not, the verification fails; A creation module, configured to create a test item set including at least one item to be tested according to the global configuration information when the configuration file is verified; A selection module, configured to select a target test item from the test item set according to the configuration information of the test item, including: randomly selecting a target test item from the test item set according to the operation ratio corresponding to each test item, and adding the selected target test item to a test waiting queue; The test module is used to test the target test item and obtain the test result.
