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} |
| 40 | BMC Execute Command [ ! -d "/usr/local/share" ] |
| 41 | |
| 42 | |
| 43 | Attempt 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 | |
| 59 | Suite 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 | |
| 66 | Suite 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" ] |