Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 2 | Documentation This suite will verifiy the Generic Configuration Rest Interfaces |
| 3 | ... Details of valid interfaces can be found here... |
| 4 | ... https://github.com/openbmc/docs/blob/master/rest-api.md |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 5 | |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 6 | Resource ../lib/rest_client.robot |
| 7 | Resource ../lib/openbmc_ffdc.robot |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 8 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | |
| 10 | |
| 11 | *** Variables *** |
George Keishing | 69019e1 | 2016-10-06 06:29:57 -0500 | [diff] [blame] | 12 | ${MIN_POWER_VALUE} ${0} |
| 13 | ${MAX_POWER_VALUE} ${1000} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 14 | |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 15 | ${SETTING_HOST} ${SETTINGS_URI}host0 |
| 16 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 17 | *** Test Cases *** |
| 18 | |
| 19 | |
| 20 | Get the boot_flags |
| 21 | |
| 22 | [Documentation] ***GOOD PATH*** |
| 23 | ... This test case tries to get the boot flags |
George Keishing | 69019e1 | 2016-10-06 06:29:57 -0500 | [diff] [blame] | 24 | ... |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 25 | |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 26 | ${resp}= Read Attribute ${SETTING_HOST} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 27 | should not be empty ${resp} |
| 28 | |
| 29 | Get the power |
George Keishing | 69019e1 | 2016-10-06 06:29:57 -0500 | [diff] [blame] | 30 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 31 | [Documentation] ***GOOD PATH*** |
George Keishing | 69019e1 | 2016-10-06 06:29:57 -0500 | [diff] [blame] | 32 | ... This test case tries to get the power value and it should be |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 33 | ... between ${MIN_POWER_VALUE} and ${MAX_POWER_VALUE} |
| 34 | |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 35 | ${powerValue}= Read Attribute ${SETTING_HOST} power_cap |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 36 | should be true ${powerValue} >= ${MIN_POWER_VALUE} and ${powerValue} <= ${MAX_POWER_VALUE} |
| 37 | |
| 38 | Set the power with string of characters |
| 39 | |
| 40 | [Documentation] ***BAD PATH*** |
| 41 | ... This test case set the power values with string of characters |
| 42 | ... Expectation is to return error. |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 43 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/552 |
| 44 | [Tags] known_issue |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 45 | |
| 46 | ${valueToBeSet}= Set Variable abcdefg |
| 47 | ${valueDict}= create dictionary data=${valueToBeSet} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 48 | Write Attribute ${SETTING_HOST} power_cap data=${valueDict} |
| 49 | ${value}= Read Attribute ${SETTING_HOST} power_cap |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 50 | should not be true '${value}'=='${valueToBeSet}' |
| 51 | |
| 52 | Set the power with greater then MAX_POWER_VALUE |
| 53 | |
| 54 | [Documentation] ***BAD PATH*** |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 55 | ... This test case sets the power value which is greater |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 56 | ... then MAX_ALLOWED_VALUE,Expectation is to return error |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 57 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/552 |
| 58 | [Tags] known_issue |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 59 | |
| 60 | ${valueToBeSet}= Set Variable ${1010} |
| 61 | ${valueDict}= create dictionary data=${valueToBeSet} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 62 | Write Attribute ${SETTING_HOST} power_cap data=${valueDict} |
| 63 | ${value}= Read Attribute ${SETTING_HOST} power_cap |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 64 | should not be equal ${value} ${valueToBeSet} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 65 | |
| 66 | Set the power with MIN_POWER_VALUE |
| 67 | |
| 68 | [Documentation] ***BAD PATH*** |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 69 | ... This test case sets the power value less then |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 70 | ... MIN_ALLOWED_VALUE,Expectation is it should get error. |
| 71 | |
| 72 | ${valueToBeSet}= Set Variable ${MIN_POWER_VALUE} |
| 73 | ${valueDict}= create dictionary data=${valueToBeSet} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 74 | Write Attribute ${SETTING_HOST} power_cap data=${valueDict} |
| 75 | ${value}= Read Attribute ${SETTING_HOST} power_cap |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 76 | Should Be Equal ${value} ${valueToBeSet} |
| 77 | |
| 78 | Set the power with MAX_POWER_VALUE |
| 79 | |
| 80 | [Documentation] ***GOOD PATH*** |
| 81 | ... This test case sets the power value with MAX_POWER_VALUE |
| 82 | ... and it should be set. |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 83 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 84 | ${valueToBeSet}= Set Variable ${MAX_POWER_VALUE} |
| 85 | ${valueDict}= create dictionary data=${valueToBeSet} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 86 | Write Attribute ${SETTING_HOST} power_cap data=${valueDict} |
| 87 | ${value}= Read Attribute ${SETTING_HOST} power_cap |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 88 | Should Be Equal ${value} ${valueToBeSet} |
| 89 | |
| 90 | Set the boot flags with string |
| 91 | |
| 92 | [Documentation] ***BAD PATH*** |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 93 | ... This test case sets the boot flag with some invalid string |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 94 | ... Expectation is it should not be set. |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 95 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/552 |
| 96 | [Tags] known_issue |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 97 | |
| 98 | ${valueToBeSet}= Set Variable 3ab56f |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 99 | ${valueDict}= create dictionary data=${valueToBeSet} |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 100 | Write Attribute ${SETTING_HOST} boot_flags data=${valueDict} |
| 101 | ${value}= Read Attribute ${SETTING_HOST} boot_flags |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 102 | Should not Be Equal ${value} ${valueToBeSet} |
| 103 | |