Rahul Maheshwari | c84f30c | 2019-07-30 00:29:04 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Module to test IPMI asset tag functionality. |
| 4 | Resource ../lib/ipmi_client.robot |
| 5 | Resource ../lib/openbmc_ffdc.robot |
Rahul Maheshwari | 9a0f50d | 2019-09-17 06:03:44 -0500 | [diff] [blame] | 6 | Library ../lib/gen_robot_valid.py |
Rahul Maheshwari | c84f30c | 2019-07-30 00:29:04 -0500 | [diff] [blame] | 7 | |
Rahul Maheshwari | 9a0f50d | 2019-09-17 06:03:44 -0500 | [diff] [blame] | 8 | Suite Setup Redfish.Login |
| 9 | Suite Teardown Redfish.Logout |
Rahul Maheshwari | c84f30c | 2019-07-30 00:29:04 -0500 | [diff] [blame] | 10 | Test Teardown FFDC On Test Case Fail |
| 11 | |
Rahul Maheshwari | 9a0f50d | 2019-09-17 06:03:44 -0500 | [diff] [blame] | 12 | |
Rahul Maheshwari | c84f30c | 2019-07-30 00:29:04 -0500 | [diff] [blame] | 13 | *** Test Cases *** |
| 14 | |
| 15 | Set Asset Tag With Valid String Length |
| 16 | [Documentation] Set asset tag with valid string length and verify. |
| 17 | [Tags] Set_Asset_Tag_With_Valid_String_Length |
| 18 | # Allowed MAX characters length for asset tag name is 63. |
| 19 | ${random_string}= Generate Random String 63 |
| 20 | Run Keyword Run IPMI Standard Command dcmi set_asset_tag ${random_string} |
| 21 | |
| 22 | ${asset_tag}= Run Keyword Run IPMI Standard Command dcmi asset_tag |
| 23 | Should Contain ${asset_tag} ${random_string} |
| 24 | |
| 25 | |
| 26 | Set Asset Tag With Invalid String Length |
| 27 | [Documentation] Verify error while setting invalid asset tag via IPMI. |
| 28 | [Tags] Set_Asset_Tag_With_Invalid_String_Length |
| 29 | # Any string more than 63 character is invalid for asset tag. |
| 30 | ${random_string}= Generate Random String 64 |
| 31 | |
| 32 | ${resp}= Run Keyword And Expect Error * Run IPMI Standard Command |
| 33 | ... dcmi set_asset_tag ${random_string} |
| 34 | Should Contain ${resp} Parameter out of range ignore_case=True |
Rahul Maheshwari | 9a0f50d | 2019-09-17 06:03:44 -0500 | [diff] [blame] | 35 | |
| 36 | |
| 37 | Set Asset Tag With IPMI And Verify With Redfish |
| 38 | [Documentation] Set valid asset tag via IPMI and verify using Redfish. |
| 39 | [Tags] Set_Asset_Tag_With_IPMI_And_Verify_With_Redfish |
| 40 | |
| 41 | ${random_string}= Generate Random String 63 |
| 42 | Run Keyword Run IPMI Standard Command dcmi set_asset_tag ${random_string} |
| 43 | |
| 44 | ${asset_tag}= Redfish.Get Attribute ${SYSTEM_BASE_URI} AssetTag |
| 45 | Valid Value asset_tag ['${random_string}'] |