CN115904978A - Redfish interface testing method, computing device and storage medium - Google Patents

Redfish interface testing method, computing device and storage medium Download PDF

Info

Publication number
CN115904978A
CN115904978A CN202211491319.XA CN202211491319A CN115904978A CN 115904978 A CN115904978 A CN 115904978A CN 202211491319 A CN202211491319 A CN 202211491319A CN 115904978 A CN115904978 A CN 115904978A
Authority
CN
China
Prior art keywords
redfish
resource
equipment
interface
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211491319.XA
Other languages
Chinese (zh)
Inventor
计季佑
万侃然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202211491319.XA priority Critical patent/CN115904978A/en
Publication of CN115904978A publication Critical patent/CN115904978A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a Redfish interface testing method, a computing device and a storage medium, wherein the method comprises the following steps: testing the normalization of a Redfish interface of first equipment, wherein the first equipment is computing equipment obtained by adding hardware or replacing hardware of different types based on second equipment; if the Redfish interface of the first equipment passes the standardization test and the Redfish resources of the first equipment comprise all first resources, outputting the information that the compatibility test of the Redfish interface of the first equipment passes, wherein the first resources are the same resources as the corresponding compliance Redfish resources in the second equipment; and if the Redfish interface of the first equipment fails the normative test, or the Redfish interface of the first equipment passes the normative test and the Redfish resource of the first equipment lacks at least one first resource, outputting the information that the Redfish interface of the first equipment fails the compatibility test. The method and the device for testing the compatibility between the Redfish interface and the hardware in the server after the hardware is updated iteratively can be tested.

Description

Redfish interface testing method, computing device and storage medium
Technical Field
The application relates to the technical field of server testing, in particular to a Redfish interface testing method, computing equipment and a storage medium.
Background
Redfish is an open industry standard specification, providing simple, modern and secure management functions for extensible platform hardware. Based on the unified management interface specification of Redfish, a large amount of adaptation, development and test work brought by hardware management interfaces of different servers can be effectively reduced.
In order to ensure the stability and the availability of the Redfish interface, the Redfish interface of the server needs to be subjected to normative testing. The method for testing the Redfish interface in the current industry is that after test items and standard values of each test item are set in a server in advance, a Uniform Resource Identifier (URI) of each Redfish resource is obtained from a resource module of the server Redfish; then, sending a request to each resource according to the corresponding URI through a Redfish interface to test the corresponding test item to obtain a test value; and finally comparing the test value with the corresponding standard value, and if the test value is consistent with the corresponding standard value, determining that the Redfish interface of the server conforms to the standard of the specification.
However, in a hardware iteration scenario of the server, for a compatibility problem caused by interface change which is out of specification in a development process, original partial hardware resources of the server are invisible to a Redfish interface; the method cannot detect the hardware resource invisible to the Redfish interface and the corresponding compatibility problem.
Disclosure of Invention
The application provides a Redfish interface test method, a computing device and a storage medium, which are used for a server to iterate an updated Redfish interface test scene and can test the compatibility between the Redfish interface of the updated server and hardware.
In a first aspect, the present application provides a method for testing a Redfish interface, which is applied to a computing device, and includes:
testing the standardability of a Redfish interface of first equipment, wherein the first equipment is computing equipment obtained by adding hardware or replacing hardware of different types based on second equipment;
if the Redfish interface of the first equipment passes the normative test and the Redfish resources of the first equipment comprise all first resources, outputting the information that the compatibility test of the Redfish interface of the first equipment passes, wherein the first resources are Redfish resources which are the same as corresponding second resources in the second equipment, the first resources correspond to the second resources one to one, and the second resources are Redfish resources which meet the normative standard in the second equipment;
if the Redfish interface of the first device fails the normative test, or the Redfish interface of the first device passes the normative test and the Redfish resource of the first device lacks at least one first resource, outputting the information that the Redfish interface of the first device fails the compatibility test.
In the application, the normalization of the Redfish interface of the first equipment is tested, and the test result is compared with the second resource of the second equipment to test whether the hardware which can be managed by the Redfish function in the second equipment can be managed by the Redfish function in the first equipment or not, so that the compatibility between the Redfish interface of the first equipment and the hardware after the hardware is updated iteratively is tested.
In a possible implementation, before the outputting the information that the Redfish interface compatibility test of the first device passes or the outputting the information that the Redfish interface compatibility test of the first device fails, the method further includes: if the Redfish interface of the first equipment passes the normative test, second result data obtained by testing the normative of the Redfish interface of the second equipment are obtained; comparing the second result data and testing the normalization of the Redfish interface of the first equipment to obtain first result data; and determining whether the Redfish resources of the first equipment comprise all the first resources according to the comparison result.
According to the method and the device, whether the Redfish resource in compliance of the first equipment covers the Redfish resource in compliance of the second equipment is determined by comparing the first result data with the second result data, and the compatibility between the Redfish interface and the hardware in the first equipment, which is obtained by iterative updating of the hardware, can be simply, conveniently and visually judged.
In a possible implementation, the obtaining second result data obtained by testing the normalization of the Redfish interface of the second device includes: and testing the normalization of the Redfish interface of the second equipment to obtain the second result data.
In the application, the second result data is obtained by directly testing the normative mode of the Redfish interface of the second device, and the reliability of the data is higher.
In one possible implementation, before the testing the normalization of the Redfish interface of the first device, the method further includes: acquiring and analyzing a Redfish interface specification document to obtain the specification standard; the normalization of the Redfish interface of the first device testing comprises the following steps: and testing the normalization of the Redfish interface of the first equipment according to the standard.
In this application, the standard value of test is obtained through the mode of obtaining and analyzing standard document, can need not to predetermine the standard value in the computing equipment, practices thrift the manpower, improves efficiency of software testing.
In one possible implementation, the testing the normalization of the Redfish interface of the first device according to the specification standard includes: acquiring a Uniform Resource Locator (URL) and resource attributes of a Redfish resource of the first equipment; and testing whether the URL and the resource attribute of the Redfish resource of the first device meet the specification standard.
In the application, the testing standardization is performed in a mode of testing whether the URL and the resource attribute of the Redfish resource accord with the standard, so that the testing items are not required to be preset in the computing equipment, the manpower is saved, and the testing efficiency is improved.
In one possible implementation, the resource attribute includes a resource type, a resource attribute name, and a resource attribute value; the testing whether the URL and the resource attribute of the Redfish resource of the first device meet the specification standard includes: according to the resource type of the Redfish resource of the first equipment, matching a resource template corresponding to the resource type in the standard; if the URL of the Redfish resource of the first equipment conforms to the URL specification in the resource template, testing whether the resource attribute name and the resource attribute value of the Redfish resource of the first equipment conform to the attribute specification in the resource template.
In the application, whether the URL of the Redfish resource is in compliance is tested firstly, and whether the resource attribute is in compliance is tested again, so that the condition that the acquired content of the Redfish resource is not matched due to the URL non-compliance can be avoided, and the accuracy and the efficiency of the normative test can be improved.
In a second aspect, the present application provides a Redfish interface testing apparatus, including:
the testing unit is used for testing the normalization of a Redfish interface of first equipment, and the first equipment is computing equipment obtained by adding hardware or replacing hardware of different types based on second equipment;
the device comprises an output unit and a processing unit, wherein the output unit is used for outputting information that the Redfish interface compatibility test of the first device passes when the Redfish interface of the first device passes the normative test and the Redfish resource of the first device comprises all first resources, the first resources are Redfish resources which are the same as corresponding second resources in the second device, the first resources and the second resources are in one-to-one correspondence, and the second resources are Redfish resources which meet the normative standard in the second device;
the output unit is further configured to output information that the Redfish interface compatibility test of the first device fails 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 Redfish resources of the first device lacks the first resource.
In one possible implementation, the apparatus further comprises: the obtaining unit is used for obtaining second result data obtained by testing the normalization of the Redfish interface of the second equipment when the Redfish interface of the first equipment passes the normalization test; a comparison unit, configured to compare the second result data with first result data obtained by testing a normalization of a Redfish interface of the first device; and the determining unit is used for determining whether the Redfish resources of the first equipment comprise all the first resources according to the comparison result.
In a possible implementation, the obtaining unit is specifically configured to test the normalization of the Redfish interface of the second device, and obtain the second result data.
In a possible implementation, the obtaining unit is further configured to obtain and analyze a Redfish interface specification document to obtain the specification standard; the test unit is specifically configured to test the normalization of the Redfish interface of the first device according to the specification standard.
In one possible implementation, the test unit is specifically configured to: acquiring a Uniform Resource Locator (URL) and resource attributes of a Redfish resource of the first equipment; and testing whether the URL and the resource attribute of the Redfish resource of the first device meet the specification standard.
In one possible implementation, the resource attributes include a resource type, a resource attribute name, and a resource attribute value; the test unit is specifically configured to: according to the resource type of the Redfish resource of the first equipment, matching a resource template corresponding to the resource type in the standard; if the URL of the Redfish resource of the first equipment conforms to the URL specification in the resource template, testing whether the resource attribute name and the resource attribute value of the Redfish resource of the first equipment conform to the attribute specification in the resource template.
In a third aspect, the present application provides a computing device comprising:
a processor, a memory;
the memory has stored therein instruction operations or code;
the processor is configured to communicate with the memory and execute the instruction operations or code in the memory to perform any of the methods provided by the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method as any one of the methods provided in the first aspect.
It should be understood that the implementations and advantages of the various aspects described above may be referenced to one another.
Drawings
Fig. 1 is a system architecture diagram of a Redfish interface test provided in an embodiment of the present application;
fig. 2 is a data flow diagram of another Redfish interface test provided in the embodiment of the present application;
fig. 3 is a schematic flowchart of a method for testing a Redfish interface according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a process for obtaining resource content of a Redfish resource according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a Redfish interface specification document according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a normative test of a Redfish interface according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a Redfish interface testing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a computing device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will now be described with reference to the accompanying drawings, and it is to be understood that the described embodiments are merely illustrative of some, but not all, embodiments of the present application. As can be known to those skilled in the art, with the development of technology and the emergence of new scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
The terms "first," "second," and the like in the description and claims of this application and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the prior art, when a function test or a standard test is performed on a Redfish interface of a computing device, a standard value is preset in the computing device, then a Redfish resource is accessed through the Redfish interface to obtain a test value, and finally whether the test value is the same as the standard value is detected to determine whether the function of the Redfish interface of the computing device is normal or whether the Redfish resource is compliant.
However, after the hardware of the computing device is updated iteratively, if the Redfish interface is incompatible with the updated hardware of the computing device, the attribute name, the attribute value, the value length, or the data type of the Redfish resource corresponding to the original hardware will be changed, so that the Redfish resource is invisible to the Redfish interface, and the Redfish interface cannot manage the Redfish resource. Therefore, the compatibility problem of the Redfish interface and the computing equipment is difficult to test by the conventional test method.
It should be noted that, the "Redfish resource" mentioned in the document of the present application refers to a hardware resource managed by a Redfish function under a Redfish root directory; the collection of all resources in the Redfish root directory may also be referred to as the root resource. Wherein, the Redfish resource is an open data (Odata) protocol file.
It is understood that the Redfish root directory also has an aggregate resource composed of a plurality of Odata protocol files, which is similar to a "folder" rather than the Redfish resource corresponding to a hardware resource.
It should be noted that, the "compliant" Redfish resource mentioned in the document of the present application refers to a Redfish resource that complies with the Redfish specification standard.
The application scheme is applied to a Redfish interface test scene of the computing equipment after hardware iteration updating, is used for testing the compatibility between the Redfish interface and the hardware of the updated computing equipment, and is particularly used for testing hardware resources managed by a Redfish function in the computing equipment before updating and judging whether the hardware resources can be managed under the Redfish function of the updated computing equipment.
It should be noted that, in this document, for the sake of brevity and clarity of description, for a computing device before and after a hardware iteration update, the updated computing device may be referred to as a descendant device of the computing device before the update, and the computing device before the update may be referred to as a predecessor device of a corresponding descendant device. For example, a server of the same series of adjacent models manufactured by the same manufacturer, and for example, two computing devices respectively connected to pluggable devices of the same type of adjacent models.
It can be understood that the corresponding previous generation device and the subsequent generation device may have an inheritance relationship, that is, the subsequent generation device is a computing device obtained by adding hardware to the corresponding previous generation device or replacing hardware of different models, and Redfish resources of the two devices are not completely the same.
It can be understood that the former generation device and the later generation device may be the same computing device before and after the hardware iteration update, or may be two computing devices corresponding to two hardware compositions and layouts before and after the hardware iteration update.
It can be understood that the scheme of the present application may also be applied to a scenario of testing compatibility of pluggable hardware of different models or different versions and a Redfish interface of the same computing device.
Referring to fig. 1, fig. 1 is a system architecture diagram of Redfish interface testing according to an embodiment of the present disclosure, where the system architecture includes a device under test 10 and a reference device 20.
It can be understood that, for the functional test or the standard test, the test is only performed after the standard value is preset on the device to be tested 10; for the compatibility test, the device under test 10 and the reference device 20 providing the device data of the previous generation of the device under test 10 are required to perform the comparison test.
The device under test 10 and the reference device 20 may be servers, storage controllers, switches, routers, base station controllers, computation offload cards, computation accelerator cards, computers, notebook computers, and other computing devices, and the embodiment of the present application does not limit the specific forms of the device under test 10 and the reference device 20 shown in fig. 1.
The device under test 10 is connected to the reference device 20, and data transmission can be performed between the two devices.
Alternatively, reference device 20 may be a predecessor of device under test 10.
In this case, the device under test 10 and the reference device 20 may respectively perform a normative test on their Redfish interfaces; the device under test 10 obtains the second result data of the normative test stored in the reference device 20 again, and compares the second result data with the first result data of the own normative test; if the Redfish resource compliant in the device to be tested 10 includes all the first resources that are the same as the Redfish resource compliant in the reference device 20, the device to be tested 10 may output a result that the compatibility test of the Redfish interface passes; if the compliant Redfish resource in the device under test 10 lacks at least one of the first resources, the device under test 10 may output a result that the compatibility test of the Redfish interface fails.
Optionally, the reference device 20 may be a cloud device, and the reference device 20 is configured to store second result data of the Redfish interface normative test of the previous generation device of the device under test 10.
In this case, the device under test 10 may perform a normalization test of the Redfish interface on itself, acquire the second result data of the previous generation device from the reference device 20, and finally perform a compatibility test of the Redfish interface according to the second result data and the first result data of the normalization test.
Referring to fig. 2, fig. 2 is a data flow diagram of a Redfish interface test according to an embodiment of the present disclosure. The data flow in the system architecture of the Redfish interface test provided by the present application will be described with reference to fig. 1 and fig. 2.
As shown in fig. 2, data of the Redfish interface test needs to pass through the first device 30 and the second device 40, the test unit 50, the comparison unit 60, and the output unit 70 from generation to output.
Wherein the first device 30 and the second device 40 are corresponding predecessor and descendant devices. In this embodiment, the first device is a descendant device, and the second device is a predecessor device, which should be understood as an example and not a limitation.
The test unit 50 may be configured to obtain a specification document of the Redfish interface from the cloud server or the internet 80; then, acquiring a Uniform Resource Locator (URL) of the Redfish resource in the first device 30 and the second device 40; and finally, performing a normative test of the Redfish interface on the first device 30 and the second device 40 according to the URL and the specification document. The specific implementation of this test can be found in the methods section below.
After the test is completed, the test unit 50 may be further configured to send the normative test result data of the Redfish interfaces of the first device 30 and the second device 40 to the comparison unit 60.
The comparing unit 60 is configured to compare the test conditions of each Redfish resource in the normalization test result data of the two devices one by one when the normalization test of the Redfish interface of the first device 30 passes. Specifically, the comparing unit 60 may first obtain a Redfish resource that is in compliance in the second device 40, then traverse the first result data of the first device 30, find the same Redfish resource, and determine whether the Redfish resource is in compliance; if the result is compliant, the compatibility test of the Redfish interface of the first device 30 for the hardware resource corresponding to the Redfish resource passes.
After the comparison is completed, the comparing 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 that the Redfish interface compatibility test of the first device 30 passes when the Redfish resource of the first device 30 includes all first resources that are the same as the compliant Redfish resource of the second device 40.
Conversely, the output unit 70 is further configured to output information that the Redfish interface compatibility test of the first device 30 fails when the normative test of the first device 30 does not pass the first resource that is the same as the at least one compliant Redfish resource of the second device 40.
The comparing unit 60 is further configured to, in a case that the normative test of the Redfish interface of the first device 30 fails, send the relevant information to the output unit 70, so that the output unit 70 outputs information that the Redfish interface compatibility test of the first device 30 fails.
It should be noted that in a specific implementation, the testing unit 50, the comparing unit 60, and the output unit 70 may be disposed in one or more other computing devices, and may also be disposed in the first device 30. Therefore, the constituent structure shown in fig. 2 does not constitute a limitation of the connection relationship or positional relationship between the three units of the test unit 50, the comparison unit 60, and the output unit 70 and the first device 30.
Based on the system architecture and the data flow direction shown in fig. 1 and fig. 2, please refer to fig. 3, an embodiment of the present application further provides a Redfish interface testing method, which is applied to a computing device and specifically includes steps 301 and 303.
301. The computing device tests the normalization of the Redfish interface of the first device.
The first device is a computing device obtained by adding hardware or replacing hardware of different models based on the second device, that is, the first device is a descendant of the second device.
Optionally, the computing device executing the method of this embodiment is a first device.
Specifically, the computing device tests the normalization of the Redfish interface of the first device, which is substantially to test the normalization of all Redfish resources of the first device, and therefore, it is required to first obtain the resource content of all Redfish resources of the first device.
Referring to fig. 4, fig. 4 is a schematic flowchart of a process for acquiring resource content of a Redfish resource of a first device, which is applied to a computing device according to an embodiment of the present application, and specifically includes steps 401 to 405.
401. And acquiring subordinate resources of the Redfish root resources of the first equipment.
Wherein, the path of the Redfish root resource is as follows: and/redfish/v 1.
Wherein, the computing device can obtain the subordinate resource of the Redfish root resource through an automatic code tool or a software program.
402. And judging whether the subordinate resource is an aggregate resource or an Odata protocol file.
After obtaining a subordinate resource, the computing device may make a determination, and if the subordinate resource is a collective resource, perform step 404; if the subordinate resource is the Odata protocol file, go to step 403.
The types of the subordinate resources comprise an Odata protocol file and a dictionary or list resource.
The dictionary or the manifest resource may be referred to as a collective resource, and the subordinate resources included in the dictionary or the manifest resource may be the oda protocol file or the collective resource, for example, the subordinate resource of the dictionary resource is the manifest resource, or the subordinate resource of the manifest resource is the dictionary resource.
403. And saving the resource content of the Odata protocol file.
If the subordinate resource is an Odata protocol file, the Odata protocol file is a Redfish resource which needs to be acquired. The resource content of the Odata file comprises Uniform Resource Identifiers (URIs) for identifying the Redfish resource and resource attributes for describing the Redfish resource.
The computing device can store the resource content of the Odata protocol file into a preset resource content archive, and can also create an archive for storing the resource content.
The attribute of identifying URIs is agreed to be 'odata.id' by using an Odata protocol through the Redfish interface, and the computing equipment can master the identifiers of the URIs of all Redfish resources of the first equipment by acquiring all 'odata.id' attributes and attribute values under a Redfish root directory of the first equipment. Further, the computing device may obtain URIs and attribute data of all Redfish resources of the first device according to the identifier request of each Redfish resource and the resource content stored therein.
It can be understood that, when a hardware resource is invisible to the Redfish interface, the computing device may fail to obtain a value of the Redfish resource corresponding to the hardware resource, and at this time, the computing device may assign "null" to the Redfish resource or may not display the value. In the subsequent normative test, the Redfish resource is considered to be not in accordance with the specification and cannot pass the normative test.
After saving the resource content of the Odata protocol file, the computing device may perform step 405.
404. And acquiring subordinate resources of the set resources.
If the subordinate resource is the collective resource, the subordinate resource of the collective resource needs to be further captured. After the subordinate resource is obtained, step 402 is executed again.
405. And judging whether the resource content of the Redfish resource of the first equipment is stored completely.
The computing equipment can acquire and store the Redfish resource of the first equipment by adopting a recursive traversal method; if the oda file stored in step 403 is the last subordinate resource of the traversal, the computing device may determine that the resource content of the Redfish resource of the first device is completely stored, 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.
In the embodiment of the application, the resource content of the Redfish resource of the first equipment can be efficiently and accurately acquired by a recursive traversal method.
After the resource content of the Redfish resource of the first device is obtained, a standard value corresponding to the test can be obtained, and then the standardized value is subjected to a normative test on the Redfish interface of the first device.
In one possible implementation, the test item is pre-set in the computing device, along with a standard value corresponding to the test item.
In another possible implementation, the computing device may obtain and parse a specification document of the Redfish interface to obtain a specification standard.
It is understood that the specification standard includes standard values for all test items.
The computing device may obtain the latest specification document from the Redfish official website in real time through the internet, or may obtain the specification document from a memory or other connected devices.
Wherein the computing device may parse the specification document using a Python programming language-based document parsing tool.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a Redfish interface specification document in an embodiment of the present application, where the structure includes specific contents under a resource template under a Redfish interface.
As shown in fig. 5, section 6.13 of the specification document is a resource template corresponding to Redfish resource with a resource type of Basic Input Output System (BIOS) and specification content thereof, wherein the specification template specifically includes specification content related to URIs of BIOS in section 6.13.2 and specification content related to resource attribute of BIOS in section 6.13.3.
The Redfish interface uses an Odata protocol to stipulate that the attribute for identifying the resource type is ' Odata ' type ', and simultaneously, for each resource type, the attribute belonging to the resource type is defined in a resource template, specifically comprising an attribute name and an attribute type, and a few attributes also stipulate a value range.
In the specification document, the Redfish resource of the corresponding resource type is specified through a resource template, and specifically, the Redfish resource is restricted through the content in the URIs list and the resource attribute list of the Redfish resource in the specification document.
Where the URL is a portion of the content of the URIs. As shown in FIG. 5, the URL of the Redfish resource with the resource type of BIOS should conform to the specification: perdfish/v 1/Systems/{ computersystemId }/BIOS.
As shown in FIG. 5, the resource attributes include a resource type, and an attribute registration string attribute.
The standard values of all the test items corresponding to each kind of Redfish resource can be obtained by obtaining and analyzing the standard document, so that the corresponding test items and standard values do not need to be set for different Redfish resources in the computing equipment, and the test efficiency can be improved.
After obtaining the standard value, the computing device may perform a normative test on the Redfish interface of the first device according to the specification document.
In one possible implementation, the computing device may obtain a corresponding URL from resource content of a Redfish resource of the first device; sending a test request of a corresponding preset test item to a Redfish interface of the first equipment according to the URL, and acquiring a test value responded by the Redfish interface; comparing the test value with a standard value corresponding to the preset test item in the specification document, and if the test values of all Redfish resources are consistent with the corresponding standard values, passing the normative test of the Redfish interface of the first equipment; 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.
The Redfish resources of different resource types can correspond to different preset test items.
In another possible implementation, the computing device may obtain a URL and resource attributes of a Redfish resource of the first device; and testing whether URIs and resource attributes of the Redfish resource of the first device meet the specification standard in the specification document.
Specifically, referring to fig. 6, fig. 6 is a schematic flowchart of a normative test of a Redfish interface provided in the embodiment of the present application, which is applied to a computing device, as shown in fig. 6, the flowchart specifically includes steps 601 to 604.
601. And acquiring the URL and the resource attribute of the Redfish resource of the first equipment.
The resource attribute comprises a resource type, a resource attribute name and a resource attribute value.
The computing device may obtain the corresponding URL and the resource attribute from the obtained resource content of the Redfish resource of the first device.
602. And matching a resource template corresponding to the resource type of the Redfish resource in the specification document.
The computing device can perform the normative test on the Redfish resource of the first device one by one, and also can perform the normative test on a plurality of Redfish resources at the same time in a multi-thread mode.
The computing device may first obtain the resource template of the Redfish resource, and then traverse the resource template in the secondary header of the specification document to obtain the corresponding specification standard.
603. And judging whether the URL of the Redfish resource conforms to the URL specification in the resource template.
The computing device may match the URL of the Redfish with the URL format in the URL specification, and if the matching is successful, execute step 604; and if not, determining that the normative test of the Redfish interface of the first device fails.
604. And judging whether the resource attribute of the Redfish resource conforms to the attribute specification in the resource template.
The computing equipment can 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 the matching is successful, the Redfish resource conforms to the attribute specification; if at least one item does not match, the Redfish resource does not meet the attribute specification.
And if the resource attributes of all Redfish resources of the first equipment conform to the attribute specification, determining that the normative test of the Redfish interface of the first equipment passes.
And if the resource attribute of at least one Redfish resource of the first equipment does not conform to the attribute specification, determining that the normative test of the Redfish interface of the first equipment fails.
The normalization of the Redfish interface is tested by detecting whether the URL and the resource attribute of the Redfish resource of the first equipment meet the standard or not, so that a test item does not need to be preset, and the test efficiency can be improved.
302. And if the Redfish interface of the first equipment passes the standardization test and the Redfish resources of the first equipment comprise all the first resources, the computing equipment outputs the information that the compatibility test of the Redfish interface of the first equipment passes.
The Redfish interface of the first device is subjected to a normative test, and all Redfish resources of the first device are shown to be in accordance with a standard.
The first resource is a Redfish resource which is the same as a corresponding second resource in the second equipment, the second resource is a compliant Redfish resource in the second equipment, and the first resource and the second resource are in one-to-one correspondence.
It should be noted that, the first resource and the second resource are the same, which means that the resource types and the resource attributes of the first resource and the second resource are the same, and the specific values of the resource attributes may change due to the overall change of hardware or the change of the interface implementation.
For example, the number of compliant second resources in the second device is 26, which are Redfish resources a to Z, respectively; the first resource at this time is the Redfish resources A to Z; the computing device may then determine whether Redfish resources a through Z are included in the Redfish resources of the first device to determine whether to perform step 302 or step 303.
When the computing device outputs the information that the Redfish interface compatibility test of the first device passes, the computing device can also output the information that the Redfish interface normative test of the first device passes.
It is understood that, if the second resource is to be determined, second result data obtained by testing the normalization of the Redfish interface of the second device needs to be obtained.
In one possible implementation, the computing device may perform a normative test on the Redfish interface of the second device to obtain second result data to determine a second resource in the second device.
The method for performing the normative test on the Redfish interface of the second device is similar to the method for performing the normative test on the Redfish interface of the first device by the computing device in step 301, and reference may be specifically made to relevant parts in step 301, which are not described herein again.
In another possible implementation, the computing device may obtain the second result data from the second device or other devices storing the second result data of the Redfish interface of the second device and determine the second resource in the second device.
In a possible implementation, after obtaining the second result data and the first result data of the normalization test of the Redfish interface of the first device, the computing device may compare the first result data and the second result data, and finally determine whether the Redfish resource of the first device includes all the first resources according to the comparison result, when the normalization test of the Redfish interface of the first device passes.
The computing device can compare the test conditions 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, find the same Redfish resource, and determine whether the resource is compliant; and if the Redfish interface is in compliance, the compatibility test of the Redfish interface of the first equipment on the hardware resource corresponding to the Redfish resource passes.
When the Redfish resource of the first device comprises all the first resources, the Redfish resource represents that the hardware resources corresponding to the first resource and the second resource can be brought into and managed by a Redfish interface in the first device or the second device, and can play the same function; it can thus be determined that the compatibility between the hardware of the first device and the Redfish interface is normal.
303. And if the Redfish interface of the first equipment fails the normative test, or the Redfish interface of the first equipment passes the normative test and the Redfish resource of the first equipment lacks at least one first resource, outputting the information that the Redfish interface compatibility test of the first equipment fails.
The compatibility test of the Redfish interface of the first device needs to be established on the basis that the normative test of the Redfish interface passes.
When the Redfish resource of the first equipment lacks at least one first resource, the Redfish resource represents a hardware resource which can be normally managed by the Redfish function in the second equipment, and the Redfish function is invisible in the first equipment, namely cannot be normally managed by the Redfish function; at this time, the hardware resource cannot normally function, and the compatibility problem occurs between the hardware of the first device and the Redfish interface.
If the Redfish interface of the first device fails the normalization test, the computing device may output information that neither the normalization test nor the compatibility test of the Redfish interface of the first device passes.
It is understood that the information of passing or not passing compatibility output by the computing device may be information that can be sensed by a tester, and may specifically be text, audio or video.
It can be understood that, when the hardware is iteratively updated to obtain the first device, the compliant Redfish resource in the first device may not have a corresponding data source in the second device due to reasons such as adding new hardware or changing an interface implementation, and the normative test of the corresponding Redfish resource in the Redfish interface normative test of the second device fails; this situation is not due to compatibility issues between the Redfish interface and the hardware, and therefore does not affect the results of the compatibility test.
In the embodiment of the application, the normalization of the Redfish interface of the first device is tested by testing the normalization of the Redfish interface of the first device and detecting whether the Redfish resource in compliance with the first device contains the first resource which is the same as the second resource of the second device, so that the compatibility between the Redfish interface of the server and a hardware component after the hardware iteration is updated can be tested.
The foregoing describes a method for testing a Redfish interface provided in this embodiment, and a device for testing a Redfish interface provided in this embodiment will be described below.
Referring to fig. 7, an embodiment of the present invention further provides a Redfish interface testing apparatus 700, including:
the testing unit 701 is used for testing the normalization of a Redfish interface of first equipment, wherein the first equipment is computing equipment obtained by adding hardware or replacing hardware of different types based on second equipment;
an output unit 702, configured to output, when the Redfish interface of the first device passes the normative test and the Redfish resource of the first device includes all first resources, information that the Redfish interface of the first device passes the compatibility test, where the first resource is a Redfish resource that is the same as a corresponding second resource in the second device, the first resource and the second resource are in one-to-one correspondence, and the second resource is a Redfish resource that meets a standard in the second device;
the output unit 702 is further configured to output information that the Redfish interface compatibility test of the first device fails 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 Redfish resources of the first device lacks the first resource.
In one possible implementation, the Redfish interface testing apparatus 700 further includes: an obtaining unit 703, configured to obtain second result data obtained by testing the normalization of the Redfish interface of the second device when the Redfish interface of the first device passes the normalization test; a comparing unit 704, configured to compare the second result data with a first result data obtained by testing a normalization of a Redfish interface of the first device; the determining unit 705 is configured to determine whether the Redfish resource of the first device includes all the first resources according to the comparison result.
In a possible implementation, the obtaining unit 703 is specifically configured to test the normalization of the Redfish interface of the second device, so as to obtain the second result data.
In a possible implementation, the obtaining unit 703 is further configured to obtain and analyze a Redfish interface specification document to obtain the specification standard; the testing unit 701 is specifically configured to test the normalization of the Redfish interface of the first device according to the specification standard.
In one possible implementation, the test unit 701 is specifically configured to: acquiring a Uniform Resource Locator (URL) and resource attributes of Redfish resources of the first equipment; and testing whether the URL and the resource attribute of the Redfish resource of the first device meet the specification standard.
In one possible implementation, the resource attributes include a resource type, a resource attribute name, and a resource attribute value; the test unit 701 is specifically configured to: according to the resource type of the Redfish resource of the first equipment, matching a resource template corresponding to the resource type in the standard; if the URL of the Redfish resource of the first equipment conforms to the URL specification in the resource template, testing whether the resource attribute name and the resource attribute value of the Redfish resource of the first equipment conform to the attribute specification in the resource template.
Referring to fig. 8, an embodiment of the present application further provides a computing device 800, where the computing device 800 includes a processor 801 and a memory 803.
Wherein 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 code in the memory 803 to perform the Redfish interface test method as provided in fig. 3.
Optionally, the processor 801 and the memory 803 are connected by a bus 802.
Another embodiment of the present application further provides a computer-readable storage medium, which includes instructions that, when executed on a computer, cause the computer to perform the Redfish interface test method as provided in fig. 3.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solutions of the embodiments of the present application, which essentially or partly contribute to the prior art, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.

Claims (10)

1. A method for testing a Redfish interface is characterized by comprising the following steps:
testing the standardability of a Redfish interface of first equipment, wherein the first equipment is computing equipment obtained by adding hardware or replacing hardware of different types based on second equipment;
if the Redfish interface of the first equipment passes the normative test and the Redfish resources of the first equipment comprise all first resources, outputting the information that the compatibility test of the Redfish interface of the first equipment passes, wherein the first resources are Redfish resources which are the same as corresponding second resources in the second equipment, the first resources correspond to the second resources one to one, and the second resources are Redfish resources which meet the normative standard in the second equipment;
and if the Redfish interface of the first equipment fails the normative test, or the Redfish interface of the first equipment passes the normative test and at least one first resource is lost in the Redfish resource of the first equipment, outputting the information that the Redfish interface compatibility test of the first equipment fails.
2. The method according to claim 1, wherein before the outputting the information that the Redfish interface compatibility test of the first device passes or the outputting the information that the Redfish interface compatibility test of the first device fails, the method further comprises:
if the Redfish interface of the first equipment passes the normative test, second result data obtained by testing the normative of the Redfish interface of the second equipment are obtained;
comparing the second result data and testing the normalization of the Redfish interface of the first equipment to obtain first result data;
and determining whether the Redfish resources of the first equipment comprise all the first resources according to the comparison result.
3. The method according to claim 2, wherein the obtaining second result data obtained by testing the normativity of the Redfish interface of the second device comprises:
and testing the normalization of the Redfish interface of the second equipment to obtain the second result data.
4. The method according to any one of claims 1 to 3, wherein prior to said testing the normalization of the Redfish interface of the first device, the method further comprises:
acquiring and analyzing a Redfish interface specification document to obtain the specification standard;
the testing the normalization of the Redfish interface of the first device comprises the following steps:
and testing the normalization of the Redfish interface of the first equipment according to the standard.
5. The method according to claim 4, wherein the testing the normalization of the Redfish interface of the first device according to the specification standard comprises:
acquiring a Uniform Resource Locator (URL) and resource attributes of Redfish resources of the first equipment;
and testing whether the URL and the resource attribute of the Redfish resource of the first equipment meet the standard of the specification.
6. The method of claim 5, wherein the resource attributes include a resource type, a resource attribute name, and a resource attribute value; the testing whether the URL and the resource attribute of the Redfish resource of the first device meet the standard of the specification or not comprises the following steps:
according to the resource type of the Redfish resource of the first equipment, matching a resource template corresponding to the resource type in the standard;
if the URL of the Redfish resource of the first equipment conforms to the URL specification in the resource template, testing whether the resource attribute name and the resource attribute value of the Redfish resource of the first equipment conform to the attribute specification in the resource template.
7. A Redfish interface testing device, the device comprising:
the testing unit is used for testing the normalization of a Redfish interface of first equipment, and the first equipment is computing equipment obtained by adding hardware or replacing hardware of different types based on second equipment;
an output unit, configured to output information that a compatibility test of a Redfish interface of the first device passes when the Redfish interface of the first device passes a normative test and the Redfish resource of the first device includes all first resources, where the first resources are Redfish resources that are the same as corresponding second resources in the second device, the first resources and the second resources are in one-to-one correspondence, and the second resources are Redfish resources that meet a normative standard in the second device;
the output unit is further configured to output information that the Redfish interface compatibility test of the first device fails 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 Redfish resources of the first device lacks the first resource.
8. The apparatus of claim 7, further comprising:
the obtaining unit is used for obtaining second result data obtained by testing the normalization of the Redfish interface of the second equipment when the Redfish interface of the first equipment passes the normalization test;
a comparison unit, configured to compare the second result data with first result data obtained by testing a normalization of a Redfish interface of the first device;
and the determining unit is used for determining whether the Redfish resources of the first equipment comprise all the first resources according to the comparison result.
9. A computing device, wherein the computing device comprises:
a processor, a memory;
the memory having stored therein instruction operations or code;
the processor is configured to communicate with the memory and execute the instruction operations or code in the memory to perform the method of any of claims 1 to 6.
10. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method of any of claims 1 to 6.
CN202211491319.XA 2022-11-25 2022-11-25 Redfish interface testing method, computing device and storage medium Pending CN115904978A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211491319.XA CN115904978A (en) 2022-11-25 2022-11-25 Redfish interface testing method, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211491319.XA CN115904978A (en) 2022-11-25 2022-11-25 Redfish interface testing method, computing device and storage medium

Publications (1)

Publication Number Publication Date
CN115904978A true CN115904978A (en) 2023-04-04

Family

ID=86487562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211491319.XA Pending CN115904978A (en) 2022-11-25 2022-11-25 Redfish interface testing method, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN115904978A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116233103A (en) * 2023-05-09 2023-06-06 苏州浪潮智能科技有限公司 Interface adaptation method, device, communication equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116233103A (en) * 2023-05-09 2023-06-06 苏州浪潮智能科技有限公司 Interface adaptation method, device, communication equipment and storage medium
CN116233103B (en) * 2023-05-09 2023-08-15 苏州浪潮智能科技有限公司 Interface adaptation method, device, communication equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN109582588B (en) Test case generation method and device and electronic equipment
CN109802953B (en) Industrial control asset identification method and device
US20100125595A1 (en) Configuration Management Server, Name Recognition Method and Name Recognition Program
CN112241311A (en) Firmware simulation method and device, electronic equipment and readable storage medium
CN115904978A (en) Redfish interface testing method, computing device and storage medium
CN114124694A (en) Configuration method and configuration device of Internet of things equipment, electronic equipment and medium
CN112306495A (en) Picture verification method and device, computer equipment and computer-readable storage medium
CN110018835B (en) YANG model configuration data processing method and device, terminal device and storage medium
CN111538542B (en) System configuration method and related device
CN112274913B (en) Method and device for merging game servers, storage medium and electronic device
CN111752820A (en) Pressure testing method of gPC interface, computer equipment and storage medium
CN117370203A (en) Automatic test method, system, electronic equipment and storage medium
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN117240943A (en) Interface data analysis method and device
CN112306041A (en) Vehicle configuration information writing method and device and electronic equipment
KR101625890B1 (en) Test automation system and test automation method for detecting change for signature of internet application traffic protocol
CN113052501A (en) Automatic safe operation and maintenance method and terminal based on assets
CN110580243A (en) file comparison method and device, electronic equipment and storage medium
CN114205276B (en) Performance test method and device for product management system and electronic equipment
CN111985513A (en) Rapid identification network asset attribution system and identification analysis method thereof
CN115543227B (en) Cross-system data migration method, system, electronic device and storage medium
CN117215965B (en) Test case identification-based test method and device, electronic equipment and medium
US11768985B1 (en) Automated platform design tool
CN111324757B (en) Map data problem processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination