blob: 044b12453602af58e319352bc7eece8c54bcc52a [file] [log] [blame]
Charles Paul Hoferf45e5ee2017-10-04 12:15:48 -05001*** Settings ***
2Documentation Test BMC field mode.
3
4Variables ../../data/variables.py
5Resource ../../lib/boot_utils.robot
6Resource ../../lib/rest_client.robot
7Resource ../../lib/openbmc_ffdc.robot
George Keishingfb762032017-11-14 11:18:21 -06008Resource ../../lib/code_update_utils.robot
Charles Paul Hoferf45e5ee2017-10-04 12:15:48 -05009
10Suite Setup Suite Setup Execution
11Suite Teardown Suite Teardown Execution
12
13Test Teardown FFDC On Test Case Fail
14
15*** Test Cases ***
16
George Keishingfb762032017-11-14 11:18:21 -060017Verify Software Field Mode
18 [Documentation] Verify software field mode is set.
19 [Tags] Verify_Software_Field_Mode
Charles Paul Hoferf45e5ee2017-10-04 12:15:48 -050020
21 # After running, /xyz/openbmc_project/software should look like this:
22 # /xyz/openbmc_project/software
23 # {
24 # "FieldModeEnabled": 1,
25 # "associations": [
26 # [
27 # "active",
28 # "software_version",
29 # "/xyz/openbmc_project/software/fcf8e182"
30 # ],
31 # [
32 # "functional",
33 # "software_version",
34 # "/xyz/openbmc_project/software/fcf8e182"
35 # ]
36 # ]
37 # }
38
George Keishingfb762032017-11-14 11:18:21 -060039 Enable Field Mode And Verify Unmount
Charles Paul Hoferf45e5ee2017-10-04 12:15:48 -050040
41
42Attempt To Disable Field Mode Via REST And Veify
43 [Documentation] Attempt to disable field mode with REST and verify that
44 ... it remains enabled.
45 [Tags] Attempt_To_Disable_Field_Mode_Via_REST
46
47 # This test case doesn't actually disable field mode. It attempts to, but
48 # verifies that the FieldModeEnabled property keeps its value of '1'
49 # after trying to set it to '0'. Field mode is disabled in suite teardown.
50
51 ${args}= Create Dictionary data=${0}
52 Write Attribute ${SOFTWARE_VERSION_URI} FieldModeEnabled
53 ... verify=${TRUE} expected_value=${1} data=${args}
54
55
56*** Keywords ***
57
58Suite Setup Execution
59 [Documentation] Do suite setup tasks.
60
61 # Check that /usr/local is mounted
62 BMC Execute Command [ -d "/usr/local/share" ]
63
64
65Suite Teardown Execution
66 [Documentation] Do suite teardown tasks.
67
68 # 1. Disable field mode
69 # 2. Check that /usr/local is mounted
70
71 BMC Execute Command /sbin/fw_setenv fieldmode
72 BMC Execute Command /bin/systemctl unmask usr-local.mount
73 OBMC Reboot (off) quiet=${1}
George Keishingfb762032017-11-14 11:18:21 -060074 BMC Execute Command [ -d "/usr/local/share" ]