Charles Paul Hofer | f45e5ee | 2017-10-04 12:15:48 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test BMC field mode. |
| 3 | |
| 4 | Variables ../../data/variables.py |
| 5 | Resource ../../lib/boot_utils.robot |
| 6 | Resource ../../lib/rest_client.robot |
| 7 | Resource ../../lib/openbmc_ffdc.robot |
| 8 | |
| 9 | Suite Setup Suite Setup Execution |
| 10 | Suite Teardown Suite Teardown Execution |
| 11 | |
| 12 | Test Teardown FFDC On Test Case Fail |
| 13 | |
| 14 | *** Test Cases *** |
| 15 | |
| 16 | Enable 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 Hofer | 00401e7 | 2017-10-31 11:42:30 -0500 | [diff] [blame] | 40 | Sleep 5s |
Charles Paul Hofer | f45e5ee | 2017-10-04 12:15:48 -0500 | [diff] [blame] | 41 | BMC Execute Command [ ! -d "/usr/local/share" ] |
| 42 | |
| 43 | |
| 44 | Attempt 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 | |
| 60 | Suite 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 | |
| 67 | Suite 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" ] |