blob: 6bba58fe9be0345b3737f56f462cd53874d43dc9 [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}
40 BMC Execute Command [ ! -d "/usr/local/share" ]
41
42
43Attempt To Disable Field Mode Via REST And Veify
44 [Documentation] Attempt to disable field mode with REST and verify that
45 ... it remains enabled.
46 [Tags] Attempt_To_Disable_Field_Mode_Via_REST
47
48 # This test case doesn't actually disable field mode. It attempts to, but
49 # verifies that the FieldModeEnabled property keeps its value of '1'
50 # after trying to set it to '0'. Field mode is disabled in suite teardown.
51
52 ${args}= Create Dictionary data=${0}
53 Write Attribute ${SOFTWARE_VERSION_URI} FieldModeEnabled
54 ... verify=${TRUE} expected_value=${1} data=${args}
55
56
57*** Keywords ***
58
59Suite Setup Execution
60 [Documentation] Do suite setup tasks.
61
62 # Check that /usr/local is mounted
63 BMC Execute Command [ -d "/usr/local/share" ]
64
65
66Suite Teardown Execution
67 [Documentation] Do suite teardown tasks.
68
69 # 1. Disable field mode
70 # 2. Check that /usr/local is mounted
71
72 BMC Execute Command /sbin/fw_setenv fieldmode
73 BMC Execute Command /bin/systemctl unmask usr-local.mount
74 OBMC Reboot (off) quiet=${1}
75 BMC Execute Command [ -d "/usr/local/share" ]