blob: bdd6c971cd2ee064584462f713243b24061b2a6f [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishingd55a4be2016-08-26 03:28:17 -05002Documentation 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 Austenb29d2e82016-06-07 12:25:35 -05005
George Keishingd55a4be2016-08-26 03:28:17 -05006Resource ../lib/rest_client.robot
7Resource ../lib/openbmc_ffdc.robot
8Test Teardown Log FFDC
Chris Austenb29d2e82016-06-07 12:25:35 -05009
10
11*** Variables ***
12${MIN_POWER_VALUE} 0
13${MAX_POWER_VALUE} 1000
14
15*** Test Cases ***
16
17
18Get the boot_flags
19
20 [Documentation] ***GOOD PATH***
21 ... This test case tries to get the boot flags
22 ...
23
24 ${resp}= Read Attribute /org/openbmc/settings/host0/ boot_flags
25 should not be empty ${resp}
26
27Get the power
28
29 [Documentation] ***GOOD PATH***
30 ... This test case tries to get the power value and it should be
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
36Set 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 Maheshwari08fd6172016-09-21 12:04:43 -050041 ... Existing Issue: https://github.com/openbmc/openbmc/issues/552
42 [Tags] known_issue
Chris Austenb29d2e82016-06-07 12:25:35 -050043
44 ${valueToBeSet}= Set Variable abcdefg
45 ${valueDict}= create dictionary data=${valueToBeSet}
46 Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050047 ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
Chris Austenb29d2e82016-06-07 12:25:35 -050048 should not be true '${value}'=='${valueToBeSet}'
49
50Set the power with greater then MAX_POWER_VALUE
51
52 [Documentation] ***BAD PATH***
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050053 ... This test case sets the power value which is greater
Chris Austenb29d2e82016-06-07 12:25:35 -050054 ... then MAX_ALLOWED_VALUE,Expectation is to return error
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050055 ... Existing Issue: https://github.com/openbmc/openbmc/issues/552
56 [Tags] known_issue
Chris Austenb29d2e82016-06-07 12:25:35 -050057
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 Maheshwari08fd6172016-09-21 12:04:43 -050062 should not be equal ${value} ${valueToBeSet}
Chris Austenb29d2e82016-06-07 12:25:35 -050063
64Set the power with MIN_POWER_VALUE
65
66 [Documentation] ***BAD PATH***
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050067 ... This test case sets the power value less then
Chris Austenb29d2e82016-06-07 12:25:35 -050068 ... 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
76Set 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 Maheshwari08fd6172016-09-21 12:04:43 -050081
Chris Austenb29d2e82016-06-07 12:25:35 -050082 ${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
88Set the boot flags with string
89
90 [Documentation] ***BAD PATH***
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050091 ... This test case sets the boot flag with some invalid string
Chris Austenb29d2e82016-06-07 12:25:35 -050092 ... Expectation is it should not be set.
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050093 ... Existing Issue: https://github.com/openbmc/openbmc/issues/552
94 [Tags] known_issue
Chris Austenb29d2e82016-06-07 12:25:35 -050095
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