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 | |
| 15 | *** Test Cases *** |
| 16 | |
| 17 | |
| 18 | Get the boot_flags |
| 19 | |
| 20 | [Documentation] ***GOOD PATH*** |
| 21 | ... This test case tries to get the boot flags |
George Keishing | 69019e1 | 2016-10-06 06:29:57 -0500 | [diff] [blame] | 22 | ... |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 23 | |
| 24 | ${resp}= Read Attribute /org/openbmc/settings/host0/ boot_flags |
| 25 | should not be empty ${resp} |
| 26 | |
| 27 | Get the power |
George Keishing | 69019e1 | 2016-10-06 06:29:57 -0500 | [diff] [blame] | 28 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 29 | [Documentation] ***GOOD PATH*** |
George Keishing | 69019e1 | 2016-10-06 06:29:57 -0500 | [diff] [blame] | 30 | ... 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] | 31 | ... between ${MIN_POWER_VALUE} and ${MAX_POWER_VALUE} |
| 32 | |
| 33 | ${powerValue}= Read Attribute /org/openbmc/settings/host0/ power_cap |
| 34 | should be true ${powerValue} >= ${MIN_POWER_VALUE} and ${powerValue} <= ${MAX_POWER_VALUE} |
| 35 | |
| 36 | Set the power with string of characters |
| 37 | |
| 38 | [Documentation] ***BAD PATH*** |
| 39 | ... This test case set the power values with string of characters |
| 40 | ... Expectation is to return error. |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 41 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/552 |
| 42 | [Tags] known_issue |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 43 | |
| 44 | ${valueToBeSet}= Set Variable abcdefg |
| 45 | ${valueDict}= create dictionary data=${valueToBeSet} |
| 46 | Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict} |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 47 | ${value}= Read Attribute /org/openbmc/settings/host0 power_cap |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 48 | should not be true '${value}'=='${valueToBeSet}' |
| 49 | |
| 50 | Set the power with greater then MAX_POWER_VALUE |
| 51 | |
| 52 | [Documentation] ***BAD PATH*** |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 53 | ... This test case sets the power value which is greater |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 54 | ... then MAX_ALLOWED_VALUE,Expectation is to return error |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 55 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/552 |
| 56 | [Tags] known_issue |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 57 | |
| 58 | ${valueToBeSet}= Set Variable ${1010} |
| 59 | ${valueDict}= create dictionary data=${valueToBeSet} |
| 60 | Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict} |
| 61 | ${value}= Read Attribute /org/openbmc/settings/host0 power_cap |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 62 | should not be equal ${value} ${valueToBeSet} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 63 | |
| 64 | Set the power with MIN_POWER_VALUE |
| 65 | |
| 66 | [Documentation] ***BAD PATH*** |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 67 | ... This test case sets the power value less then |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 68 | ... MIN_ALLOWED_VALUE,Expectation is it should get error. |
| 69 | |
| 70 | ${valueToBeSet}= Set Variable ${MIN_POWER_VALUE} |
| 71 | ${valueDict}= create dictionary data=${valueToBeSet} |
| 72 | Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict} |
| 73 | ${value}= Read Attribute /org/openbmc/settings/host0 power_cap |
| 74 | Should Be Equal ${value} ${valueToBeSet} |
| 75 | |
| 76 | Set the power with MAX_POWER_VALUE |
| 77 | |
| 78 | [Documentation] ***GOOD PATH*** |
| 79 | ... This test case sets the power value with MAX_POWER_VALUE |
| 80 | ... and it should be set. |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 81 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 82 | ${valueToBeSet}= Set Variable ${MAX_POWER_VALUE} |
| 83 | ${valueDict}= create dictionary data=${valueToBeSet} |
| 84 | Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict} |
| 85 | ${value}= Read Attribute /org/openbmc/settings/host0 power_cap |
| 86 | Should Be Equal ${value} ${valueToBeSet} |
| 87 | |
| 88 | Set the boot flags with string |
| 89 | |
| 90 | [Documentation] ***BAD PATH*** |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 91 | ... This test case sets the boot flag with some invalid string |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 92 | ... Expectation is it should not be set. |
Rahul Maheshwari | 08fd617 | 2016-09-21 12:04:43 -0500 | [diff] [blame] | 93 | ... Existing Issue: https://github.com/openbmc/openbmc/issues/552 |
| 94 | [Tags] known_issue |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 95 | |
| 96 | ${valueToBeSet}= Set Variable 3ab56f |
| 97 | ${valueDict} = create dictionary data=${valueToBeSet} |
| 98 | Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict} |
| 99 | ${value}= Read Attribute /org/openbmc/settings/host0 boot_flags |
| 100 | Should not Be Equal ${value} ${valueToBeSet} |
| 101 | |