Rahul Maheshwari | fdd5ff6 | 2017-08-01 04:15:03 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This suite is for testing general IPMI functions. |
| 3 | |
| 4 | Resource ../../lib/ipmi_client.robot |
| 5 | Resource ../../lib/openbmc_ffdc.robot |
| 6 | |
| 7 | Test Teardown FFDC On Test Case Fail |
| 8 | |
| 9 | *** Variables *** |
| 10 | |
| 11 | *** Test Cases *** |
| 12 | |
| 13 | Set Asset Tag With Valid String Length |
| 14 | [Documentation] Set asset tag with valid string length and verify. |
| 15 | [Tags] Set_Asset_Tag_With_Valid_String_Length |
| 16 | |
| 17 | # Allowed MAX characters length for asset tag name is 63. |
| 18 | ${random_string}= Generate Random String 63 |
| 19 | Run Keyword Run IPMI Standard Command dcmi set_asset_tag ${random_string} |
| 20 | |
| 21 | ${asset_tag}= Run Keyword Run IPMI Standard Command dcmi asset_tag |
| 22 | Should Contain ${asset_tag} ${random_string} |
| 23 | |
| 24 | |
| 25 | Set Asset Tag With Invalid String Length |
| 26 | [Documentation] Verify error while setting invalid asset tag via IPMI. |
| 27 | [Tags] Set_Asset_Tag_With_Invalid_String_Length |
| 28 | |
| 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 |
| 35 | |
| 36 | |
| 37 | Set Asset Tag With Valid String Length Via REST |
| 38 | [Documentation] Set valid asset tag via REST and verify. |
| 39 | [Tags] Set_Asset_Tag_With_Valid_String_Length_Via_REST |
| 40 | |
| 41 | ${random_string}= Generate Random String 63 |
| 42 | ${args}= Create Dictionary data=${random_string} |
| 43 | Write Attribute /xyz/openbmc_project/inventory/system AssetTag |
| 44 | ... data=${args} |
| 45 | |
| 46 | ${asset_tag}= Read Attribute /xyz/openbmc_project/inventory/system |
| 47 | ... AssetTag |
| 48 | Should Be Equal As Strings ${asset_tag} ${random_string} |
| 49 | |
| 50 | |
| 51 | *** Keywords *** |