blob: e3efce4dd9a4547dcbcce4ac18379639ace546f4 [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
8
9Suite Setup Suite Setup Execution
10Suite Teardown Suite Teardown Execution
11
12Test Teardown FFDC On Test Case Fail
13
14*** Test Cases ***
15
16Enable Field Mode And Verify Unmount
17 [Documentation] Enable field mode and check that /usr/local is unmounted.
18 [Tags] Enable_Field_Mode
19
20 # After running, /xyz/openbmc_project/software should look like this:
21 # /xyz/openbmc_project/software
22 # {
23 # "FieldModeEnabled": 1,
24 # "associations": [
25 # [
26 # "active",
27 # "software_version",
28 # "/xyz/openbmc_project/software/fcf8e182"
29 # ],
30 # [
31 # "functional",
32 # "software_version",
33 # "/xyz/openbmc_project/software/fcf8e182"
34 # ]
35 # ]
36 # }
37
38 ${args}= Create Dictionary data=${1}
39 Write Attribute ${SOFTWARE_VERSION_URI} FieldModeEnabled data=${args}
Charles Paul Hofer00401e72017-10-31 11:42:30 -050040 Sleep 5s
Charles Paul Hoferf45e5ee2017-10-04 12:15:48 -050041 BMC Execute Command [ ! -d "/usr/local/share" ]
42
43
44Attempt To Disable Field Mode Via REST And Veify
45 [Documentation] Attempt to disable field mode with REST and verify that
46 ... it remains enabled.
47 [Tags] Attempt_To_Disable_Field_Mode_Via_REST
48
49 # This test case doesn't actually disable field mode. It attempts to, but
50 # verifies that the FieldModeEnabled property keeps its value of '1'
51 # after trying to set it to '0'. Field mode is disabled in suite teardown.
52
53 ${args}= Create Dictionary data=${0}
54 Write Attribute ${SOFTWARE_VERSION_URI} FieldModeEnabled
55 ... verify=${TRUE} expected_value=${1} data=${args}
56
57
58*** Keywords ***
59
60Suite Setup Execution
61 [Documentation] Do suite setup tasks.
62
63 # Check that /usr/local is mounted
64 BMC Execute Command [ -d "/usr/local/share" ]
65
66
67Suite Teardown Execution
68 [Documentation] Do suite teardown tasks.
69
70 # 1. Disable field mode
71 # 2. Check that /usr/local is mounted
72
73 BMC Execute Command /sbin/fw_setenv fieldmode
74 BMC Execute Command /bin/systemctl unmask usr-local.mount
75 OBMC Reboot (off) quiet=${1}
76 BMC Execute Command [ -d "/usr/local/share" ]