Test script configuration method, test method, device and related equipment
By obtaining the correlation rules of test resources and parameters, and automatically configuring the test scripts, the redundancy problem of script configuration in NFV tests is solved, the operation and maintenance efficiency and automation are improved, and the difficulty of operation and maintenance of cloud platforms is reduced.
Patent Information
- Application Number
- CN202211105455.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-09-09
AI Technical Summary
In Network Function Virtualization (NFV) testing, the configuration of the test script parameter causes frequent interaction between developers, deployment personnel and testers, resulting in a large number of repetitive work, resulting in redundant and inefficient operation and maintenance work.
By obtaining the correlation rules of test resources and test parameters, we automatically or semi-automatically obtain the test resource information of the NFV environment under test, determine the target test resources and parameters, and then configure the target test script to reduce manual handover and redundant work.
Effectively eliminate offline handover work required during the test script configuration process, optimize operation and maintenance processes, reduce the difficulty and cost of cloud platform operation and maintenance work, and improve the automation and efficiency of script configuration.
Smart Images

Figure CN115437938B_ABST
Abstract
Description
Background Art
[0002] Network Function Virtualization (NFV) testing is aimed at testing the basic resources that carry cloud upper-layer applications. The test objects include the cloud platform itself and the correctness of cloud platform application deployment. In automated testing, it is a development direction of NFV testing.
[0003] In an NFV automated test, developers usually develop automated test scripts, deployers configure the tested environment, and testers execute automated test scripts on the tested environment to complete the test. The work of the three types of personnel is theoretically weakly coupled. However, due to several problems in the test script parameter configuration, the three types of personnel need to interact frequently in actual testing, which generates a lot of repetitive work, leading to redundant operation and maintenance work and inefficient technical problems.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a test script configuration method, a test method, a test script configuration device, a test device, a computer-readable storage medium and an electronic device, so as to at least solve the redundancy problem caused by the large amount of repetitive work in configuring test scripts in the related technology and the technical problem of low operation and maintenance efficiency.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] The technical solution of the present disclosure is as follows:
[0008] According to one aspect of the present disclosure, a test script configuration method is provided, the method comprising: obtaining association rules between test resources and test parameters; obtaining test resource information of a network function virtualization environment under test; determining target test resources based on the test resource information; determining target test parameters through association rules based on the target test resources; and configuring a target test script based on the target test parameters.
[0009] In some embodiments of the present disclosure, the step of obtaining association rules between test resources and test parameters includes: obtaining basic information of the test script; based on the basic information, obtaining test parameters required for the test script and test resources of a preset data structure; and generating association rules based on the test parameters and test resources.
[0010] In some embodiments of the present disclosure, before the step of obtaining test resource information of the network function virtualization environment under test, the method also includes: automatically and / or semi-automatically obtaining physical resource information and virtual resource information of the network function virtualization environment under test; and generating test resource information from the physical resource information and the virtual resource information according to a preset data structure.
[0011] In some embodiments of the present disclosure, the step of determining the target test resource based on the test resource information includes: obtaining basic information of the target test script; determining the resource type of the corresponding test resource based on the basic information of the target test script; and selecting to execute at least one of the following based on the basic information of the target test script: randomly selecting a target test resource with the same resource type from the test resource information; and / or selecting a target test resource with the same resource type from the test resource information according to a custom rule; and / or selecting a target test resource with the same resource type from the test resource information according to a machine learning method.
[0012] In some embodiments of the present disclosure, the association rule includes any one of the following: a string concatenation operation, a numerical operation, or a regular matching operation.
[0013] According to another aspect of the present disclosure, a testing method is provided, which includes: obtaining association rules between test resources and test parameters; obtaining test resource information of a network function virtualization environment under test; determining target test resources based on the test resource information; determining target test parameters through association rules based on the target test resources; configuring a target test script based on the target test parameters; and testing the target test script.
[0014] According to another aspect of the present disclosure, a test script configuration device is provided, which includes: a first association rule acquisition module, used to obtain association rules between test resources and test parameters; a first tested environment resource acquisition module, used to obtain test resource information of a tested network function virtualization environment; a first test resource selection module, used to determine target test resources according to the test resource information; a first test parameter parsing module, used to determine target test parameters through association rules according to the target test resources; and a first test script generation module, used to configure a target test script according to the target test parameters.
[0015] According to another aspect of the present disclosure, a testing device is provided, which includes: a second association rule acquisition module, used to acquire association rules between test resources and test parameters; a second tested environment resource acquisition module, used to acquire test resource information of the tested network function virtualization environment; a second test resource selection module, used to determine target test resources according to the test resource information; a second test parameter parsing module, used to determine target test parameters through association rules according to the target test resources; and a second test script generation module, used to configure a target test script according to the target test parameters; and a testing module, used to test the target test script.
[0016] According to another aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned test script method or test method by executing the executable instructions.
[0017] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the test script method or the test method described above is implemented.
[0018] The test script configuration method for network function virtualization environment proposed in the present invention effectively overcomes the defects of the script configuration method in the traditional operation and maintenance technology, effectively eliminates the redundancy problem caused by the offline handover work required in the test script configuration process, optimizes the operation and maintenance process, greatly reduces the manpower and material costs, and reduces the difficulty of cloud platform operation and maintenance work.
[0019] Furthermore, the present disclosure establishes association rules between test resources and test parameters to automatically fill in test parameters based on resource matching rules, thereby improving the automation level of script configuration and improving the efficiency of cloud platform operation and maintenance work.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0022] Figure 1 A flowchart of a test script configuration method according to an embodiment of the present disclosure is shown.
[0023] Figure 2A flow chart of a method for generating association rules in a test script configuration method in an embodiment of the present disclosure is shown.
[0024] Figure 3 A schematic diagram of the data structure of a test parameter configuration file generated by a test script configuration method in an embodiment of the present disclosure is shown.
[0025] Figure 4 A schematic diagram of the data structure of test resources in a test script configuration method in an embodiment of the present disclosure is shown.
[0026] Figure 5 A flow chart of a method for determining target test resources according to test resource information in a test script configuration method in an embodiment of the present disclosure is shown.
[0027] Figure 6 A flowchart of another test script configuration method in an embodiment of the present disclosure is shown.
[0028] Figure 7 A flow chart of a testing method in an embodiment of the present disclosure is shown.
[0029] Figure 8 A schematic diagram of a test script configuration device in an embodiment of the present disclosure is shown.
[0030] Fig. 9 A schematic diagram of a testing device in an embodiment of the present disclosure is shown.
[0031] Fig.10 A framework diagram of a test system in an embodiment of the present disclosure is shown.
[0032] Fig.11 A schematic block diagram of an electronic device showing a test script configuration method in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0034] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0035] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0036] In view of the technical problems existing in the above-mentioned related technologies, the embodiments of the present disclosure provide an encrypted traffic detection method to solve at least one or all of the above-mentioned technical problems.
[0037] It should be pointed out that the nouns or terms involved in the embodiments of the present application can refer to each other and will not be repeated here.
[0038] Below, each step of the test script configuration method in this example implementation will be described in more detail with reference to the accompanying drawings and embodiments.
[0039] Figure 1 A flow chart of a test script configuration method according to an embodiment of the present disclosure is shown. Figure 1 As shown, the test script configuration method 100 may include the following steps:
[0040] In step S110, association rules between test resources and test parameters are obtained.
[0041] Among them, test resources can be all testable physical and / or virtual resources in the Network Function Virtualization (NFV) environment, as well as resource blueprints that have not yet been created but have been planned, such as the layout of virtual networks. Physical resources refer to hardware resources in the NFV environment, such as hosts, switches, etc. Virtual resources refer to software resources in the NFV environment, such as virtual machines and virtual networks.
[0042] The test parameters are parameters required by the test script, and the test parameters correspond to the test script, and may include, for example: parameter name, display name, description, data type and default value.
[0043] Among them, the association rules define the operational relationship between test resources and test parameters.
[0044] In step S120, test resource information of the network function virtualization environment under test is obtained.
[0045] The test resource information is physical / virtual resource information extracted and generated according to relevant standard data structures. The test resource information can be automatically obtained from components such as network function virtualization infrastructure (NFV Infrastructure, NFVI), or semi-automatically obtained, that is, allowing deployment personnel to fill in manually.
[0046] In step S130, a target test resource is determined according to the test resource information.
[0047] The target test resource is a resource selected from the test resource information according to a predefined rule and matching the resource type required by the test script.
[0048] In step S140, target test parameters are determined according to the target test resources through association rules.
[0049] Wherein, step S140 and step S110 are inverse operations.
[0050] In step S150, a target test script is configured according to the target test parameters.
[0051] The test script configuration method applied to the network function virtualization environment proposed in the present invention effectively overcomes the defects of the script configuration method in the traditional operation and maintenance technology, effectively eliminates the redundancy problem caused by the offline handover required in the configuration process of the test script, optimizes the operation and maintenance process, greatly reduces the manpower and material costs, and reduces the difficulty of cloud platform operation and maintenance work.
[0052] Furthermore, the present disclosure establishes association rules between test resources and test parameters to automatically fill in test parameters based on resource matching rules, thereby improving the automation level of script configuration and improving the efficiency of cloud platform operation and maintenance work.
[0053] In some embodiments of the present disclosure, the association rules between test resources and test parameters can be based on Figure 2 The method shown generates Figure 2 As shown, the method 200 may include the following steps:
[0054] In step S210, basic information of the test script is obtained.
[0055] The basic information of the test script includes, but is not limited to, the name of the test case, the identification of the test case, and the description of the test case.
[0056] In step S220, based on the basic information, test parameters required by the test script and test resources of a preset data structure are acquired.
[0057] The test parameters include but are not limited to parameter name, display name, description, data type, and default value.
[0058] Among them, the test resources correspond to the test parameters, and the test resources are the test parameters that meet the preset data structure.
[0059] In step S230, association rules are generated based on the test parameters and the test resources.
[0060] Among them, the association rules define the operational relationship between test parameters and test resources.
[0061] The disclosed embodiment converts the input test parameters of the test script into test resources with an easy-to-understand preset data structure, which can realize the conversion from parameter filling to resource selection, reducing the reliance on manual input parameters and expert experience.
[0062] In some embodiments of the present disclosure, the association rules include but are not limited to string concatenation operations, or numerical operations, or regular matching operations.
[0063] In some embodiments of the present disclosure, after step S230, the basic information of the test script, the test parameters and the association rules of the test resources may be saved in a test parameter configuration file, and step 110 may also include obtaining the association rules of the test resources and the test parameters from the test parameter configuration file. The test parameter configuration file may be, for example, Figure 3 The data structure diagram is shown in FIG. Figure 3 As shown, the test parameter configuration file 300 includes: basic information 310 of the test script, a declaration 320 of the test parameters, and association rules 330 between the test parameters and the test resources.
[0064] In some embodiments of the present disclosure, before the step of obtaining the test resource information of the network function virtualization environment under test, the following steps may also be included: automatically and / or semi-automatically obtaining the physical resource information and virtual resource information of the network function virtualization environment under test; generating the test resource information according to the preset data structure from the physical resource information and the virtual resource information. By automatically or semi-automatically obtaining resources from the network function virtualization environment under test, it has high flexibility. Furthermore, by unifying the data structure, the test resources are standardized and managed to improve the automation and efficiency of configuring the test script.
[0065] For example Figure 4 FIG. 1 is a schematic diagram showing a data structure of a test resource in a test script configuration method according to an embodiment of the present disclosure. Figure 4The data structure 400 of the test resource shown, wherein the preset data structure may include a test resource ID, i.e., a unique identifier of the test resource, a test resource type, whether the test resource exists (used to distinguish between existing physical / virtual resources or non-existent resource blueprints), and attributes of the test resource (for example, may be determined based on relevant standards of the resource, such as when the test resource is a physical host, the attributes may include the host name and network protocol address, when the test resource is a virtual network, the attributes may include virtual local area network (VLAN), gateway and other information, and when the test resource is a software service, the attributes may include an access entry).
[0066] In some embodiments of the present disclosure, step S130 may also include, for example Figure 5 The method 500 is shown. Figure 5 As shown, method 500 may include the following steps:
[0067] In step S510, basic information of the target test script is obtained.
[0068] In step S520, the resource type of the corresponding test resource is determined according to the basic information of the target test script.
[0069] In step S530, based on the basic information of the target test script, select at least one of the following to execute: randomly select a target test resource with the same resource type from the test resource information; and / or select a target test resource with the same resource type from the test resource information according to a custom rule; and / or select a target test resource with the same resource type from the test resource information according to a machine learning method.
[0070] The method of the embodiment of the present disclosure can select different methods for acquiring test resources according to different test objects corresponding to different basic information, so that the acquisition of test resources becomes more intelligent, efficient, dynamic and automatic.
[0071] The following are examples of the three methods mentioned in step S530:
[0072] In some embodiments of the present disclosure, when testing whether the hot migration function of a virtual machine in a network function virtualization environment is normal, specifically, the hot migration function of the virtual machine can be tested by verifying that the virtual machine is successfully migrated from the host where it is located to another host, and the business on the virtual machine is not affected. Specifically, first obtain the basic information of the test script, such as the name of the test case—hot migration of virtual machine. Then, based on the basic information, obtain the test parameters required for the test script and the test resources of the preset data structure. For example, the test parameters may include: the ID, IP, account, password, etc. of the host where the virtual machine is located and the migration target host. Then determine the test resources of the test case, such as host A (the host where the virtual machine is located) and host B (the target host of the virtual machine migration). Then generate association rules based on the above test parameters and test resources.
[0073] Furthermore, the test resource information of the tested environment is obtained and converted into a preset test resource data structure, which may include all host resources and the host's ID, IP and other attribute information. Two hosts are randomly selected from the test resource information as the target test resources of the test case. Then, according to the association rules, the target test parameters corresponding to the target test resources are parsed, such as the host's ID, IP, account, password and other parameters. Finally, the target test script is configured according to the target test parameters.
[0074] In some embodiments of the present disclosure, when testing the network connection status of the data platform development kit (Data Plane Development Kit, DPDK), specifically, two huge page memory virtual machines can be created in the specified DPDK network, and the connection status of the DPDK network can be determined by confirming whether the two huge page memory virtual machines can communicate normally. Specifically, first obtain the basic information of the test script, such as the test case name-DPDK network connectivity test. Then, based on the basic information, obtain the test parameters required for the test script and the test resources of the preset data structure, such as the CPU, memory, huge page memory size, disk capacity, network segment, gateway, VLAN, etc. of the virtual machine. Then determine the test resources of the test case, such as virtual machine specifications (huge page type), virtual network (DPDK). Then generate association rules based on the above test parameters and test resources, for example, establish association rules with the CPU, memory, huge page memory size, disk capacity, and virtual machine specifications of the virtual machine; and establish association rules with the network segment, gateway, VLAN, and virtual network of the DPDK network.
[0075] Furthermore, the test resource information of the tested environment is obtained and converted into a preset test resource data structure, such as the virtual machine specifications, virtual networks and their attributes defined above. According to custom rules (such as predefined specifications), a virtual machine specification is selected from the huge page memory type virtual machine specifications, and a DPDK network is selected from the DPDK type network as the target test resource of the test case. Then, according to the association rules, the CPU, memory, huge page memory size, disk capacity of the virtual machine, the network segment, gateway, VLAN and other parameters of the DPDK network are parsed. Finally, the target test script is configured according to the target test parameters.
[0076] In some embodiments of the present disclosure, when testing whether the port binding function is normal, two virtual machines can be created by specifying the network corresponding to the port binding, so that the two virtual machines communicate with each other, and by closing one of the ports, it is confirmed that the network communication between the virtual machines is not interrupted, thereby testing whether the port binding function is normal. Specifically, first obtain the basic information of the test script, such as the test case name-port binding test. Then based on the basic information, obtain the test parameters required for the test script and the test resources of the preset data structure, such as the network segment, gateway, VLAN, etc. of the virtual network corresponding to the port binding, the port information of the port binding, etc. Then determine the test resources of the test case, such as the virtual network (port binding), the physical network card port (port binding). Then generate association rules based on the above test parameters and test resources, for example, the network segment, gateway, VLAN of the network corresponding to the port binding, and the virtual network are established with association rules; and the port information of the port binding is established with the physical network card port.
[0077] Furthermore, the test resource information of the tested environment is obtained and converted into a preset test resource data structure, for example, the virtual network, physical network card port and its attributes defined above. According to the resource selection model, a virtual network is selected from the virtual network of the port binding type, and a physical network card port is selected from the physical network card port corresponding to the virtual network as the target test resource of the use case. Then, according to the association rules, the network segment, gateway, VLAN, etc. of the virtual network and the port information of the port binding are parsed. Finally, the target test script is configured according to the target test parameters.
[0078] It should be noted that the resource selection algorithm used in the above-mentioned resource selection model is not particularly limited in this example. When implementing the technical solution of the present application, those skilled in the art may refer to the records in the relevant technology. For example, in one implementation method, the above-mentioned resource selection model may be a deep learning model trained based on a neural network combined with a large number of test data samples.
[0079] Figure 6A flowchart of another test script configuration method in an embodiment of the present disclosure is shown. Figure 6 As shown, method 600 may include the following steps:
[0080] In step S610, a test parameter configuration file is obtained to determine the test resources required by the script.
[0081] In some embodiments of the present disclosure, the test parameter configuration file can be executed by executing Figure 2 The specific steps are not described in detail here.
[0082] The test parameter configuration file includes the basic information of the test script, the test parameters and the association rules of the test resources, which can be Figure 3 File 300 is shown.
[0083] In step S620, test resource information of the tested environment is automatically / semi-automatically obtained.
[0084] The test resource information can be automatically acquired from the tested environment by the system, or can be semi-automatically acquired by manual input.
[0085] In step S630, the target test resource is determined according to the test resource information.
[0086] Step S630 may be, for example, Figure 5 The method 500 shown can determine the target test resources according to the basic information through three methods, which will not be described in detail here.
[0087] In step S640, the target test resource selection result is verified.
[0088] Among them, verification may include confirmation and adjustment of the target test resource selection results.
[0089] In step S650, if the verification is successful, the test parameters are determined according to the association relationship.
[0090] In step S660, the test parameters are passed to the test script for execution on the environment under test.
[0091] The test script configuration method 600 of the embodiment of the present disclosure effectively overcomes the defects of the script configuration method in the traditional operation and maintenance technology, effectively eliminates the redundancy problem caused by the offline handover work required in the test script configuration process, optimizes the operation and maintenance process, greatly reduces the manpower and material costs, and reduces the difficulty of cloud platform operation and maintenance work.
[0092] Furthermore, by establishing association rules between test resources and test parameters, test parameters can be automatically filled in based on resource matching rules, which improves the automation level of script configuration and improves the efficiency of cloud platform operation and maintenance.
[0093] Furthermore, by converting the input test parameters of the test script into test resources with an easy-to-understand preset data structure, the conversion from parameter filling to resource selection can be achieved, reducing manual input of parameters and reliance on expert experience.
[0094] Furthermore, by automatically or semi-automatically acquiring resources from the network function virtualization environment under test, it has high flexibility. Furthermore, by unifying the data structure, the test resources are managed in a standardized manner to improve the automation and efficiency of the test.
[0095] Furthermore, different methods for acquiring different test resources are selected according to different test objects corresponding to different basic information, so that the acquisition of test resources becomes more intelligent, efficient, dynamic and automatic.
[0096] Furthermore, the accuracy of target test resource selection can be improved by verifying the selected target test resources and confirming and adjusting the selection results, thereby further improving the integrity and validity of the test data and improving the reliability of the test results.
[0097] Figure 7 A flow chart of a testing method in an embodiment of the present disclosure is shown. The method 700 may include the following steps:
[0098] In step S710, association rules between test resources and test parameters are obtained.
[0099] In step S720, test resource information of the network function virtualization environment under test is obtained.
[0100] In step S730, the target test resource is determined according to the test resource information.
[0101] In step S740, target test parameters are determined according to the target test resources through association rules.
[0102] In step S750, a target test script is configured according to the target test parameters.
[0103] In step S760, the target test script is tested.
[0104] The testing method of the disclosed embodiment effectively overcomes the defects of traditional operation and maintenance testing methods without consuming a lot of manpower and material resources; it can automatically test the cloud platform resources in the network function virtualization environment, effectively assist the operation and maintenance personnel to grasp the status of the cloud platform resources, effectively eliminate the redundancy problems caused by frequent handovers between testing links, and reduce the difficulty of cloud platform resource maintenance.
[0105] Furthermore, by establishing association rules between test resources and test parameters, test parameters can be automatically filled in based on resource matching rules, thereby increasing the degree of test automation and improving test efficiency.
[0106] In some embodiments of the present disclosure, the step of obtaining association rules between test resources and test parameters may include: obtaining basic information of the test script; based on the basic information, obtaining test parameters required for the test script and test resources of a preset data structure; and generating association rules based on the test parameters and test resources.
[0107] The disclosed embodiment converts the input test parameters of the test script into test resources with an easy-to-understand preset data structure, which can realize the conversion from parameter filling to resource selection, reducing the reliance on manual input parameters and expert experience.
[0108] In some embodiments of the present disclosure, before the step of obtaining test resource information of the network function virtualization environment under test, the method may also include: automatically and / or semi-automatically obtaining physical resource information and virtual resource information of the network function virtualization environment under test; and generating test resource information from the physical resource information and the virtual resource information according to a preset data structure.
[0109] The method of the embodiment of the present disclosure automatically or semi-automatically obtains resources from the network function virtualization environment under test, and has high flexibility. Furthermore, the test resources are managed in a standardized manner through a unified data structure to improve the automation and efficiency of the test.
[0110] In some embodiments of the present disclosure, the step of determining the target test resource based on the test resource information includes: obtaining basic information of the target test script; determining the resource type of the corresponding test resource based on the basic information of the target test script; and selecting to execute at least one of the following based on the basic information of the target test script: randomly selecting a target test resource with the same resource type from the test resource information; and / or selecting a target test resource with the same resource type from the test resource information according to a custom rule; and / or selecting a target test resource with the same resource type from the test resource information according to a machine learning method.
[0111] The method of the embodiment of the present disclosure can select different methods for acquiring test resources according to different test objects corresponding to different basic information, so that the acquisition of test resources becomes more intelligent, efficient, dynamic and automatic.
[0112] In some embodiments of the present disclosure, the association rule includes any one of the following: a string concatenation operation, a numerical operation, or a regular matching operation.
[0113] Figure 8 A schematic diagram of a test script configuration device according to an embodiment of the present disclosure is shown. Figure 8 As shown, the device 800 includes:
[0114] The first association rule acquisition module 810 is used to obtain the association rules of test resources and test parameters; the first tested environment resource acquisition module 820 is used to obtain the test resource information of the tested network function virtualization environment; the first test resource selection module 830 is used to determine the target test resources according to the test resource information; the first test parameter parsing module 840 is used to determine the target test parameters through association rules according to the target test resources; and the first test script generation module 850 is used to configure the target test script according to the target test parameters.
[0115] In some embodiments of the present disclosure, the first association rule acquisition module 810 can be used to obtain basic information of a test script; based on the basic information, obtain test parameters and test resources of a preset data structure required for the test script; and generate association rules based on the test parameters and the test resources.
[0116] In some embodiments of the present disclosure, the device 800 may also include a first test resource information generation module, which is used to automatically and / or semi-automatically obtain physical resource information and virtual resource information of the network function virtualization environment under test; and generate test resource information according to a preset data structure based on the physical resource information and virtual resource information.
[0117] In some embodiments of the present disclosure, the first test resource selection module 830 can be used to obtain basic information of a target test script; determine the resource type of a corresponding test resource based on the basic information of the target test script; and select to execute at least one of the following based on the basic information of the target test script: randomly select a target test resource with the same resource type from the test resource information; and / or select a target test resource with the same resource type from the test resource information according to a custom rule; and / or select a target test resource with the same resource type from the test resource information according to a machine learning method.
[0118] In some embodiments of the present disclosure, the association rule includes any one of the following: a string concatenation operation, a numerical operation, or a regular matching operation.
[0119] Fig. 9 A schematic diagram of a test device in an embodiment of the present disclosure is shown. Fig. 9As shown, the testing device 900 includes: a second association rule acquisition module 910, used to obtain association rules between test resources and test parameters; a second tested environment resource acquisition module 920, used to obtain test resource information of the tested network function virtualization environment; a second test resource selection module 930, used to determine target test resources according to the test resource information; a second test parameter parsing module 940, used to determine target test parameters through association rules according to the target test resources; and a second test script generation module 950, used to configure the target test script according to the target test parameters; and a testing module 960, used to test the target test script.
[0120] In some embodiments of the present disclosure, the second association rule acquisition module 910 can be used to obtain basic information of the test script; based on the basic information, obtain the test parameters and test resources of the preset data structure required by the test script; and generate association rules based on the test parameters and test resources.
[0121] In some embodiments of the present disclosure, the device 900 may also include a second test resource information generation module, which is used to automatically and / or semi-automatically obtain physical resource information and virtual resource information of the network function virtualization environment under test; and generate test resource information according to a preset data structure based on the physical resource information and virtual resource information.
[0122] In some embodiments of the present disclosure, the second test resource selection module 930 can be used to obtain basic information of the target test script; determine the resource type of the corresponding test resource based on the basic information of the target test script; and select to execute at least one of the following based on the basic information of the target test script: randomly select a target test resource with the same resource type from the test resource information; and / or select a target test resource with the same resource type from the test resource information according to a custom rule; and / or select a target test resource with the same resource type from the test resource information according to a machine learning method.
[0123] In some embodiments of the present disclosure, the association rule includes any one of the following: a string concatenation operation, a numerical operation, or a regular matching operation.
[0124] In some embodiments of the present disclosure, Fig. 9 The modules in the test system can also form a test system, such as Fig.10 FIG. 2 shows a framework diagram of a test system in an embodiment of the present disclosure. Fig.10 As shown, the system includes:
[0125] The test resource recommender 1000c, used to execute the function of the second association rule acquisition module 910, may include: step S1010, acquiring a test parameter configuration file 1000a including association rules of test resources and test parameters;
[0126] The tested environment resource manager 1000b, used to execute the function of the second tested environment resource acquisition module 920, may include: step S1020 and step S1030, obtaining the test resource information of the tested network function virtualization environment from the NFVI;
[0127] The test resource recommender 1000c, used to execute the function of the second test resource selection module 930, may include: step S1040, determining a target test resource according to the test resource information;
[0128] The test parameter parser 1000d, used to execute the function of the second test parameter parsing module 940, may include: step S1050, determining the target test parameter by association rules according to the target test resource;
[0129] The test script generator 1000e, used to execute the functions of the second test script generating module 950, may include: step S1050, configuring a target test script according to target test parameters;
[0130] The tested environment 1000f is used to execute the function of the test module 960, and may include: step S1060, testing the target test script.
[0131] Regarding the test script configuration device 800, the test device 900, and the test system 1000 in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0132] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0133] Reference below Fig.11 , which shows a schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present application. Fig.11 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0134] Reference Fig.11The electronic device 1100 provided in the embodiment of the present disclosure is in the form of a general computing device. The components of the electronic device 1100 may include but are not limited to: the at least one processing unit 1110, the at least one storage unit 1120, and a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110).
[0135] The storage unit stores a program code, which can be executed by the processing unit 1110, so that the processing unit 1110 performs the steps described in the "Exemplary Method" section of the present specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 1110 can perform the following steps: Figure 1 The method 100 shown in includes: step S110, obtaining association rules between test resources and test parameters; step S120, obtaining test resource information of the network function virtualization environment under test; step S130, determining target test resources according to the test resource information; step S140, determining target test parameters through association rules according to the target test resources; and step S150, configuring the target test script according to the target test parameters.
[0136] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1121 and / or a cache memory unit 1122 , and may further include a read-only memory unit (ROM) 1123 .
[0137] The storage unit 1120 may also include a program / utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0138] Bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0139] The electronic device 1100 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1160. As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0140] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0141] The program product for implementing the above method according to the embodiment of the present disclosure may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, a server, a terminal or a device.
[0142] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, server, terminal, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0143] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, server, terminal, or device.
[0144] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0145] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0146] According to one aspect of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional implementations of the above-mentioned embodiments.
[0147] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0148] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0149] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0150] In the various embodiments of the present disclosure, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.
[0151] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A test script configuration method, characterized in that: The method comprises: Obtain association rules between test resources and test parameters; Obtain test resource information of the network function virtualization environment under test; Determine the target test resource according to the test resource information; According to the target test resource, determining the target test parameter by the association rule; and Configure the target test script according to the target test parameters; Among them, the test resources are physical and / or virtual resources that can be tested in a network function virtualization environment; the test parameters are test parameters required by the test script; the association rules define the operational relationship between test resources and test parameters; the test resource information is physical and / or virtual resource information extracted and generated according to relevant standard data structures; the target test resources are resources selected from the test resource information according to predefined rules and matching the resource type required by the test script.
2. The test script configuration method according to claim 1, characterized in that: The steps of obtaining the association rules of the test resources and the test parameters include: Get basic information about the test script; Based on the basic information, obtaining test parameters required by the test script and test resources with preset data structures; and The association rule is generated based on the test parameter and the test resource.
3. The test script configuration method according to claim 2, characterized in that: Before the step of obtaining the test resource information of the network function virtualization environment under test, the method further includes: Automatically and / or semi-automatically obtain physical resource information and virtual resource information of the network function virtualization environment under test; The physical resource information and the virtual resource information are used to generate the test resource information according to the preset data structure.
4. The test script configuration method according to claim 3, characterized in that: The step of determining the target test resource according to the test resource information comprises: Obtaining basic information of the target test script; Determining the resource type of the corresponding test resource according to the basic information of the target test script; and Based on the basic information of the target test script, select and execute at least one of the following: Randomly selecting the target test resource of the same resource type as the resource from the test resource information; and / or Selecting the target test resource of the same resource type from the test resource information according to a custom rule; and / or The target test resource having the same resource type as the resource is selected from the test resource information according to a machine learning method.
5. The test script configuration method according to claim 4, characterized in that: The association rule includes any one of the following: string concatenation operation, or numerical operation, or regular matching operation.
6. A testing method, characterized in that: The method comprises: Obtain association rules between test resources and test parameters; Obtain test resource information of the network function virtualization environment under test; Determine the target test resource according to the test resource information; According to the target test resources, determining target test parameters by using the association rules; Configure the target test script according to the target test parameters; and Testing the target test script; Among them, the test resources are physical and / or virtual resources that can be tested in a network function virtualization environment; the test parameters are test parameters required by the test script; the association rules define the operational relationship between test resources and test parameters; the test resource information is physical and / or virtual resource information extracted and generated according to relevant standard data structures; the target test resources are resources selected from the test resource information according to predefined rules and matching the resource type required by the test script.
7. A test script configuration device, characterized in that: The device comprises: A first association rule acquisition module, used to acquire association rules between test resources and test parameters; A first tested environment resource acquisition module is used to acquire test resource information of the tested network function virtualization environment; A first test resource selection module, used to determine a target test resource according to the test resource information; A first test parameter parsing module, configured to determine target test parameters according to the target test resources and through the association rules; and A first test script generating module, used for configuring a target test script according to the target test parameters; Among them, the test resources are physical and / or virtual resources that can be tested in a network function virtualization environment; the test parameters are test parameters required by the test script; the association rules define the operational relationship between test resources and test parameters; the test resource information is physical and / or virtual resource information extracted and generated according to relevant standard data structures; the target test resources are resources selected from the test resource information according to predefined rules and matching the resource type required by the test script.
8. A testing device, characterized in that: The device comprises: A second association rule acquisition module is used to acquire association rules between test resources and test parameters; A second tested environment resource acquisition module is used to acquire test resource information of the tested network function virtualization environment; A second test resource selection module, used to determine a target test resource according to the test resource information; A second test parameter parsing module is used to determine target test parameters according to the target test resources and through the association rules; and A second test script generating module is used to configure a target test script according to the target test parameters; and A test module, used for testing the target test script; Among them, the test resources are physical and / or virtual resources that can be tested in a network function virtualization environment; the test parameters are test parameters required by the test script; the association rules define the operational relationship between test resources and test parameters; the test resource information is physical and / or virtual resource information extracted and generated according to relevant standard data structures; the target test resources are resources selected from the test resource information according to predefined rules and matching the resource type required by the test script.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the test script configuration method according to any one of claims 1 to 5 or the test method according to claim 6 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the test script configuration method according to any one of claims 1 to 5 or the test method according to claim 6 is implemented.
Citation Information
Patent Citations
Testing method and device in network function virtualization environment and storage medium
CN112231210A
Test method and device and computer readable storage medium
CN114328210A