A Redfish interface testing method, computing device and storage medium
By testing the Redfish interface standardization of the first device and comparing resources with the second device, the compatibility issue between the Redfish interface and hardware after hardware iteration was resolved, improving testing efficiency and accuracy, and ensuring the compatibility of the Redfish interface management hardware resources.
Patent Information
- Application Number
- CN202211491319.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-11-25
AI Technical Summary
Existing technologies cannot effectively test the compatibility issues between the Redfish interface and hardware after hardware iteration, especially when the hardware resources are not visible to the Redfish interface, resulting in compatibility test failure.
By testing the Redfish interface compliance of the first device and comparing it with the Redfish resources of the second device, it is determined whether the Redfish resources of the first device cover the compliant resources of the second device. The Redfish interface specification document is directly obtained to obtain the standard value, avoiding pre-setting test items in the computing device, and improving test efficiency and accuracy.
Implemented compatibility testing between the Redfish interface and hardware after hardware iterations, improving test efficiency and accuracy and ensuring that the Redfish interface can manage hardware resources.
Smart Images

Figure CN115904978B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server testing technology, and in particular to a Redfish interface testing method, computing device, and storage medium. Background Art
[0002] Redfish is an open industry standard that provides simple, modern, and secure management capabilities for scalable platform hardware. Based on the unified management interface specification of Redfish, it can effectively reduce the extensive adaptation, development, and testing work associated with different server hardware management interfaces.
[0003] To ensure the stability and availability of the Redfish interface, the server's Redfish interface must be tested for compliance. The current industry Redfish interface testing method involves pre-setting the test items and standard values for each test item on the server. The method then retrieves the universal resource identifier (URI) for each Redfish resource from the server's Redfish resource module. The Redfish interface then sends a request to each resource using the corresponding URI to test the corresponding test item and obtain the test value. Finally, the test value is compared with the corresponding standard value. If they are consistent, the server's Redfish interface is confirmed to be compliant with the standard.
[0004] However, in the scenario of server hardware iteration, compatibility issues introduced by non-standard interface changes during the development process can cause some of the server's original hardware resources to be invisible to the Redfish interface. The above method cannot detect these hardware resources that are invisible to the Redfish interface and the corresponding compatibility issues. Summary of the Invention
[0005] The present application provides a Redfish interface testing method, computing device, and storage medium, which are used in Redfish interface testing scenarios after iterative updates of servers, and can test the compatibility between the updated server's Redfish interface and hardware.
[0006] In a first aspect, the present application provides a Redfish interface testing method, applied to a computing device, the method comprising:
[0007] Testing the conformance of a Redfish interface of a first device, where the first device is a computing device obtained by adding hardware to or replacing hardware of a different model with that of a second device;
[0008] If the Redfish interface of the first device passes the compliance test, and the Redfish resources of the first device include all first resources, then outputting information indicating that the Redfish interface compatibility test of the first device has passed, wherein the first resources are the same Redfish resources as the corresponding second resources in the second device, the first resources and the second resources have a one-to-one correspondence, and the second resources are the Redfish resources in the second device that comply with the compliance standard;
[0009] If the Redfish interface of the first device fails the compliance test, or if the Redfish interface of the first device passes the compliance test and the Redfish resource of the first device lacks at least one of the first resources, information indicating that the Redfish interface compatibility test of the first device fails is output.
[0010] In this application, by testing the compliance of the Redfish interface of the first device and comparing the test result with the second resource of the second device, it is tested whether the hardware that can be managed by the Redfish function in the second device can be managed by the Redfish function in the first device, thereby testing the compatibility between the Redfish interface and the hardware of the first device after the hardware iteration update.
[0011] In one possible implementation, before outputting information indicating that the Redfish interface compatibility test of the first device has passed or outputting information indicating that the Redfish interface compatibility test of the first device has failed, the method further includes: if the Redfish interface of the first device passes the compliance test, obtaining second result data obtained from testing the compliance of the Redfish interface of the second device; comparing the second result data with the first result data obtained from testing the compliance of the Redfish interface of the first device; and determining, based on the comparison result, whether the Redfish resources of the first device include all of the first resources.
[0012] In this application, by comparing the first result data and the second result data, it is determined whether the compliant Redfish resources of the first device cover the compliant Redfish resources of the second device, which can easily and intuitively determine the compatibility between the Redfish interface and the hardware in the first device obtained by hardware iterative update.
[0013] In a possible implementation, obtaining the second result data obtained by testing the standardization of the Redfish interface of the second device includes: testing the standardization of the Redfish interface of the second device to obtain the second result data.
[0014] In the present application, the second result data is obtained by directly testing the standardization of the Redfish interface of the second device, and the data reliability is higher.
[0015] In one possible implementation, before testing the compliance of the Redfish interface of the first device, the method further includes: obtaining and parsing a Redfish interface specification document to obtain the specification standard; and testing the compliance of the Redfish interface of the first device includes: testing the compliance of the Redfish interface of the first device according to the specification standard.
[0016] In this application, the standard values of the test are obtained by obtaining and parsing the specification document, which eliminates the need to preset the standard values in the computing device, saves manpower, and improves testing efficiency.
[0017] In one possible implementation, testing the conformance of the Redfish interface of the first device according to the specification standard includes: obtaining a uniform resource locator (URL) and resource attributes of a Redfish resource of the first device; and testing whether the URL and resource attributes of the Redfish resource of the first device conform to the specification standard.
[0018] In this application, the compliance of the Redfish resource is tested by testing whether its URL and resource attributes comply with the specification standards. This eliminates the need to pre-set test items in the computing device, saves manpower, and improves testing efficiency.
[0019] In one possible implementation, the resource attribute includes a resource type, a resource attribute name, and a resource attribute value; and testing whether the URL and resource attribute of the Redfish resource of the first device conform to the specification standard includes: matching a resource template corresponding to the resource type in the specification standard according to the resource type of the Redfish resource of the first device; and if the URL of the Redfish resource of the first device conforms to the URL specification in the resource template, testing whether the resource attribute name and resource attribute value of the Redfish resource of the first device conform to the attribute specification in the resource template.
[0020] In this application, by first testing whether the URL of the Redfish resource is compliant and then testing whether the resource attributes are compliant, the situation where the obtained Redfish resource content does not match due to non-compliant URLs can be avoided, which can improve the accuracy and efficiency of compliance testing.
[0021] In a second aspect, the present application provides a Redfish interface testing device, the device comprising:
[0022] a testing unit, configured to test the conformance of a Redfish interface of a first device, where the first device is a computing device obtained by adding hardware to the second device or replacing hardware of a different model;
[0023] an output unit, configured to output information that the Redfish interface compatibility test of the first device has passed when the Redfish interface of the first device has passed the compliance test and the Redfish resources of the first device include all first resources, wherein the first resources are the same Redfish resources as corresponding second resources in the second device, the first resources and the second resources have a one-to-one correspondence, and the second resources are Redfish resources in the second device that comply with the compliance standard;
[0024] The output unit is further configured to output information indicating that the Redfish interface compatibility test of the first device has failed when the Redfish interface of the first device fails the normative test or when the Redfish interface of the first device passes the normative test and at least one of the first resources is missing from the Redfish resources of the first device.
[0025] In one possible implementation, the apparatus further includes: an acquiring unit configured to acquire, when the Redfish interface of the first device passes the compliance test, second result data obtained from testing the compliance of the Redfish interface of the second device; a comparing unit configured to compare the second result data with the first result data obtained from testing the compliance of the Redfish interface of the first device; and a determining unit configured to determine, based on the comparison result, whether the Redfish resources of the first device include all of the first resources.
[0026] In a possible implementation, the obtaining unit is specifically configured to test the compliance of the Redfish interface of the second device to obtain the second result data.
[0027] In a possible implementation, the acquiring unit is further configured to acquire and parse a Redfish interface specification document to obtain the specification standard; and the testing unit is specifically configured to test the compliance of the Redfish interface of the first device according to the specification standard.
[0028] In a possible implementation, the testing unit is specifically configured to: obtain a uniform resource locator (URL) and resource attributes of a Redfish resource of the first device; and test whether the URL and resource attributes of the Redfish resource of the first device comply with the specification standard.
[0029] In one possible implementation, the resource attribute includes a resource type, a resource attribute name, and a resource attribute value; the testing unit is specifically configured to: match a resource template corresponding to the resource type in the specification standard according to the resource type of the Redfish resource of the first device; and if the URL of the Redfish resource of the first device complies with the URL specification in the resource template, test whether the resource attribute name and resource attribute value of the Redfish resource of the first device comply with the attribute specification in the resource template.
[0030] In a third aspect, the present application provides a computing device, comprising:
[0031] Processor, memory;
[0032] The memory stores instruction operations or codes;
[0033] The processor is configured to communicate with the memory and execute instruction operations or codes in the memory to perform any one of the methods provided in the first aspect.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium, which includes instructions. When the instructions are executed on a computer, the computer executes any one of the methods provided in the first aspect.
[0035] It should be understood that the implementation and beneficial effects of the above-mentioned aspects can be referenced to each other. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A system architecture diagram of a Redfish interface test provided in an embodiment of the present application;
[0037] Figure 2 A data flow diagram for another Redfish interface test provided in an embodiment of the present application;
[0038] Figure 3 A flowchart of a Redfish interface testing method provided in an embodiment of the present application;
[0039] Figure 4 A schematic diagram of a process for obtaining the resource content of a Redfish resource provided in an embodiment of the present application;
[0040] Figure 5 A schematic diagram of the structure of a Redfish interface specification document provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of a flow chart for a Redfish interface compliance test provided in an embodiment of the present application;
[0042] Figure 7 A schematic diagram of the structure of a Redfish interface testing device provided in an embodiment of the present application;
[0043] Figure 8 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present application, rather than all the embodiments. Those skilled in the art will appreciate that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0045] The terms "first," "second," and the like in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.
[0046] In the prior art, when performing functional testing or compliance testing on a computing device's Redfish interface, a standard value is first preset in the computing device, then a test value is obtained by accessing a Redfish resource through the Redfish interface. Finally, the test value is tested to see if it is the same as the standard value to determine whether the computing device's Redfish interface functions normally or whether the Redfish resource is compliant.
[0047] However, after a computing device's hardware is iteratively updated, if the Redfish interface is incompatible with the updated hardware, the attribute names, attribute values, value lengths, or data types of the Redfish resources corresponding to the original hardware will change, rendering the Redfish resources invisible to the Redfish interface and unable to be managed by the Redfish interface. Therefore, existing testing methods are difficult to test for compatibility issues between the Redfish interface and computing devices.
[0048] It should be noted that the "Redfish resources" mentioned in this application document refer to the hardware resources under the Redfish root directory and managed by the Redfish function; the collection of all resources in the Redfish root directory can also be called root resources. Among them, Redfish resources are open data (Odata) protocol files.
[0049] It is understandable that the Redfish root directory also contains a collection resource consisting of multiple Odata protocol files. This collection resource is similar to a "folder" rather than a Redfish resource corresponding to a hardware resource.
[0050] It should be noted that the "compliant" Redfish resources mentioned in this application document refer to Redfish resources that comply with the Redfish specification standards.
[0051] The present application scheme is applied to the Redfish interface testing scenario of a computing device after iterative hardware updates, and is used to test the compatibility between the Redfish interface and the hardware of the updated computing device. Specifically, it is used to test whether the hardware resources managed by the Redfish function in the computing device before the update can be managed under the Redfish function of the updated computing device.
[0052] It should be noted that, in this application document, for the sake of clarity and brevity, the updated computing device may be referred to as a descendant of the pre-update computing device, and the pre-update computing device may be referred to as the predecessor of the corresponding descendant device. For example, servers of the same series and adjacent models produced by the same manufacturer, or two computing devices connected to adjacent pluggable devices of the same type, may be considered.
[0053] It is understandable that there may be an inheritance relationship between the corresponding predecessor devices and the descendant devices, that is, the descendant devices are computing devices obtained by adding hardware or replacing hardware of different models based on the corresponding predecessor devices, and the Redfish resources of the two are not exactly the same.
[0054] It is understandable that the previous generation device and the next generation device can be the same computing device before and after the hardware iteration update, or they can be two computing devices corresponding to two different hardware compositions and layouts before and after the hardware iteration update.
[0055] It is understandable that the solution of the present application can also be applied to the scenario of testing the compatibility of pluggable hardware of different models or versions with the Redfish interface of the same computing device.
[0056] See also Figure 1 , Figure 1A system architecture diagram of a Redfish interface test provided in an embodiment of the present application, wherein the system architecture includes a device under test 10 and a reference device 20.
[0057] It is understandable that for functional testing or specification testing, it is only necessary to preset standard values on the device under test 10 and then perform the test; while for compatibility testing, a reference device 20 serving as the device under test 10 and providing data of the previous generation device of the device under test 10 is required for comparative testing.
[0058] The device under test 10 and the reference device 20 can be computing devices such as servers, storage controllers, switches, routers, base station controllers, computing offload cards, computing acceleration cards, computers, and laptops. Figure 1 The specific forms of the device under test 10 and the reference device 20 shown are not limited.
[0059] The device under test 10 is connected to the reference device 20, and data can be transmitted between the two.
[0060] Optionally, the reference device 20 may be a previous generation device of the device under test 10 .
[0061] In this case, the device under test 10 and the reference device 20 can each perform a compliance test on their own Redfish interface; the device under test 10 then obtains the second result data of the compliance test stored in the reference device 20 and compares it with the first result data of its own compliance test; if the compliant Redfish resources in the device under test 10 include all first resources that are the same as the compliant Redfish resources in the reference device 20, the device under test 10 can output a result that the Redfish interface compatibility test passed; if the compliant Redfish resources in the device under test 10 lack at least one of the first resources, the device under test 10 can output a result that the Redfish interface compatibility test failed.
[0062] Optionally, the reference device 20 may be a cloud device, and the reference device 20 is used to store second result data of a Redfish interface compliance test of a predecessor device of the device under test 10 .
[0063] In this case, the device under test 10 can perform a Redfish interface compliance test on itself, obtain the second result data of the previous generation device from the reference device 20, and finally perform a Redfish interface compatibility test based on the second result data and the first result data of its own compliance test.
[0064] See also Figure 2 , Figure 2This is a data flow diagram of a Redfish interface test provided in the embodiment of the present application. Figure 1 and Figure 2 , explaining the data flow in the system architecture of the Redfish interface test provided by this application.
[0065] like Figure 2 As shown, the data of the Redfish interface test needs to pass through the first device 30 and the second device 40, the testing unit 50, the comparing unit 60 and the output unit 70 from generation to output.
[0066] The first device 30 and the second device 40 are corresponding predecessor and successor devices. In this embodiment, the first device is described as a successor device and the second device as a predecessor device. It should be understood that this is an example and not a limitation.
[0067] The testing unit 50 can be configured to obtain a Redfish interface specification document from a cloud server or the internet 80; then obtain the uniform resource locator (URL) of the Redfish resource in the first device 30 and the second device 40; and finally, perform a Redfish interface compliance test on the first device 30 and the second device 40 based on the URL and the specification document. The specific implementation method of this test can be found in the methods section below.
[0068] After the test is completed, the testing unit 50 may also be configured to send the normative test result data of the Redfish interface of the first device 30 and the second device 40 to the comparing unit 60 .
[0069] Comparison unit 60 is configured to compare the test results of each Redfish resource in the compliance test result data of the two devices, if the compliance test of the Redfish interface of the first device 30 passes. Specifically, comparison unit 60 may first obtain a compliant Redfish resource from the second device 40, then traverse the first result data of the first device 30 to find the same Redfish resource and determine whether it is compliant. If so, the compatibility test of the Redfish interface of the first device 30 with the hardware resource corresponding to the Redfish resource passes.
[0070] After the comparison is completed, the comparison unit 60 may be further configured to send the comparison result to the output unit 70. The output unit 70 may be configured to output information indicating that the Redfish interface compatibility test of the first device 30 has passed when the Redfish resources of the first device 30 include all first resources that are identical to the compliant Redfish resources of the second device 40.
[0071] Conversely, the output unit 70 is further configured to output information that the Redfish interface compatibility test of the first device 30 has failed when the compliance test of at least one first resource that is the same as the compliant Redfish resource of the first device 30 and the second device 40 has failed.
[0072] The comparison unit 60 is further configured to send relevant information to the output unit 70 when the Redfish interface of the first device 30 fails the compliance test, so that the output unit 70 outputs information that the Redfish interface compatibility test of the first device 30 fails.
[0073] It should be noted that, in a specific implementation, the test unit 50, the comparison unit 60 and the output unit 70 may be arranged in one or more other computing devices, or may be arranged in the first device 30. Figure 2 The composition structure shown in the figure does not constitute a limitation on the connection relationship or positional relationship between the three units of the testing unit 50, the comparing unit 60 and the output unit 70 and the first device 30.
[0074] based on Figure 1 and Figure 2 For the system architecture and data flow shown in Figure 3 , an embodiment of the present application also provides a Redfish interface testing method, which is applied to a computing device and specifically includes steps 301 and 303.
[0075] 301. The computing device tests the conformance of the Redfish interface of the first device.
[0076] The first device is a computing device obtained by adding hardware to the second device or replacing hardware of a different model. That is, the first device is a descendant device of the second device.
[0077] Optionally, the computing device that executes the method of this embodiment is a first device.
[0078] Specifically, the computing device tests the standardization of the Redfish interface of the first device, which is actually testing the standardization of all Redfish resources of the first device. Therefore, it is necessary to first obtain the resource content of all Redfish resources of the first device.
[0079] See also Figure 4 , Figure 4 A flowchart of obtaining the resource content of a Redfish resource of a first device provided in an embodiment of the present application is applied to a computing device and specifically includes steps 401 to 405.
[0080] 401. Obtain subordinate resources of the Redfish root resource of the first device.
[0081] The path of the Redfish root resource is: / redfish / v1.
[0082] The computing device may obtain the subordinate resources of the Redfish root resource through an automated code tool or software program.
[0083] 402. Determine whether the subordinate resource is a collection resource or an OData protocol file.
[0084] After obtaining a subordinate resource, the computing device may perform a judgment. If the subordinate resource is a collection resource, step 404 is executed; if the subordinate resource is an Odata protocol file, step 403 is executed.
[0085] The types of the subordinate resources include Odata protocol files, and dictionary or list resources.
[0086] Among them, dictionary or list resources can be called collection resources, and the subordinate resources contained in these dictionary or list resources may be Odata protocol files or collection resources. For example, the subordinate resource of the dictionary resource is the list resource, or the subordinate resource of the list resource is the dictionary resource.
[0087] 403. Save the resource content of the Odata protocol file.
[0088] If the subordinate resource is an Odata protocol file, then the Odata protocol file is the Redfish resource that needs to be obtained. The resource content of the Odata file includes a universal resource identifier (URI) for identifying the Redfish resource and resource properties describing the Redfish resource.
[0089] Among them, the computing device can save the resource content of the Odata protocol file to a preset resource content archive, or create a new archive to store the resource content.
[0090] The Redfish interface uses the OData protocol to specify the attribute "odata.id" as the identifier for URIs. A computing device can obtain the identifiers of all Redfish resource URIs on the first device by obtaining all "odata.id" attributes and their values in the first device's Redfish root directory. Furthermore, the computing device can retrieve the URIs and attribute data for all Redfish resources on the first device by requesting and saving the resource content based on each Redfish resource's identifier.
[0091] It is understood that when a hardware resource is not visible to the Redfish interface, the computing device will fail to retrieve the value of the Redfish resource corresponding to the hardware resource. In this case, the computing device may assign the value of "null" to the Redfish resource or not display it. In subsequent compliance testing, the Redfish resource will be considered non-compliant with the specification and will fail compliance testing.
[0092] After saving the resource content of the Odata protocol file, the computing device may execute step 405 .
[0093] 404. Get the subordinate resources of the collection resource.
[0094] If the subordinate resource is a collection resource, it is necessary to further fetch the subordinate resources of the collection resource. After acquiring the subordinate resources, step 402 is executed again.
[0095] 405. Determine whether the resource content of the Redfish resource of the first device has been saved.
[0096] Among them, the computing device can use a recursive traversal method to obtain and save the Redfish resource of the first device; if the Odata file saved in step 403 is the last subordinate resource traversed, the computing device can determine that the resource content of the Redfish resource of the first device has been saved, thereby ending the process of obtaining the resource content of the Redfish resource of the first device; otherwise, step 401 is executed to obtain the next subordinate resource.
[0097] In the embodiment of the present application, the resource content of the Redfish resource of the first device can be obtained efficiently and accurately through the recursive traversal method.
[0098] After obtaining the resource content of the Redfish resource of the first device, a standard value corresponding to the test may be obtained, and then a normative test may be performed on the Redfish interface of the first device.
[0099] In a possible implementation, a test item and a standard value corresponding to the test item are preset in the computing device.
[0100] In another possible implementation, the computing device may obtain and parse the specification document of the Redfish interface to obtain the specification standard.
[0101] It will be understood that this specification includes standard values for all test items.
[0102] The computing device may obtain the latest specification document from the Redfish official website in real time via the Internet, or may obtain the specification document from a memory or other connected device.
[0103] The computing device may parse the specification document using a document parsing tool based on the Python programming language.
[0104] See Figure 5 , Figure 5 This is a structural diagram of a Redfish interface specification document in an embodiment of the present application, which includes specific content under a resource template under the Redfish interface.
[0105] like Figure 5 As shown in Figure 6, Section 6.13 of the specification document contains the resource template and specification content corresponding to the Redfish resource of the basic input output system (BIOS) resource type, including the specification content related to BIOS URIs in Section 6.13.2 and the specification content related to BIOS resource attributes in Section 6.13.3.
[0106] The Redfish interface uses the Odata protocol to define the attribute that identifies the resource type as "odata.type". At the same time, for each resource type, the attributes belonging to the resource type are defined in its resource template, including the attribute name, attribute type, and a few attributes also have a specified value range.
[0107] In the specification document, the resource template is used to standardize the Redfish resource of the corresponding resource type. Specifically, the Redfish resource is constrained by the specification content in the URI list and resource attribute list of the specification document.
[0108] Among them, URL is part of URIs. Figure 5 As shown in the following example, the URL of a Redfish resource of type BIOS should conform to the specification: / redfish / v1 / Systems / {ComputerSystemId} / BIOS.
[0109] like Figure 5 As shown, resource attributes include resource type and attribute registry string attributes.
[0110] By obtaining and parsing the specification document, the standard values of all test items corresponding to each Redfish resource can be obtained, eliminating the need to set corresponding test items and standard values for different Redfish resources in the computing device, which can improve testing efficiency.
[0111] After obtaining the above standard value, the computing device may perform a compliance test on the Redfish interface of the first device according to the specification document.
[0112] In one possible implementation, the computing device may obtain a corresponding URL from the resource content of the Redfish resource of the first device; then, based on the URL, send a test request for a corresponding preset test item to the Redfish interface of the first device, and obtain a test value responded by the Redfish interface; and compare the test value with the standard value corresponding to the preset test item in the specification document. If the test values of all Redfish resources are consistent with the corresponding standard value, the normative test of the Redfish interface of the first device passes; if the test value of at least one Redfish resource is inconsistent with the corresponding standard value, the normative test of the Redfish interface of the first device fails.
[0113] Among them, Redfish resources of different resource types can correspond to different preset test items.
[0114] In another possible implementation, the computing device may obtain the URL and resource attributes of the Redfish resource of the first device; and then test whether the URIs and resource attributes of the Redfish resource of the first device comply with the specification standards in the specification document.
[0115] For details, please refer to Figure 6 , Figure 6 A schematic diagram of a Redfish interface compliance test flow provided in an embodiment of the present application is applied to a computing device, such as Figure 6 As shown, the process specifically includes steps 601 to 604.
[0116] 601. Obtain the URL and resource attributes of the Redfish resource of the first device.
[0117] The resource attributes include resource type, resource attribute name and resource attribute value.
[0118] The computing device may obtain the corresponding URL and resource attributes from the resource content of the Redfish resource of the first device obtained above.
[0119] 602. Match a resource template corresponding to the resource type of the Redfish resource in the specification document.
[0120] The computing device may perform compliance testing on the Redfish resources of the first device one by one, or may perform compliance testing on multiple Redfish resources simultaneously using multiple threads.
[0121] The computing device may first obtain the resource template of the Redfish resource, and then traverse the resource template in the secondary title of the specification document to obtain the corresponding specification standard.
[0122] 603. Determine whether the URL of the Redfish resource complies with the URL specification in the resource template.
[0123] The computing device may match the Redfish URL with the URL format in the URL specification. If the match is successful, step 604 is executed. If the match is not successful, it is determined that the Redfish interface of the first device has failed the compliance test.
[0124] 604. Determine whether the resource attributes of the Redfish resource comply with the attribute specifications in the resource template.
[0125] Among them, the computing device can first match the resource attribute name of the Redfish resource with the standard attribute name in the attribute specification, and match the resource attribute value of the Redfish resource with the resource attribute value format in the attribute specification; if both match successfully, the Redfish resource complies with the attribute specification; if at least one of them does not match, the Redfish resource does not comply with the attribute specification.
[0126] If the resource attributes of all Redfish resources of the first device comply with the attribute specification, it is determined that the compliance test of the Redfish interface of the first device has passed.
[0127] If the resource attribute of at least one Redfish resource of the first device does not comply with the attribute specification, it is determined that the compliance test of the Redfish interface of the first device has failed.
[0128] By detecting whether the URL and resource attributes of the Redfish resource of the first device comply with the specification standards, the standardization of the Redfish interface is tested, thereby eliminating the need to preset test items and improving test efficiency.
[0129] 302. If the Redfish interface of the first device passes the compliance test, and the Redfish resources of the first device include all first resources, the computing device outputs information indicating that the Redfish interface compatibility test of the first device has passed.
[0130] Among them, the Redfish interface of the first device passes the normative test, indicating that all Redfish resources of the first device comply with the normative standards.
[0131] The first resource is a Redfish resource identical to a corresponding second resource in the second device, and the second resource is a compliant Redfish resource in the second device. The first resource and the second resource have a one-to-one correspondence.
[0132] It should be noted that the first resource and the second resource are the same, which means that their resource types and resource attributes are the same, and the specific values of their resource attributes may change due to overall hardware changes or interface implementation changes.
[0133] For example, the number of compliant second resources in the second device is 26, namely Redfish resources A to Z; the first resources at this time are also Redfish resources A to Z; then the computing device can determine whether the Redfish resources of the first device include Redfish resources A to Z to determine whether to execute step 302 or step 303.
[0134] When the computing device outputs the information that the first device has passed the Redfish interface compatibility test, it may also output the information that the first device has passed the Redfish interface standardization test.
[0135] It is understandable that, in order to determine the second resource, it is necessary to obtain the second result data obtained by testing the standardization of the Redfish interface of the second device.
[0136] In one possible implementation, the computing device may perform a compliance test on the Redfish interface of the second device to obtain second result data to determine the second resource in the second device.
[0137] The method for performing a compliance test on the Redfish interface of the second device is similar to the method for the computing device to perform a compliance test on the Redfish interface of the first device in step 301. For details, please refer to the relevant parts of step 301 and will not be repeated here.
[0138] In another possible implementation, the computing device may obtain the second result data from the second device or another device that stores the second result data of the Redfish interface of the second device, and determine the second resource in the second device.
[0139] In one possible implementation, when the Redfish interface of the first device passes the compliance test, after obtaining the second result data and the first result data of the compliance test of the Redfish interface of the first device, the computing device may compare the first result data with the second result data, and finally determine whether the Redfish resources of the first device include all of the first resources based on the comparison result.
[0140] The computing device may compare the test results of each Redfish resource in the first result data and the second result data one by one. Specifically, the computing device may first obtain a compliant Redfish resource in the second result data, then traverse the first result data to find the same Redfish resource and determine whether it is compliant. If it is compliant, the compatibility test of the Redfish interface of the first device with the hardware resource corresponding to the Redfish resource has passed.
[0141] When the Redfish resources of the first device include all first resources, it means that the hardware resources corresponding to the first resources and the second resources can be managed by the Redfish interface in both the first device and the second device and can perform the same functions; therefore, it can be determined that the compatibility between the hardware of the first device and the Redfish interface is normal.
[0142] 303. If the Redfish interface of the first device fails the compliance test, or if the Redfish interface of the first device passes the compliance test and the Redfish resource of the first device lacks at least one first resource, output information indicating that the Redfish interface compatibility test of the first device fails.
[0143] The compatibility test of the Redfish interface of the first device needs to be based on the passing of the normative test of the Redfish interface.
[0144] When the Redfish resources of the first device include at least one missing first resource, this means that the hardware resources that can be normally managed by the Redfish function in the second device are not visible to the Redfish function in the first device, that is, they cannot be normally managed by the Redfish function. In this case, the hardware resources cannot function normally, and a compatibility issue occurs between the hardware of the first device and the Redfish interface.
[0145] If the Redfish interface of the first device fails the normative test, the computing device may output information indicating that both the normative test and the compatibility test of the Redfish interface of the first device have failed.
[0146] It is understandable that the information output by the computing device indicating whether the compatibility is passed or not may be information that can be perceived by a tester, and may specifically be text, audio, or video.
[0147] It is understandable that when the first device is obtained through hardware iteration and update, the compliant Redfish resources in the first device may not have corresponding data sources in the second device due to reasons such as new hardware or changes in interface implementation, and the corresponding Redfish resources in the Redfish interface compliance test of the second device may fail the compliance test. This situation is not caused by compatibility issues between the Redfish interface and the hardware, and therefore does not affect the results of the compatibility test.
[0148] In an embodiment of the present application, by testing the compliance of the Redfish interface of the first device and detecting whether the compliant Redfish resources of the first device include a first resource that is identical to a second resource of the second device, the compliance of the Redfish interface of the first device is tested, and the compatibility between the server Redfish interface and the hardware components after the hardware iteration update can be tested.
[0149] The above content describes the Redfish interface testing method provided in the embodiment of the present application. The following describes the Redfish interface testing device provided in the embodiment of the present application.
[0150] See also Figure 7 The present application also provides a Redfish interface testing device 700, including:
[0151] A testing unit 701 is configured to test the conformance of a Redfish interface of a first device, where the first device is a computing device obtained by adding hardware to a second device or replacing hardware of a different model.
[0152] an output unit 702 configured to output information that the Redfish interface compatibility test of the first device has passed when the Redfish interface of the first device has passed the compliance test and the Redfish resources of the first device include all first resources, wherein the first resources are the same Redfish resources as corresponding second resources in the second device, the first resources and the second resources have a one-to-one correspondence, and the second resources are Redfish resources in the second device that comply with the compliance standard;
[0153] The output unit 702 is further configured to output information indicating that the Redfish interface compatibility test of the first device has failed when the Redfish interface of the first device has failed the normative test, or when the Redfish interface of the first device has passed the normative test and at least one of the first resources is missing from the Redfish resources of the first device.
[0154] In one possible implementation, the Redfish interface testing apparatus 700 further includes: an acquiring unit 703, configured to acquire, when the Redfish interface of the first device passes the compliance test, second result data obtained from testing the compliance of the Redfish interface of the second device; a comparing unit 704, configured to compare the second result data with the first result data obtained from testing the compliance of the Redfish interface of the first device; and a determining unit 705, configured to determine, based on the comparison result, whether the Redfish resources of the first device include all of the first resources.
[0155] In a possible implementation, the obtaining unit 703 is specifically configured to test the compliance of the Redfish interface of the second device to obtain the second result data.
[0156] In a possible implementation, the acquiring unit 703 is further configured to acquire and parse a Redfish interface specification document to obtain the specification standard; and the testing unit 701 is specifically configured to test the compliance of the Redfish interface of the first device according to the specification standard.
[0157] In a possible implementation, the testing unit 701 is specifically configured to: obtain a uniform resource locator (URL) and resource attributes of the Redfish resource of the first device; and test whether the URL and resource attributes of the Redfish resource of the first device comply with the specification standard.
[0158] In one possible implementation, the resource attribute includes a resource type, a resource attribute name, and a resource attribute value; the testing unit 701 is specifically configured to: match a resource template corresponding to the resource type in the specification standard according to the resource type of the Redfish resource of the first device; and if the URL of the Redfish resource of the first device complies with the URL specification in the resource template, test whether the resource attribute name and resource attribute value of the Redfish resource of the first device comply with the attribute specification in the resource template.
[0159] See also Figure 8 , an embodiment of the present application further provides a computing device 800 , which includes a processor 801 and a memory 803 .
[0160] The memory 803 stores instruction operations or codes; the processor 801 is configured to communicate with the memory 803 and execute the instruction operations or codes in the memory 803 to perform the following operations: Figure 3 Provided Redfish interface test methods.
[0161] Optionally, the processor 801 and the memory 803 are connected via a bus 802 .
[0162] Another embodiment of the present application further provides a computer-readable storage medium, which includes instructions. When the instructions are executed on a computer, the computer executes the following Figure 3 Provided Redfish interface test methods.
[0163] 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 embodiments of this application.
[0164] Those skilled in the art will 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.
[0165] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely 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.
[0166] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0167] In addition, each functional unit in each embodiment of the present application 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.
[0168] 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 embodiment of the present application, 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, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A Redfish interface testing method, characterized in that: The method comprises: Testing the conformance of a Redfish interface of a first device, where the first device is a computing device obtained by adding hardware to or replacing hardware of a different model with that of a second device; If the Redfish interface of the first device passes the compliance test, and the Redfish resources of the first device include all first resources, outputting information indicating that the Redfish interface compatibility test of the first device has passed, wherein the first resources are the same Redfish resources as the corresponding second resources in the second device, the first resources and the second resources have a one-to-one correspondence, and the second resources are the Redfish resources in the second device that comply with the compliance standards; If the Redfish interface of the first device fails the compliance test, or if the Redfish interface of the first device passes the compliance test and the Redfish resource of the first device lacks at least one of the first resources, information indicating that the Redfish interface compatibility test of the first device fails is output.
2. The method according to claim 1, characterized in that Before outputting information that the first device has passed the Redfish interface compatibility test, or outputting information that the first device has failed the Redfish interface compatibility test, the method further includes: If the Redfish interface of the first device passes the compliance test, obtaining second result data obtained by testing the compliance of the Redfish interface of the second device; Comparing the second result data with the first result data obtained by testing the standardization of the Redfish interface of the first device; Determine, based on the comparison result, whether the Redfish resources of the first device include all the first resources.
3. The method according to claim 2, characterized in that The obtaining of second result data obtained by testing the standardization of the Redfish interface of the second device includes: The Redfish interface of the second device is tested for compliance with standards, and the second result data is obtained.
4. The method according to any one of claims 1 to 3, characterized in that Before testing the conformance of the Redfish interface of the first device, the method further includes: Obtain and parse the Redfish interface specification document to obtain the specification standard; Testing the Redfish interface of the first device for compliance includes: According to the specification standard, the compliance of the Redfish interface of the first device is tested.
5. The method according to claim 4, characterized in that The step of testing the compliance of the Redfish interface of the first device according to the specification standard includes: Obtaining a uniform resource locator (URL) and resource attributes of a Redfish resource of the first device; Testing whether the URL and resource attributes of the Redfish resource of the first device comply with the specification standard.
6. The method according to claim 5, characterized in that The resource attributes include a resource type, a resource attribute name, and a resource attribute value; and the step of testing whether the URL and resource attributes of the Redfish resource of the first device comply with the specification standard includes: According to the resource type of the Redfish resource of the first device, matching a resource template corresponding to the resource type in the specification standard; If the URL of the Redfish resource of the first device conforms to the URL specification in the resource template, then testing whether the resource attribute name and resource attribute value of the Redfish resource of the first device conform to the attribute specification in the resource template.
7. A Redfish interface testing device, characterized in that: The device comprises: a testing unit, configured to test the conformance of a Redfish interface of a first device, where the first device is a computing device obtained by adding hardware to the second device or replacing hardware of a different model; an output unit, configured to output information that the Redfish interface compatibility test of the first device has passed when the Redfish interface of the first device passes the compliance test and the Redfish resources of the first device include all first resources, wherein the first resources are the same Redfish resources as corresponding second resources in the second device, the first resources and the second resources have a one-to-one correspondence, and the second resources are Redfish resources in the second device that comply with the compliance standard; The output unit is further configured to output information indicating that the Redfish interface compatibility test of the first device has failed when the Redfish interface of the first device fails the normative test, or when the Redfish interface of the first device passes the normative test and at least one of the first resources is missing from the Redfish resources of the first device.
8. The device according to claim 7, characterized in that The device further comprises: an acquiring unit, configured to acquire second result data obtained by testing the compliance of the Redfish interface of the second device when the Redfish interface of the first device passes the compliance test; a comparing unit, configured to compare the second result data with the first result data obtained by testing the standardization of the Redfish interface of the first device; A determining unit is configured to determine, according to the comparison result, whether the Redfish resources of the first device include all the first resources.
9. A computing device, characterized in that The computing device comprises: Processor, memory; The memory stores instruction operations or codes; The processor is configured to communicate with the memory and execute instructions or codes in the memory to perform the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium comprises instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Redfish service compliance verification method and device, equipment and medium
CN111400167A
Redfish resource information calling method and device, equipment and storage medium
CN113448632A