1*** Settings *** 2 3Documentation Module to test IPMI asset tag functionality. 4Resource ../lib/ipmi_client.robot 5Resource ../lib/openbmc_ffdc.robot 6Variables ../data/ipmi_raw_cmd_table.py 7Variables ../data/ipmi_variable.py 8Library ../lib/bmc_network_utils.py 9Library ../lib/ipmi_utils.py 10 11Test Teardown FFDC On Test Case Fail 12 13*** Test Cases *** 14 15Verify Get DCMI Capabilities 16 [Documentation] Verify get DCMI capabilities command output. 17 [Tags] Verify_Get_DCMI_Capabilities 18 ${cmd_output}= Run IPMI Standard Command dcmi discover 19 20 @{supported_capabilities}= Create List 21 # Supported DCMI capabilities: 22 ... Mandatory platform capabilties 23 ... Optional platform capabilties 24 ... Power management available 25 ... Managebility access capabilties 26 ... In-band KCS channel available 27 # Mandatory platform attributes: 28 ... 200 SEL entries 29 ... SEL automatic rollover is enabled 30 # Optional Platform Attributes: 31 ... Slave address of device: 0h (8bits)(Satellite/External controller) 32 ... Channel number is 0h (Primary BMC) 33 ... Device revision is 0 34 # Manageability Access Attributes: 35 ... Primary LAN channel number: 1 is available 36 ... Secondary LAN channel is not available for OOB 37 ... No serial channel is available 38 39 FOR ${capability} IN @{supported_capabilities} 40 Should Contain ${cmd_output} ${capability} ignore_case=True 41 ... msg=Supported DCMI capabilities not present. 42 END 43 44 45Test Get Self Test Results via IPMI Raw Command 46 [Documentation] Get self test results via IPMI raw command and verify the output. 47 [Tags] Test_Get_Self_Test_Results_via_IPMI 48 49 ${resp}= Run IPMI Standard Command raw ${IPMI_RAW_CMD['Self_Test_Results']['Get'][0]} 50 51 # 55h = No error. All Self Tests Passed. 52 # 56h = Self Test function not implemented in this controller. 53 Should Contain Any ${resp} 55 00 56 00 54 55 56Test Get Device GUID Via IPMI Raw Command 57 [Documentation] Get device GUID via IPMI raw command and verify it using Redfish. 58 [Tags] Test_Get_Device_GUID_via_IPMI_and_Verify_via_Redfish 59 [Teardown] Run Keywords Redfish.Logout AND FFDC On Test Case Fail 60 # Get GUIDS via IPMI. 61 # This should match the /redfish/v1/Managers/bmc's UUID data. 62 ${guids}= Run IPMI Standard Command raw ${IPMI_RAW_CMD['Device GUID']['Get'][0]} 63 # Reverse the order and remove space delims. 64 ${guids}= Split String ${guids} 65 Reverse List ${guids} 66 ${guids}= Evaluate "".join(${guids}) 67 68 Redfish.Login 69 ${uuid}= Redfish.Get Attribute /redfish/v1/Managers/bmc UUID 70 ${uuid}= Remove String ${uuid} - 71 72 Rprint Vars guids uuid 73 Valid Value uuid ['${guids}'] 74 75 76Verify Get Channel Info via IPMI 77 [Documentation] Verify get channel info via IPMI. 78 [Tags] Verify_Get_Channel_Info_via_IPMI 79 80 # Get channel info via ipmi command "ipmitool channel info [channel number]". 81 # Verify channel info with files "channel_access_volatile.json", "channel_access_nv.json" 82 # and "channel_config.json" in BMC. 83 84 # Example output from 'Get Channel Info': 85 # channel_info: 86 # [channel_0x2_info]: 87 # [channel_medium_type]: 802.3 LAN 88 # [channel_protocol_type]: IPMB-1.0 89 # [session_support]: multi-session 90 # [active_session_count]: 0 91 # [protocol_vendor_id]: 7154 92 # [volatile(active)_settings]: 93 # [alerting]: enabled 94 # [per-message_auth]: enabled 95 # [user_level_auth]: enabled 96 # [access_mode]: always available 97 # [Non-Volatile Settings]: 98 # [alerting]: enabled 99 # [per-message_auth]: enabled 100 # [user_level_auth]: enabled 101 # [access_mode]: always available 102 103 ${channel_info_ipmi}= Get Channel Info ${CHANNEL_NUMBER} 104 ${active_channel_config}= Get Active Channel Config 105 ${channel_volatile_data_config}= Get Channel Access Config /run/ipmi/channel_access_volatile.json 106 ${channel_nv_data_config}= Get Channel Access Config /var/lib/ipmi/channel_access_nv.json 107 108 Rprint Vars channel_info_ipmi active_channel_config channel_volatile_data_config channel_nv_data_config 109 110 Valid Value medium_type_ipmi_conf_map['${channel_info_ipmi['channel_0x${CHANNEL_NUMBER}_info']['channel_medium_type']}'] 111 ... ['${active_channel_config['${CHANNEL_NUMBER}']['channel_info']['medium_type']}'] 112 113 Valid Value protocol_type_ipmi_conf_map['${channel_info_ipmi['channel_0x${CHANNEL_NUMBER}_info']['channel_protocol_type']}'] 114 ... ['${active_channel_config['${CHANNEL_NUMBER}']['channel_info']['protocol_type']}'] 115 116 Valid Value channel_info_ipmi['channel_0x${CHANNEL_NUMBER}_info']['session_support'] 117 ... ['${active_channel_config['${CHANNEL_NUMBER}']['channel_info']['session_supported']}'] 118 119 Valid Value channel_info_ipmi['channel_0x${CHANNEL_NUMBER}_info']['active_session_count'] 120 ... ['${active_channel_config['${CHANNEL_NUMBER}']['active_sessions']}'] 121 # IPMI Spec: The IPMI Enterprise Number is: 7154 (decimal) 122 Valid Value channel_info_ipmi['channel_0x${CHANNEL_NUMBER}_info']['protocol_vendor_id'] ['7154'] 123 124 # Verify volatile(active)_settings 125 Valid Value disabled_ipmi_conf_map['${channel_info_ipmi['volatile(active)_settings']['alerting']}'] 126 ... ['${channel_volatile_data_config['${CHANNEL_NUMBER}']['alerting_disabled']}'] 127 128 Valid Value disabled_ipmi_conf_map['${channel_info_ipmi['volatile(active)_settings']['per-message_auth']}'] 129 ... ['${channel_volatile_data_config['${CHANNEL_NUMBER}']['per_msg_auth_disabled']}'] 130 131 Valid Value disabled_ipmi_conf_map['${channel_info_ipmi['volatile(active)_settings']['user_level_auth']}'] 132 ... ['${channel_volatile_data_config['${CHANNEL_NUMBER}']['user_auth_disabled']}'] 133 134 Valid Value access_mode_ipmi_conf_map['${channel_info_ipmi['volatile(active)_settings']['access_mode']}'] 135 ... ['${channel_volatile_data_config['${CHANNEL_NUMBER}']['access_mode']}'] 136 137 # Verify Non-Volatile Settings 138 Valid Value disabled_ipmi_conf_map['${channel_info_ipmi['non-volatile_settings']['alerting']}'] 139 ... ['${channel_nv_data_config['${CHANNEL_NUMBER}']['alerting_disabled']}'] 140 141 Valid Value disabled_ipmi_conf_map['${channel_info_ipmi['non-volatile_settings']['per-message_auth']}'] 142 ... ['${channel_nv_data_config['${CHANNEL_NUMBER}']['per_msg_auth_disabled']}'] 143 144 Valid Value disabled_ipmi_conf_map['${channel_info_ipmi['non-volatile_settings']['user_level_auth']}'] 145 ... ['${channel_nv_data_config['${CHANNEL_NUMBER}']['user_auth_disabled']}'] 146 147 Valid Value access_mode_ipmi_conf_map['${channel_info_ipmi['non-volatile_settings']['access_mode']}'] 148 ... ['${channel_nv_data_config['${CHANNEL_NUMBER}']['access_mode']}'] 149 150 151Test Get Channel Authentication Capabilities via IPMI 152 [Documentation] Test get channel authentication capabilities via IPMI. 153 [Tags] Test_Get_Channel_Authentication_Capabilities_via_IPMI 154 155 ${channel_auth_cap}= Get Channel Auth Capabilities ${CHANNEL_NUMBER} 156 Rprint Vars channel_auth_cap 157 158 Valid Value channel_auth_cap['channel_number'] ['${CHANNEL_NUMBER}'] 159 Valid Value channel_auth_cap['kg_status'] ['default (all zeroes)'] 160 Valid Value channel_auth_cap['per_message_authentication'] ['enabled'] 161 Valid Value channel_auth_cap['user_level_authentication'] ['enabled'] 162 Valid Value channel_auth_cap['non-null_user_names_exist'] ['yes'] 163 Valid Value channel_auth_cap['null_user_names_exist'] ['no'] 164 Valid Value channel_auth_cap['anonymous_login_enabled'] ['no'] 165 Valid Value channel_auth_cap['channel_supports_ipmi_v1.5'] ['no'] 166 Valid Value channel_auth_cap['channel_supports_ipmi_v2.0'] ['yes'] 167