Field mode enable keyword
Changes:
- Move existing test to code update library keyword.
- Rename existing test name and call the new keyword.
- Enable field mode in setup sequence__init__.robot for CT.
Resolves openbmc/openbmc-test-automation#1133
Change-Id: Ida405818fb0c474247aa664bceab461d5b7b61ae
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/extended/code_update/test_field_mode.robot b/extended/code_update/test_field_mode.robot
index e3efce4..044b124 100644
--- a/extended/code_update/test_field_mode.robot
+++ b/extended/code_update/test_field_mode.robot
@@ -5,6 +5,7 @@
Resource ../../lib/boot_utils.robot
Resource ../../lib/rest_client.robot
Resource ../../lib/openbmc_ffdc.robot
+Resource ../../lib/code_update_utils.robot
Suite Setup Suite Setup Execution
Suite Teardown Suite Teardown Execution
@@ -13,9 +14,9 @@
*** Test Cases ***
-Enable Field Mode And Verify Unmount
- [Documentation] Enable field mode and check that /usr/local is unmounted.
- [Tags] Enable_Field_Mode
+Verify Software Field Mode
+ [Documentation] Verify software field mode is set.
+ [Tags] Verify_Software_Field_Mode
# After running, /xyz/openbmc_project/software should look like this:
# /xyz/openbmc_project/software
@@ -35,10 +36,7 @@
# ]
# }
- ${args}= Create Dictionary data=${1}
- Write Attribute ${SOFTWARE_VERSION_URI} FieldModeEnabled data=${args}
- Sleep 5s
- BMC Execute Command [ ! -d "/usr/local/share" ]
+ Enable Field Mode And Verify Unmount
Attempt To Disable Field Mode Via REST And Veify
@@ -73,4 +71,4 @@
BMC Execute Command /sbin/fw_setenv fieldmode
BMC Execute Command /bin/systemctl unmask usr-local.mount
OBMC Reboot (off) quiet=${1}
- BMC Execute Command [ -d "/usr/local/share" ]
\ No newline at end of file
+ BMC Execute Command [ -d "/usr/local/share" ]
diff --git a/lib/code_update_utils.robot b/lib/code_update_utils.robot
index 4f863d1..778ec02 100644
--- a/lib/code_update_utils.robot
+++ b/lib/code_update_utils.robot
@@ -384,3 +384,31 @@
${min_value}= Min List Value ${priority_value_list}
[Return] ${min_value}
+
+
+Enable Field Mode And Verify Unmount
+ [Documentation] Enable field mode and check that /usr/local is unmounted.
+
+ # After running, /xyz/openbmc_project/software should look like this:
+ # /xyz/openbmc_project/software
+ # {
+ # "FieldModeEnabled": 1,
+ # "associations": [
+ # [
+ # "active",
+ # "software_version",
+ # "/xyz/openbmc_project/software/fcf8e182"
+ # ],
+ # [
+ # "functional",
+ # "software_version",
+ # "/xyz/openbmc_project/software/fcf8e182"
+ # ]
+ # ]
+ # }
+
+ ${args}= Create Dictionary data=${1}
+ Write Attribute ${SOFTWARE_VERSION_URI} FieldModeEnabled data=${args}
+ Sleep 5s
+ BMC Execute Command [ ! -d "/usr/local/share" ]
+
diff --git a/tests/__init__.robot b/tests/__init__.robot
index a5109ae..54eb559 100644
--- a/tests/__init__.robot
+++ b/tests/__init__.robot
@@ -16,7 +16,7 @@
*** Keyword ***
System Driver Data
- [Documentation] System driver information.
+ [Documentation] System driver information and enable defaults settings.
Run Keyword And Ignore Error Clear System Entry From Knownhosts
Open Connection And Log In
Run Keyword And Ignore Error Log BMC Driver Details
@@ -24,6 +24,7 @@
Run Keyword And Ignore Error Log BMC Model
Run Keyword And Ignore Error Enable Core Dump On BMC
Run Keyword And Ignore Error Set Boot Defaults
+ Enable Field Mode And Verify Unmount
Set Boot Defaults
Set Control Boot Mode ${CONTROL_HOST_URI}/boot ${BOOT_MODE_REGULAR}