blob: b27d32a47f833c675409998589d07d1492ecf7cf [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.
41
42 ${valueToBeSet}= Set Variable abcdefg
43 ${valueDict}= create dictionary data=${valueToBeSet}
44 Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
45 ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
46 should not be true '${value}'=='${valueToBeSet}'
47
48Set the power with greater then MAX_POWER_VALUE
49
50 [Documentation] ***BAD PATH***
51 ... This test case sets the power value which is greater
52 ... then MAX_ALLOWED_VALUE,Expectation is to return error
53
54 ${valueToBeSet}= Set Variable ${1010}
55 ${valueDict}= create dictionary data=${valueToBeSet}
56 Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
57 ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
58 should not be equal ${value} ${valueToBeSet}
59
60Set the power with MIN_POWER_VALUE
61
62 [Documentation] ***BAD PATH***
63 ... This test case sets the power value less then
64 ... MIN_ALLOWED_VALUE,Expectation is it should get error.
65
66 ${valueToBeSet}= Set Variable ${MIN_POWER_VALUE}
67 ${valueDict}= create dictionary data=${valueToBeSet}
68 Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
69 ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
70 Should Be Equal ${value} ${valueToBeSet}
71
72Set the power with MAX_POWER_VALUE
73
74 [Documentation] ***GOOD PATH***
75 ... This test case sets the power value with MAX_POWER_VALUE
76 ... and it should be set.
77
78 ${valueToBeSet}= Set Variable ${MAX_POWER_VALUE}
79 ${valueDict}= create dictionary data=${valueToBeSet}
80 Write Attribute /org/openbmc/settings/host0 power_cap data=${valueDict}
81 ${value}= Read Attribute /org/openbmc/settings/host0 power_cap
82 Should Be Equal ${value} ${valueToBeSet}
83
84Set the boot flags with string
85
86 [Documentation] ***BAD PATH***
87 ... This test case sets the boot flag with some invalid string
88 ... Expectation is it should not be set.
89
90 ${valueToBeSet}= Set Variable 3ab56f
91 ${valueDict} = create dictionary data=${valueToBeSet}
92 Write Attribute /org/openbmc/settings/host0 boot_flags data=${valueDict}
93 ${value}= Read Attribute /org/openbmc/settings/host0 boot_flags
94 Should not Be Equal ${value} ${valueToBeSet}
95