Interface testing method, device and server

By obtaining and matching the log information of the Openstack interface, and using regular expressions and fuzzy matching to process URLs and return values, the difficulty in automated testing of the Openstack interface in the existing technology is solved, and efficient interface testing is achieved.

CN112306839BActive Publication Date: 2024-10-29CHINA MOBILE COMM LTD RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910671281.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-24
Publication Date
2024-10-29
Estimated Expiration
2039-07-24

AI Technical Summary

Technical Problem

There is a lack of effective methods in the existing technology to automatically test the calling method and sequence of the Openstack native interface during the image delivery process, making automated testing difficult.

Method used

By obtaining the log information of the Openstack interface, using the attribute information to match the interface table, using regular expressions and fuzzy matching methods to process the URL and return value, and generating a successfully matched native Openstack interface table, the automated testing of the Openstack interface is realized.

Benefits of technology

It improves the testing efficiency of the Openstack interface and ensures the correctness of the interface call format and the accuracy of automated testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112306839B_ABST
    Figure CN112306839B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides an interface testing method, device and server. The method includes: obtaining log information of the Openstack interface of the cloud computing and management platform, the Openstack interface is the interface called during the image distribution process between the network function virtualization orchestrator NFVO and the virtual machine VIM; testing the Openstack interface according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, the Openstack interface table includes: the attribute information of multiple Openstack interfaces called during the image distribution process between the NFVO and VIM. The solution of the present invention now performs automated testing on the Openstack interface, thereby improving the testing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to an interface testing method, device and server. Background Art

[0002] like Figure 1 As shown in the figure, NFVO+ (network function virtualization orchestrator) and VIM (virtual machine) editor can directly exchange information without going through VNFM (virtual network function). When performing the relevant operation process of image management, it is necessary to send the image file on NFVO+ to the VIM that needs to specify the target. The specific process is as follows:

[0003] 1. The operator manually sends the image and needs to specify the target VIM when sending the image.

[0004] 2. NFVO+ calls the Openstack native interface specified in the C7 specification and sends the image to the specified VIM.

[0005] 3. VIM verifies the image and saves it locally.

[0006] 4. NFVO+ confirms that the image has been successfully delivered.

[0007] 5. The operator can view the delivery results on NFVO+.

[0008] Here, you can select one or more images in one operation when sending, or you can specify to send to one or more VIMs.

[0009] Here, image delivery is an asynchronous operation, and NFVO+ can call the Openstack native interface to query the status of image delivery.

[0010] According to the existing technology, when sending an image to a specified VIM, the Openstack native interface is called, but there are more than 200 Openstack native interfaces, and there is no clear description of the calling method and calling order. Therefore, different manufacturers have different understandings and implementation methods of functions. For the same image operation, different manufacturers may call different Openstack interface types and methods, which causes great trouble to the automated testing of Openstack interfaces.

[0011] The prior art has at least the following defects: Currently, there is no suitable method that can completely solve the problem of automated testing of the Openstack native interface called in the process of issuing image files. Summary of the invention

[0012] The present invention provides an interface testing method, device and server, which can realize automatic testing of Openstack interfaces and improve testing efficiency.

[0013] To solve the above technical problems, the embodiments of the present invention provide the following solutions:

[0014] An interface testing method, comprising:

[0015] Obtain log information of the Openstack interface of the cloud computing and management platform, where the Openstack interface is the interface called during the image delivery process between the network function virtualization orchestrator NFVO and the virtual machine VIM;

[0016] The Openstack interface is tested according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, wherein the Openstack interface table includes: attribute information of multiple Openstack interfaces called during the image delivery process between the NFVO and the VIM.

[0017] Optionally, the attribute information of the Openstack interface includes: an operation method, a uniform resource locator URL, and a return value.

[0018] Optionally, testing the Openstack interface according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table includes:

[0019] Matching the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, generating a first Openstack interface table if the match is successful, and processing the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table;

[0020] Matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table;

[0021] The return value of the Openstack interface in the log information is matched with the return value in the third Openstack interface table. If the match is successful, a fourth Openstack interface table is generated, wherein the fourth Openstack interface table includes a native Openstack interface whose operation method, URL, and return value are all matched successfully.

[0022] Optionally, the first Openstack interface table is processed according to the URL of the Openstack interface to obtain a second Openstack interface table, including:

[0023] A regular expression is used to replace variables in the URL of the Openstack interface in the first Openstack interface table to obtain a second Openstack interface table.

[0024] Optionally, when matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, a fuzzy matching method is used for matching.

[0025] Optionally, the log information of the Openstack interface called during the image delivery process between NFVO and VIM is obtained through the reverse proxy server.

[0026] An embodiment of the present invention further provides an interface testing device, comprising:

[0027] An acquisition module is used to obtain log information of the Openstack interface of the cloud computing and management platform, where the Openstack interface is an interface called during the image delivery process between the network function virtualization orchestrator NFVO and the virtual machine VIM;

[0028] The processing module is used to test the Openstack interface according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, wherein the Openstack interface table includes: attribute information of multiple Openstack interfaces called in the process of image delivery between the NFVO and the VIM.

[0029] Optionally, the attribute information of the Openstack interface includes: an operation method, a uniform resource locator URL, and a return value.

[0030] Optionally, the processing module is specifically used to: match the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, if the match is successful, generate a first Openstack interface table, and process the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table;

[0031] Matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table;

[0032] The return value of the Openstack interface in the log information is matched with the return value in the third Openstack interface table. If the match is successful, a fourth Openstack interface table is generated, wherein the fourth Openstack interface table includes a native Openstack interface whose operation method, URL, and return value are all matched successfully.

[0033] Optionally, the first Openstack interface table is processed according to the URL of the Openstack interface to obtain a second Openstack interface table, including:

[0034] A regular expression is used to replace variables in the URL of the Openstack interface in the first Openstack interface table to obtain a second Openstack interface table.

[0035] Optionally, when matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, a fuzzy matching method is used for matching.

[0036] An embodiment of the present invention further provides a server, comprising:

[0037] The processor is used to obtain log information of an Openstack interface of a cloud computing and management platform, where the Openstack interface is an interface called during image delivery between a network function virtualization orchestrator NFVO and a virtual machine VIM; and test the Openstack interface according to attribute information of the Openstack interface in the log information and attribute information of the Openstack interface in an Openstack interface table, where the Openstack interface table includes attribute information of multiple Openstack interfaces called during image delivery between the NFVO and the VIM.

[0038] Optionally, the attribute information of the Openstack interface includes: an operation method, a uniform resource locator URL, and a return value.

[0039] Optionally, the processor is specifically used to: match the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, if the match is successful, generate a first Openstack interface table, and process the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table;

[0040] Matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table;

[0041] The return value of the Openstack interface in the log information is matched with the return value in the third Openstack interface table. If the match is successful, a fourth Openstack interface table is generated, wherein the fourth Openstack interface table includes a native Openstack interface whose operation method, URL, and return value are all matched successfully.

[0042] Optionally, the first Openstack interface table is processed according to the URL of the Openstack interface to obtain a second Openstack interface table, including:

[0043] A regular expression is used to replace variables in the URL of the Openstack interface in the first Openstack interface table to obtain a second Openstack interface table.

[0044] Optionally, when matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, a fuzzy matching method is used for matching.

[0045] An embodiment of the present invention further provides a server, comprising: a processor and a memory storing a computer program, wherein the computer program executes the method described above when executed by the processor.

[0046] An embodiment of the present invention further provides a computer-readable storage medium, comprising instructions, and when the instructions are executed on a computer, the computer executes the method as described above.

[0047] The above solution of the present invention includes at least the following beneficial effects:

[0048] The above scheme of the present invention obtains the log information of the Openstack interface of the cloud computing and management platform, the Openstack interface is the interface called in the image delivery process between the network function virtualization orchestrator NFVO and the virtual machine VIM; the Openstack interface is tested according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, the Openstack interface table includes: the attribute information of multiple Openstack interfaces called in the image delivery process between the NFVO and the VIM. Thereby, the Openstack interface is automatically tested and the test efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of the process of image distribution between NFVO+ and VIM in the prior art;

[0050] Figure 2 This is a flow chart of the interface testing method of the present invention;

[0051] Figure 3 It is a schematic diagram of the process of image distribution between NFVO+, Nginx and VIM of the present invention;

[0052] Figure 4 This is a schematic diagram of a specific implementation flow of the interface testing method of the present invention;

[0053] Figure 5 Schematic diagram of an interface testing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0055] like Figure 2 As shown, an embodiment of the present invention provides an interface testing method, comprising:

[0056] Step 21, obtaining log information of the Openstack interface of the cloud computing and management platform, where the Openstack interface is an interface called during the image delivery process between the network function virtualization orchestrator NFVO and the virtual machine VIM;

[0057] Step 22: Test the Openstack interface according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, wherein the Openstack interface table includes: attribute information of multiple Openstack interfaces called during the image delivery process between the NFVO and the VIM.

[0058] In this embodiment, optionally, the attribute information of the Openstack interface includes: an operation method (Method), a URL (Uniform Resource Locator) and a return value.

[0059] In this embodiment of the present invention, in order to test the Openstack interface, the possible Openstack native interfaces are first integrated into a table, and the interface information is distinguished by columns according to attributes such as component type, return value, operation method, and interface URL. The specific table example is as follows:

[0060]

[0061] This storage format allows the attribute information of the Openstack interface to be classified by field, making it easier to search by field later.

[0062] In an optional embodiment of the present invention, the above step 22 may include:

[0063] Step 221, matching the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, generating a first Openstack interface table if the match is successful, and processing the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table; optionally, using a regular expression to replace variables in the URL of the Openstack interface in the first Openstack interface table to obtain a second Openstack interface table;

[0064] Step 222, matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table; optionally, when matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, a fuzzy matching method is used for matching;

[0065] Step 223, matching the return value of the Openstack interface in the log information with the return value in the third Openstack interface table, and if the match is successful, generating a fourth Openstack interface table, wherein the fourth Openstack interface table includes a native Openstack interface whose operation method, URL, and return value are all matched successfully.

[0066] Taking the fields in the above table as an example, the operation method of the Openstack interface in the log information is matched with the operation method in the Openstack interface table. If the match is successful, a first Openstack interface table is generated. If the operation method in the log information is GET, the first Openstack interface table includes all rows whose operation method is GET.

[0067] Further, the URL of the Openstack interface in the log information is matched with the URL in the second Openstack interface table. If the match is successful, a third Openstack interface table is generated. If the URL in the log information is / v2.1 / {project_id} / flavors, where project_id may be replaced with a regular expression, a row including an operation method of GET and a URL of / v2.1 / {project_id} / flavors is generated in the third Openstack interface table;

[0068] Further, the return value of the Openstack interface in the log information is matched with the return value in the third Openstack interface table. If the match is successful, a fourth Openstack interface table is generated. If the return value in the log information is 200, the fourth Openstack interface table includes: an operation method of GET, a URL of / v2.1 / {project_id} / flavors, and a row with a return value of 200, that is, the third row in the above table. Here, it can be determined that the Openstack interface corresponding to the third row in the above table is a native Openstack interface.

[0069] In an optional embodiment of the present invention, log information of the Openstack interface called during the image delivery process between NFVO and VIM is obtained through a reverse proxy server.

[0070] like Figure 3As shown, the operating environment of NFVO+, Nginx, and VIM can be built, and the operation log of the mirroring distribution process between NFVO+ and VIM can be obtained through the Nginx reverse proxy server, and the fields that need to be matched can be matched.

[0071] Specifically, Figure 4 As shown in the figure, the process of sending image files between NFVO+, Nginx and VIM includes:

[0072] Step 1: Upload the image on NFVO+, grab the log file on Nginx, process it, and pass the key fields as parameters. To facilitate subsequent matching, the parameters passed in here are divided into three parts: operation method (method), interface (URL) and return value (value);

[0073] Step 2: Use the OS processing function provided by Python to read the information in the pre-stored Openstack native interface list;

[0074] Step 3: First search the "operation method" field. Common operation methods between NFVO+ and VIM include GET, POST, DELETE, etc. Take the method parameter passed in step 1 as the source, and traverse the operation method columns in the Openstack interface table in turn to find the row that is consistent with the passed parameter method. If no matching column is found, it returns failure and the program ends;

[0075] Step 4. In the row with the same parameter method generated in step 3, read the corresponding URL column value in the Openstack interface table in turn. Since there are many variable values ​​in the Openstack interface, these variable values ​​are customized according to different components and environments. In order to meet the universality of automated testing, these variables cannot be fixed. Therefore, only regular expression matching can be used here to replace the variable id in the URL information in the Openstack table, and use fuzzy matching to match the interface URL passed in step 1 as accurately as possible; since the variables in the URL information in the Openstack table are replaced by regular expressions, according to the Openstack component name, the uncertain variable names project_id, image_id, server_id, hypervisor_id, etc. are replaced with regular expressions / .* respectively. At the same time, it is also necessary to distinguish whether these variable ids are in the middle or end field, and flexibly use regular expressions to cover and match the URL interface information as comprehensively as possible;

[0076] Step 5: Match the regular expression generated in step 4 with the interface URL passed in step 1. Note that the Findall method (fuzzy matching) should be used here instead of the Match method (exact matching). If there is no match, a failure is returned and the program ends.

[0077] Step 6: If the match is successful, the correct URL value is output, and the corresponding line of the URL matched in step 5 is output;

[0078] Step 7: Search again in the corresponding information column generated in step 6 according to the return value value passed in step 1. If it is not found, it returns failure and the program ends.

[0079] If the corresponding value column is found in step 7, the information with the same return value, operation method and URL is found in the Openstack interface list, that is, the operation log obtained in Nginx does call the Openstack native interface, and the call format is correct, that is, the automated test is completed.

[0080] In the above embodiment of the present invention, an Nginx reverse proxy server is added between NFVO+ and VIM to realize log capture on Nginx; the native Openstack interfaces that may be called are integrated into a table, such as an Excel document, and the interface information is distinguished by columns according to attributes such as component type, return value, operation method, and interface URL, so as to facilitate subsequent matching through algorithms and thus improve test efficiency.

[0081] Then, according to certain matching rules, these attributes are traversed and polled in turn to gradually narrow the test scope. Regular expressions are used to replace the variable values ​​(such as server_id, project_id, etc.) in the more complex interface URL fields in the Openstack interface through regular expressions, and the processed URL interface is matched with the actual captured interaction message information. If the matching conditions are met, the Openstack interface is successfully called, and the interface call format meets the requirements; if the matching conditions are not met, the Openstack native interface is not called, thereby achieving the purpose of automated testing and improving the efficiency of automated testing.

[0082] like Figure 5 As shown, an embodiment of the present invention further provides an interface testing device 50, comprising:

[0083] The acquisition module 51 is used to obtain log information of the Openstack interface of the cloud computing and management platform, where the Openstack interface is an interface called during the image delivery process between the network function virtualization orchestrator NFVO and the virtual machine VIM;

[0084] The processing module 52 is used to test the Openstack interface according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, wherein the Openstack interface table includes: attribute information of multiple Openstack interfaces called in the process of image delivery between the NFVO and the VIM.

[0085] Optionally, the attribute information of the Openstack interface includes: an operation method, a uniform resource locator URL, and a return value.

[0086] Optionally, the processing module 52 is specifically used to: match the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, if the match is successful, generate a first Openstack interface table, and process the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table;

[0087] Matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table;

[0088] The return value of the Openstack interface in the log information is matched with the return value in the third Openstack interface table. If the match is successful, a fourth Openstack interface table is generated, wherein the fourth Openstack interface table includes a native Openstack interface whose operation method, URL, and return value are all matched successfully.

[0089] Optionally, the first Openstack interface table is processed according to the URL of the Openstack interface to obtain a second Openstack interface table, including:

[0090] A regular expression is used to replace variables in the URL of the Openstack interface in the first Openstack interface table to obtain a second Openstack interface table.

[0091] Optionally, when matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, a fuzzy matching method is used for matching.

[0092] It should be noted that the device is Figure 2 For the device corresponding to the method shown, all implementation methods in the above method embodiments are applicable to the embodiments of the device and can achieve the same technical effects.

[0093] An embodiment of the present invention further provides a server, comprising:

[0094] The processor is used to obtain log information of an Openstack interface of a cloud computing and management platform, where the Openstack interface is an interface called during image delivery between a network function virtualization orchestrator NFVO and a virtual machine VIM; and test the Openstack interface according to attribute information of the Openstack interface in the log information and attribute information of the Openstack interface in an Openstack interface table, where the Openstack interface table includes attribute information of multiple Openstack interfaces called during image delivery between the NFVO and the VIM.

[0095] Optionally, the attribute information of the Openstack interface includes: an operation method, a uniform resource locator URL, and a return value.

[0096] Optionally, the processor is specifically used to: match the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, if the match is successful, generate a first Openstack interface table, and process the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table;

[0097] Matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table;

[0098] The return value of the Openstack interface in the log information is matched with the return value in the third Openstack interface table. If the match is successful, a fourth Openstack interface table is generated, wherein the fourth Openstack interface table includes a native Openstack interface whose operation method, URL, and return value are all matched successfully.

[0099] Optionally, the first Openstack interface table is processed according to the URL of the Openstack interface to obtain a second Openstack interface table, including:

[0100] A regular expression is used to replace variables in the URL of the Openstack interface in the first Openstack interface table to obtain a second Openstack interface table.

[0101] Optionally, when matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, a fuzzy matching method is used for matching.

[0102] An embodiment of the present invention further provides a server, comprising: a processor and a memory storing a computer program, wherein the computer program executes the method described above when executed by the processor.

[0103] An embodiment of the present invention further provides a computer-readable storage medium, comprising instructions, and when the instructions are executed on a computer, the computer executes the method as described above.

[0104] The above scheme of the present invention obtains the log information of the Openstack interface of the cloud computing and management platform, the Openstack interface is the interface called in the image delivery process between the network function virtualization orchestrator NFVO and the virtual machine VIM; the Openstack interface is tested according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, the Openstack interface table includes: the attribute information of multiple Openstack interfaces called in the image delivery process between the NFVO and the VIM. Thereby, the Openstack interface is automatically tested and the test efficiency is improved.

[0105] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0106] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0107] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0109] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0110] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0111] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0112] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0113] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An interface testing method, characterized in that: include: Obtain log information of the Openstack interface of the cloud computing and management platform, where the Openstack interface is the interface called during the image delivery process between the network function virtualization orchestrator NFVO and the virtual machine VIM; Testing the Openstack interface according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, wherein the Openstack interface table includes: attribute information of multiple Openstack interfaces called in the process of image delivery between the NFVO and the VIM; The attribute information of the Openstack interface includes: operation method, uniform resource locator URL and return value; Testing the Openstack interface according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table includes: Matching the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, generating a first Openstack interface table if the match is successful, and processing the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table; Matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table; Matching the return value of the Openstack interface in the log information with the return value in the third Openstack interface table, and if the match is successful, generating a fourth Openstack interface table, wherein the fourth Openstack interface table includes native Openstack interfaces whose operation methods, URLs, and return values ​​are all matched successfully; The first Openstack interface table is processed according to the URL of the Openstack interface to obtain a second Openstack interface table, including: A regular expression is used to replace variables in the URL of the Openstack interface in the first Openstack interface table to obtain a second Openstack interface table.

2. The interface testing method according to claim 1, characterized in that: When matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, a fuzzy matching method is used for matching.

3. The interface testing method according to claim 1, characterized in that: The reverse proxy server is used to obtain the log information of the Openstack interface called during the image delivery process between NFVO and VIM.

4. An interface testing device, characterized in that: include: An acquisition module is used to obtain log information of the Openstack interface of the cloud computing and management platform, where the Openstack interface is an interface called during the image delivery process between the network function virtualization orchestrator NFVO and the virtual machine VIM; a processing module, configured to test the Openstack interface according to the attribute information of the Openstack interface in the log information and the attribute information of the Openstack interface in the Openstack interface table, wherein the Openstack interface table includes: attribute information of multiple Openstack interfaces called in the process of image delivery between the NFVO and the VIM; The attribute information of the Openstack interface includes: operation method, uniform resource locator URL and return value; The processing module is specifically used to: match the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, and if the match is successful, generate a first Openstack interface table, and process the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table; Matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table; Matching the return value of the Openstack interface in the log information with the return value in the third Openstack interface table, and if the match is successful, generating a fourth Openstack interface table, wherein the fourth Openstack interface table includes native Openstack interfaces whose operation methods, URLs, and return values ​​are all matched successfully; The first Openstack interface table is processed according to the URL of the Openstack interface to obtain a second Openstack interface table, including: A regular expression is used to replace variables in the URL of the Openstack interface in the first Openstack interface table to obtain a second Openstack interface table.

5. The interface testing device according to claim 4, characterized in that: When matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, a fuzzy matching method is used for matching.

6. A server, characterized in that: include: The processor is used to obtain log information of an Openstack interface of a cloud computing and management platform, where the Openstack interface is an interface called during image delivery between a network function virtualization orchestrator NFVO and a virtual machine VIM; and test the Openstack interface according to attribute information of the Openstack interface in the log information and attribute information of the Openstack interface in an Openstack interface table, where the Openstack interface table includes: attribute information of multiple Openstack interfaces called during image delivery between the NFVO and the VIM; The attribute information of the Openstack interface includes: operation method, uniform resource locator URL and return value; The processor is configured to match the operation method of the Openstack interface in the log information with the operation method in the Openstack interface table, generate a first Openstack interface table if the match is successful, and process the first Openstack interface table according to the URL of the Openstack interface to obtain a second Openstack interface table; Matching the URL of the Openstack interface in the log information with the URL in the second Openstack interface table, and if the match is successful, generating a third Openstack interface table; Matching the return value of the Openstack interface in the log information with the return value in the third Openstack interface table, and if the match is successful, generating a fourth Openstack interface table, wherein the fourth Openstack interface table includes native Openstack interfaces whose operation methods, URLs, and return values ​​are all matched successfully; The processor is used to replace variables in the URL of the Openstack interface in the first Openstack interface table by using a regular expression to obtain a second Openstack interface table.

7. A server, characterized in that: include: A processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 3 is performed.

8. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Automatic testing method and device for interface

    CN104360920A

  • Openstack cloud platform-based automatic test implementation method and system

    CN107704395A