xref: /openbmc/openbmc-test-automation/data/ipmi_raw_cmd_table.py (revision c1a7c8a0fca5e21b372d61d6dde5ef7f2dbd751f)
1#!/usr/bin/env python3
2
3r"""
4IPMI raw commands table:
5
6   - Define IPMI interface index, commands and expected output.
7
8"""
9
10from robot.libraries.BuiltIn import BuiltIn
11
12# The currently supported cipher list.
13# Refer:
14# openbmc/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipe
15# s-phosphor/ipmi/phosphor-ipmi-host/cipher_list.json
16valid_ciphers = ["17"]
17unsupported_ciphers = ["1", "2", "15", "16"]
18
19IPMI_RAW_CMD = {
20    # Interface name
21    "power_supply_redundancy": {
22        # Command action type
23        "Get": [
24            # raw command, expected output(s), comment
25            "0x04 0x2d 0x0b",
26            "00 00 01 00",
27            "Byte position 3rd LSB e.g. 01 indicates disabled",
28            "00 00 02 00",
29            "Byte position 3rd LSB e.g. 02 indicates enabled",
30            "00 40 02 00",
31            "40 is scanning enabled and 02 indicates redundancy enabled",
32        ],
33        "Enabled": [
34            # raw command, expected output, comment
35            "0x04 0x30 0x0b 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00",
36            "none",
37            "Enabled nibble position 6th LSB e.g. 0x2",
38        ],
39        "Disabled": [
40            # raw command, expected output, comment
41            "0x04 0x30 0x0b 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00",
42            "none",
43            "Enabled nibble position 6th LSB e.g. 0x1",
44        ],
45    },
46    "power_reading": {
47        "Get": [
48            # raw command, expected output(s), comment
49            "0x2c 0x02 0xdc 0x01 0x01 0x00",
50            "dc d5 00 d5 00 d5 00 d5 00 00 00 00 00 00 00 00 00 00",
51            "Byte position 2nd LSB e.g. d5 Instantaneous power readings",
52        ],
53    },
54    "conf_param": {
55        "Enabled": [
56            # raw command, expected output, comment
57            "0x2c 0x12 0xdc 0x02 0x00 0x01",
58            "dc",
59            "Enabled nibble position 6th LSB e.g. 0x01",
60        ],
61        "Disabled": [
62            # raw command, expected output, comment
63            "0x2c 0x12 0xdc 0x02 0x00 0x00",
64            "dc",
65            "Disable nibble position 6th LSB e.g. 0x00",
66        ],
67    },
68    "SEL_entry": {
69        "Reserve": [
70            # raw command, expected output, comment
71            "0x0a 0x42",
72            "27 00",
73            "27 is Reservation ID, LSB, 00 Reservation ID, MSB ",
74        ],
75        "Get_SEL_Time": [
76            # raw command
77            "0x0a 0x48",
78        ],
79        "Set_SEL_Time": [
80            # raw command, expected output(s)
81            "0x0a 0x49",
82            "rsp=0xd5",
83            "not supported in present state",
84            "rsp=0xc7",
85            "Request data length invalid",
86        ],
87        "Clear_SEL": [
88            # raw command, expected output(s)
89            "0x0a 0x47",
90            "0x43 0x4c 0x52 0xaa",
91            "sel clear",
92            "Clearing SEL",
93            "rsp=0xc5",
94            "Reservation cancelled or invalid",
95            "0x43 0x4c 0x52 0x00",
96        ],
97        "SEL_info": [
98            # raw command
99            "0x0a 0x40"
100        ],
101        "Create_SEL": [
102            # raw command, expected output, comment
103            "0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00",
104            "0x04",
105            "0x00 0xa0 0x04 0x07",
106        ],
107        "Get_SEL_Entry": [
108            # raw command
109            "0x0a 0x43 0x00 0x00",
110            "0x00 0xff",
111        ],
112    },
113    "Self_Test_Results": {
114        "Get": [
115            # raw command, expected output(s), comment
116            "0x06 0x04",
117            "56 00",
118            "56h = Self Test function not implemented in this controller.",
119        ]
120    },
121    "Device GUID": {
122        "Get": [
123            # raw command, expected output(s), comment
124            "0x06 0x08",
125            "01 70 9b ae da 6f dd 9c b4 4c 36 be 66 c8 49 28",
126            "Get GUID bytes 1 through 16.",
127        ]
128    },
129    "LAN_Config_Params": {
130        "Get": [
131            # raw command, expected output, comment
132            "0x0c 0x02",
133            "11 02",
134            (
135                "11 is Parameter revision, 02 is Configuration parameter data"
136                " e.g. Cipher Suite Entry count"
137            ),
138        ],
139        "Set": [
140            # raw command, expected output, error response
141            "0x0c 0x01",
142            "11 00",
143            "Unknown (0x82)",
144            "Invalid data field in request",
145        ],
146    },
147    "Payload": {
148        "Get_Payload_Activation_Status": [
149            # raw command, expected output(s), comment
150            "0x06 0x4a 0x01",
151            "01 00 00",
152            (
153                "1st byte is instance capacity, last two bytes is activation"
154                " status of instances"
155            ),
156        ],
157        "Activate_Payload": [
158            # raw command, expected output(s), comment
159            "0x06 0x48 0x01 0x01 0xc6 0x00 0x00 0x00",
160            "00 00 00 00 ff 00 ff 00 6f 02 ff ff",
161            (
162                "Last two bits are payload vlan number, - FFFFh if VLAN"
163                " addressing is not used"
164            ),
165        ],
166        "Deactivate_Payload": [
167            # raw command, expected output(s), comment
168            "0x06 0x49 0x01 0x01 0x00 0x00 0x00 0x00",
169            "",
170            "Line feed only",
171        ],
172        "Get_Payload_Instance_Info": [
173            # raw command, expected output(s), comment
174            "0x06 0x4b 0x01 0x01",
175            "00 00 00 00 00 00 00 00 00 00 00 00",
176            (
177                "When the payload is activated, the first four bytes are the"
178                " session ID,otherwise it should be 00."
179            ),
180        ],
181        "Get_User_Access_Payload": [
182            # raw command,
183            "0x06 0x4d"
184        ],
185        "Set_User_Access_Payload": [
186            # raw command,
187            "0x06 0x4c"
188        ],
189        "Get_Channel_Payload_Version": [
190            # raw command,
191            "0x06 0x4F"
192        ],
193        "Get_Channel_Payload_Support": [
194            # raw command,
195            "0x06 0x4E"
196        ],
197    },
198    "BIOS_POST_Code": {
199        "Get": [
200            # raw command, expected output, comment
201            "0x30 0xe9",
202            "",
203            "Response bytes will vary in length depending on state of system",
204            "0x89",
205            "error response byte when host is powered off",
206        ]
207    },
208    "Device ID": {
209        "Get": [
210            # raw command, error response, error code
211            "0x06 0x01",
212            "Error: Unable to establish IPMI v2 / RMCP+ session",
213            "0xc7",
214        ]
215    },
216    "Cold Reset": {
217        "reset": [
218            # raw command
219            "0x06 0x02"
220        ]
221    },
222    "lan_parameters": {
223        "get_ip": [
224            # raw command
225            "0x0c 0x02 0x"
226            + BuiltIn().get_variable_value("${CHANNEL_NUMBER}")
227            + " 0x03 0 0",
228        ],
229        "get_ip_src": [
230            # raw command
231            "0x0c 0x02 0x"
232            + BuiltIn().get_variable_value("${CHANNEL_NUMBER}")
233            + " 0x04 0 0",
234        ],
235        "get_dot1q": [
236            # raw command
237            "0x0c 0x02 0x"
238            + BuiltIn().get_variable_value("${CHANNEL_NUMBER}")
239            + " 0x14 0 0",
240        ],
241    },
242    "SDR_Info": {
243        "get": [
244            # raw command
245            "0x04 0x20 1"
246        ]
247    },
248    "Chassis_status": {
249        "get": [
250            # raw command
251            "0x00 0x01"
252        ],
253        "get_invalid_length": [
254            # raw command, invalid data length extra byte
255            "0x00 0x01 0x00"
256        ],
257    },
258    "SEL_Info": {
259        "get": [
260            # raw command
261            "0x0a 0x40"
262        ]
263    },
264    "Watchdog": {
265        # Command action type
266        "Get": [
267            # raw command, expected output(s), comment
268            "0x06 0x25",
269            "05 00 00 00 64 00",
270            "don't log bit enabled",
271            "85 00 00 00 64 00",
272            "don't log bit disabled",
273            "05 00 00 00 64 00",
274            "stop bit stop",
275            "45 00 00 00 64 00",
276            "stop bit resume",
277            "01 00 00 00 64 00",
278            "timer use FRB2",
279            "02 00 00 00 64 00",
280            "timer use POST",
281            "03 00 00 00 64 00",
282            "timer use OS",
283            "04 00 00 00 64 00",
284            "timer use SMS",
285            "05 00 00 00 64 00",
286            "timer use OEM",
287            "05 00 00 00 64 00",
288            "pre-timeout interrupt None",
289            "05 20 00 00 64 00",
290            "pre-timeout interrupt NMI",
291            "05 00 00 00 64 00",
292            "timeout action None",
293            "05 01 00 00 64 00",
294            "timeout action Reset",
295            "05 02 00 00 64 00",
296            "timeout action PowerDown",
297            "05 03 00 00 64 00",
298            "timeout action PowerCycle",
299            "01 00 00 02 00 00",
300            "timeout flag FRB2",
301            "02 00 00 04 00 00",
302            "timeout flag POST",
303            "03 00 00 08 00 00",
304            "timeout flag OS",
305            "04 00 00 10 00 00",
306            "timeout flag SMS",
307            "05 00 00 20 00 00",
308            "timeout flag OEM",
309            "05 00 00 00 30 35 30 35",
310            "Get should return 13.6 seconds",
311            "05 00 00 00 ff ff ff ff",
312            "Bit 6 not set when timer stopped",
313            "0x06 0x25 0x00",
314            "Get with one extra byte",
315        ],
316        "Set": [
317            # raw command, expected output, comment
318            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
319            "none",
320            "don't log bit enabled",
321            "0x06 0x24 0x85 0x00 0x00 0x00 0x64 0x00",
322            "none",
323            "don't log bit disabled",
324            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
325            "none",
326            "stop bit stop",
327            "0x06 0x24 0x45 0x00 0x00 0x00 0x64 0x00",
328            "none",
329            "stop bit resume",
330            "0x06 0x24 0x01 0x00 0x00 0x00 0x64 0x00",
331            "none",
332            "timer use FRB2",
333            "0x06 0x24 0x02 0x00 0x00 0x00 0x64 0x00",
334            "none",
335            "timer use POST",
336            "0x06 0x24 0x03 0x00 0x00 0x00 0x64 0x00",
337            "none",
338            "timer use OS",
339            "0x06 0x24 0x04 0x00 0x00 0x00 0x64 0x00",
340            "none",
341            "timer use SMS",
342            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
343            "none",
344            "timer use OEM",
345            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
346            "none",
347            "pre-timeout interrupt None",
348            "0x06 0x24 0x05 0x20 0x00 0x00 0x64 0x00",
349            "none",
350            "pre-timeout interrupt NMI",
351            "0x06 0x24 0x05 0x00 0x00 0x00 0x64 0x00",
352            "none",
353            "timeout action None",
354            "0x06 0x24 0x05 0x01 0x00 0x00 0x64 0x00",
355            "none",
356            "timeout action Reset",
357            "0x06 0x24 0x05 0x02 0x00 0x00 0x64 0x00",
358            "none",
359            "timeout action PowerDown",
360            "0x06 0x24 0x05 0x03 0x00 0x00 0x64 0x00",
361            "none",
362            "timeout action PowerCycle",
363            "0x06 0x24 0x01 0x00 0x00 0x3e 0x00 0x00",
364            "none",
365            "timeout flag FRB2",
366            "0x06 0x24 0x02 0x00 0x00 0x3e 0x00 0x00",
367            "none",
368            "timeout flag POST",
369            "0x06 0x24 0x03 0x00 0x00 0x3e 0x00 0x00",
370            "none",
371            "timeout flag OS",
372            "0x06 0x24 0x04 0x00 0x00 0x3e 0x00 0x00",
373            "none",
374            "timeout flag SMS",
375            "0x06 0x24 0x05 0x00 0x00 0x3e 0x00 0x00",
376            "none",
377            "timeout flag OEM",
378            "0x06 0x24 0x01 0x02 0x00 0x00 0x20 0x00",
379            "none",
380            "Power down",
381            "0x06 0x24 0x01 0x01 0x00 0x00 0x20 0x00",
382            "none",
383            "Hard reset",
384            "0x06 0x24 0x01 0x03 0x00 0x00 0x20 0x00",
385            "none",
386            "Power cycle",
387            "0x06 0x24 0x01 0x00 0x00 0x00 0x20 0x00",
388            "none",
389            "No action",
390            "0x06 0x24 0x05 0x00 0x00 0x3e 0x30 0x35",
391            "none",
392            "Set for 13.6 seconds",
393            "0x06 0x24 0x05 0x00 0x07 0x00 0x50 0x00",
394            "none",
395            "Pre-timeout interval passes",
396            "0x06 0x24 0x05 0x00 0x04 0x00 0x0A 0x00",
397            "none",
398            "Pre-timeout interval fails",
399            "0x06 0x24 0x05 0x00 0x00 0x20 0xFF 0xFF",
400            "none",
401            "Bit 6 not set when timer stopped",
402            "0x06 0x24 0x05 0x00 0x08 0x00 0x64",
403            "none",
404            "Set with one less byte",
405            "0x06 0x24 0x05 0x00 0x08 0x00 0x64 0x00 0x00",
406            "none",
407            "Set with one extra byte",
408        ],
409        "Reset": [
410            # raw command, expected output, comment
411            "0x06 0x22",
412            "none",
413            "Reset watchdog timer",
414            "0x06 0x22 0x00",
415            "none",
416            "Reset watchdog timer with extra byte",
417            "0x06 0x22",
418            "none",
419            "Reset watchdog timer without initialized watchdog",
420        ],
421    },
422    "SOL": {
423        "Set_SOL": [
424            # raw command, expected output(s), comment
425            "Invalid value",
426            "Valid values are serial, 9.6 19.2, 38.4, 57.6 and 115.2",
427        ]
428    },
429    "Get SDR": {
430        "Get": [
431            # Get SDR raw command without Reservation ID.
432            "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff",
433            # Netfunction and cmd.
434            "0x0a 0x23",
435            # Record ID offset and bytes to read.
436            "0x01 0x0f",
437            #  Raw command To Get SDR Partial without Reservation ID.
438            "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f",
439        ],
440    },
441    "Get": {
442        "POH_Counter": [
443            # raw command, error response
444            "0x00 0x0f",
445            "Error: Unable to establish IPMI v2 / RMCP+ session",
446        ]
447    },
448    "Device_SDR": {
449        "Get_Info": [
450            # raw command, expected output(s), comment
451            "0x04 0x20 0x00",
452            "0x04 0x20 0x01",
453            "rsp=0xc7",
454            "Request data length invalid",
455            "rsp=0xd4",
456            "Insufficient privilege level",
457        ],
458        "Get": [
459            # raw command, expected output(s), comment
460            "0x04 0x21",
461            "0x00 0x00 0x00 0xff",
462            "rsp=0xc7",
463            "Request data length invalid",
464        ],
465        "Reserve_Repository": [
466            # raw command, expected output(s), comment
467            "0x04 0x22",
468            "rsp=0xc7",
469            "Request data length invalid",
470            "rsp=0xd4",
471            "Insufficient privilege level",
472            "Reservation cancelled or invalid",
473        ],
474    },
475    "System_Info": {
476        "param0_Set_In_Progress": {
477            "Get": [
478                # raw command, expected output(s)
479                "0x06 0x59 0x00 0x00 0x00 0x00",
480                "Request data length invalid",
481            ],
482            "Set": [
483                # raw command, expected output(s)
484                "0x06 0x58 0x00",
485                "Request data length invalid",
486                "Invalid data field in request",
487            ],
488        },
489        "param1_System_Firmware_Version": {
490            "Get": [
491                # raw command, expected output(s)
492                "0x06 0x59 0x00 0x01 0x00 0x00",
493                "Request data length invalid",
494            ],
495            "Set": [
496                # raw command, expected output(s)
497                "0x06 0x58 0x01 0x00 0x00 0x0e",
498                "Invalid data field in request",
499            ],
500        },
501        "param2_System_Name": {
502            "Get": [
503                # raw command, expected output(s)
504                "0x06 0x59 0x00 0x02 0x00 0x00",
505                "Request data length invalid",
506            ],
507            "Set": [
508                # raw command, expected output(s)
509                "0x06 0x58 0x02 0x00 0x00 0x0e",
510                "Invalid data field in request",
511            ],
512        },
513        "param3_Primary_Operating_System_Name": {
514            "Get": [
515                # raw command, expected output(s)
516                "0x06 0x59 0x00 0x03 0x00 0x00",
517                "Request data length invalid",
518            ],
519            "Set": [
520                # raw command, expected output(s)
521                "0x06 0x58 0x03 0x00 0x00 0x0e",
522                "Invalid data field in request",
523            ],
524        },
525        "param4_Operating_System_Name": {
526            "Get": [
527                # raw command, expected output(s)
528                "0x06 0x59 0x00 0x04 0x00 0x00",
529                "Request data length invalid",
530            ],
531            "Set": [
532                # raw command, expected output(s)
533                "0x06 0x58 0x04 0x00 0x00 0x0e",
534                "Invalid data field in request",
535            ],
536        },
537        "param5_Present_OS_Version_number": {
538            "Get": [
539                # raw command, expected output(s)
540                "0x06 0x59 0x00 0x05 0x00 0x00",
541                "Request data length invalid",
542            ],
543            "Set": [
544                # raw command, expected output(s)
545                "0x06 0x58 0x05 0x00 0x00 0x0e",
546                "Invalid data field in request",
547            ],
548        },
549    },
550    "Get Channel Auth Cap": {
551        "get": [
552            # raw command
553            "0x06 0x38",
554        ]
555    },
556    "Cipher Suite": {
557        "get": [
558            # raw command, supported algorithm
559            "0x06 0x54",
560            "03 44 81",
561            # 03 - HMAC-SHA256
562            # 44 - sha256_128
563            # 81 - aes_cbc_128
564        ]
565    },
566    "SDR": {
567        "Get": [
568            # Get SDR raw command without Reservation ID.
569            "0x0a 0x23 0x00 0x00 0x00 0x00 0x00 0xff",
570            # Netfunction and command.
571            "0x0a 0x23",
572            # Record ID offset and bytes to read.
573            "0x00 0x00 0x01 0x0f",
574            #  Raw command To Get SDR Partial without reservation ID.
575            "0x0a 0x23 0x00 0x00 0x00 0x00 0x01 0x0f",
576        ],
577        "Reserve SDR Repository": [
578            # raw command, expected output(s), comment
579            "0x0a 0x22",
580        ],
581        "SDR Repository Info": [
582            # raw command.
583            "0x0a 0x20",
584        ],
585        "Get SDR allocation Info": [
586            # raw command.
587            "0x0a 0x21"
588        ],
589        "Delete SDR": [
590            # raw command.
591            "0x0a 0x26"
592        ],
593        "Partially Add SDR": [
594            # raw command.
595            "0x0a 0x25"
596        ],
597    },
598    "FRU": {
599        "Inventory_Area_Info": [
600            # raw command, expected output(s), comment
601            "0x0a 0x10",
602            "Invalid data field in request",
603            "Request data length invalid",
604        ],
605        "Read": [
606            # raw command
607            "0x0a 0x11",
608        ],
609        "Write": [
610            # raw command
611            "0x0a 0x12",
612        ],
613    },
614    "Chassis Capabilities": {
615        "Get": [
616            # raw command, invalid data length
617            "0x00 0x00",
618            "0x00 0x00 0x01",
619        ]
620    },
621    "Chassis Control": {
622        "power_down": [
623            # raw command
624            "0x00 0x02 0x00",
625            # invalid data length less byte
626            "0x00 0x02",
627            # invalid data length extra byte
628            "0x00 0x02 0x00 0x00",
629        ],
630        "power_up": [
631            # raw command
632            "0x00 0x02 0x01",
633            # invalid data length less byte
634            "0x00 0x02",
635            # invalid data length extra byte
636            "0x00 0x02 0x01 0x00",
637        ],
638        "power_cycle": [
639            # raw command
640            "0x00 0x02 0x02",
641            # invalid data length less byte
642            "0x00 0x02",
643            # invalid data length extra byte
644            "0x00 0x02 0x02 0x00",
645        ],
646        "hard_reset": [
647            # raw command
648            "0x00 0x02 0x03",
649            # invalid data length less byte
650            "0x00 0x02",
651            # invalid data length extra byte
652            "0x00 0x02 0x03 0x00",
653        ],
654        "pulse_diagnostic_interrupt": [
655            # raw command
656            "0x00 0x02 0x04",
657            # invalid data length less byte
658            "0x00 0x02",
659            # invalid data length extra byte
660            "0x00 0x02 0x04 0x00",
661        ],
662        "initiate_soft_shutdown": [
663            # raw command
664            "0x00 0x02 0x05",
665            # invalid data length less byte
666            "0x00 0x02",
667            # invalid data length extra byte
668            "0x00 0x02 0x05 0x00",
669        ],
670    },
671}
672