blob: 1d474192d681a8348865b4edcc71e5cf59eaa39e [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
Gunnar Millseac1af22016-11-14 15:30:09 -06008Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -05009
10
11*** Variables ***
George Keishing69019e12016-10-06 06:29:57 -050012${MIN_POWER_VALUE} ${0}
13${MAX_POWER_VALUE} ${1000}
Chris Austenb29d2e82016-06-07 12:25:35 -050014
George Keishingec807372016-12-05 03:54:51 -060015${SETTING_HOST} ${SETTINGS_URI}host0
16
Chris Austenb29d2e82016-06-07 12:25:35 -050017*** Test Cases ***
18
19
20Get the boot_flags
21
22 [Documentation] ***GOOD PATH***
23 ... This test case tries to get the boot flags
George Keishing69019e12016-10-06 06:29:57 -050024 ...
Chris Austenb29d2e82016-06-07 12:25:35 -050025
George Keishingec807372016-12-05 03:54:51 -060026 ${resp}= Read Attribute ${SETTING_HOST} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -050027 should not be empty ${resp}
28
29Get the power
George Keishing69019e12016-10-06 06:29:57 -050030
Chris Austenb29d2e82016-06-07 12:25:35 -050031 [Documentation] ***GOOD PATH***
George Keishing69019e12016-10-06 06:29:57 -050032 ... This test case tries to get the power value and it should be
Chris Austenb29d2e82016-06-07 12:25:35 -050033 ... between ${MIN_POWER_VALUE} and ${MAX_POWER_VALUE}
34
George Keishingec807372016-12-05 03:54:51 -060035 ${powerValue}= Read Attribute ${SETTING_HOST} power_cap
Chris Austenb29d2e82016-06-07 12:25:35 -050036 should be true ${powerValue} >= ${MIN_POWER_VALUE} and ${powerValue} <= ${MAX_POWER_VALUE}
37
38Set 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 Maheshwari08fd6172016-09-21 12:04:43 -050043 ... Existing Issue: https://github.com/openbmc/openbmc/issues/552
44 [Tags] known_issue
Chris Austenb29d2e82016-06-07 12:25:35 -050045
46 ${valueToBeSet}= Set Variable abcdefg
47 ${valueDict}= create dictionary data=${valueToBeSet}
George Keishingec807372016-12-05 03:54:51 -060048 Write Attribute ${SETTING_HOST} power_cap data=${valueDict}
49 ${value}= Read Attribute ${SETTING_HOST} power_cap
Chris Austenb29d2e82016-06-07 12:25:35 -050050 should not be true '${value}'=='${valueToBeSet}'
51
52Set the power with greater then MAX_POWER_VALUE
53
54 [Documentation] ***BAD PATH***
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050055 ... This test case sets the power value which is greater
Chris Austenb29d2e82016-06-07 12:25:35 -050056 ... then MAX_ALLOWED_VALUE,Expectation is to return error
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050057 ... Existing Issue: https://github.com/openbmc/openbmc/issues/552
58 [Tags] known_issue
Chris Austenb29d2e82016-06-07 12:25:35 -050059
60 ${valueToBeSet}= Set Variable ${1010}
61 ${valueDict}= create dictionary data=${valueToBeSet}
George Keishingec807372016-12-05 03:54:51 -060062 Write Attribute ${SETTING_HOST} power_cap data=${valueDict}
63 ${value}= Read Attribute ${SETTING_HOST} power_cap
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050064 should not be equal ${value} ${valueToBeSet}
Chris Austenb29d2e82016-06-07 12:25:35 -050065
66Set the power with MIN_POWER_VALUE
67
68 [Documentation] ***BAD PATH***
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050069 ... This test case sets the power value less then
Chris Austenb29d2e82016-06-07 12:25:35 -050070 ... MIN_ALLOWED_VALUE,Expectation is it should get error.
71
72 ${valueToBeSet}= Set Variable ${MIN_POWER_VALUE}
73 ${valueDict}= create dictionary data=${valueToBeSet}
George Keishingec807372016-12-05 03:54:51 -060074 Write Attribute ${SETTING_HOST} power_cap data=${valueDict}
75 ${value}= Read Attribute ${SETTING_HOST} power_cap
Chris Austenb29d2e82016-06-07 12:25:35 -050076 Should Be Equal ${value} ${valueToBeSet}
77
78Set 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 Maheshwari08fd6172016-09-21 12:04:43 -050083
Chris Austenb29d2e82016-06-07 12:25:35 -050084 ${valueToBeSet}= Set Variable ${MAX_POWER_VALUE}
85 ${valueDict}= create dictionary data=${valueToBeSet}
George Keishingec807372016-12-05 03:54:51 -060086 Write Attribute ${SETTING_HOST} power_cap data=${valueDict}
87 ${value}= Read Attribute ${SETTING_HOST} power_cap
Chris Austenb29d2e82016-06-07 12:25:35 -050088 Should Be Equal ${value} ${valueToBeSet}
89
90Set the boot flags with string
91
92 [Documentation] ***BAD PATH***
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050093 ... This test case sets the boot flag with some invalid string
Chris Austenb29d2e82016-06-07 12:25:35 -050094 ... Expectation is it should not be set.
Rahul Maheshwari08fd6172016-09-21 12:04:43 -050095 ... Existing Issue: https://github.com/openbmc/openbmc/issues/552
96 [Tags] known_issue
Chris Austenb29d2e82016-06-07 12:25:35 -050097
98 ${valueToBeSet}= Set Variable 3ab56f
Gunnar Mills1cd544d2016-12-06 11:19:22 -060099 ${valueDict}= create dictionary data=${valueToBeSet}
George Keishingec807372016-12-05 03:54:51 -0600100 Write Attribute ${SETTING_HOST} boot_flags data=${valueDict}
101 ${value}= Read Attribute ${SETTING_HOST} boot_flags
Chris Austenb29d2e82016-06-07 12:25:35 -0500102 Should not Be Equal ${value} ${valueToBeSet}
103