Add x86 infrastruction for boot test

Changes:
  - Add platform type user driven option "x86". by default it will
    choose platform "power"
  - Add filter to removed x86 non supported states from state.py
  - Remove "operating_systems" entry from data/boot_table_x86.json

How To test:
  robot -v OPENBMC_HOST:xx.xx.xx.xx -v PLATFORM_ARCH_TYPE:x86  <test suite>

Change-Id: Id49b07e620150e4ed0c4fa45675959f647f4f878
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/boot_data.py b/lib/boot_data.py
index 42af3f7..9755cef 100755
--- a/lib/boot_data.py
+++ b/lib/boot_data.py
@@ -29,6 +29,8 @@
 redfish_support_trans_state = int(os.environ.get('REDFISH_SUPPORT_TRANS_STATE', 0)) or \
     int(BuiltIn().get_variable_value("${REDFISH_SUPPORT_TRANS_STATE}", default=0))
 
+platform_arch_type = BuiltIn().get_variable_value("${PLATFORM_ARCH_TYPE}", default="power")
+
 
 def create_boot_table(file_path=None,
                       os_host=""):
@@ -52,6 +54,8 @@
     if file_path is None:
         if redfish_support_trans_state:
             file_path = os.environ.get('BOOT_TABLE_PATH', 'data/boot_table_redfish.json')
+        elif platform_arch_type == "x86":
+            file_path = os.environ.get('BOOT_TABLE_PATH', 'data/boot_table_x86.json')
         else:
             file_path = os.environ.get('BOOT_TABLE_PATH', 'data/boot_table.json')
 
diff --git a/lib/resource.robot b/lib/resource.robot
index 4aa1a09..401cbe9 100755
--- a/lib/resource.robot
+++ b/lib/resource.robot
@@ -7,6 +7,9 @@
 
 *** Variables ***
 
+# By default power, support x86 as well.
+${PLATFORM_ARCH_TYPE}             power
+
 # Transition REST vs Redfish ONLY temporary changes for stagging
 # automation infrastructure change and for continuity.
 ${REDFISH_SUPPORT_TRANS_STATE}    ${0}
diff --git a/lib/state.py b/lib/state.py
index 10c1d0c..5f3d50c 100755
--- a/lib/state.py
+++ b/lib/state.py
@@ -81,6 +81,8 @@
 redfish_support_trans_state = int(os.environ.get('REDFISH_SUPPORT_TRANS_STATE', 0)) or \
     int(BuiltIn().get_variable_value("${REDFISH_SUPPORT_TRANS_STATE}", default=0))
 
+platform_arch_type = BuiltIn().get_variable_value("${PLATFORM_ARCH_TYPE}", default="power")
+
 # valid_os_req_states and default_os_req_states are used by the os_get_state
 # function.
 # valid_os_req_states is a list of state information supported by the
@@ -255,6 +257,23 @@
                                    ('boot_progress', '^$'),
                                    ('host', '^$')])
 
+# Filter the states based on platform type.
+if platform_arch_type == "x86":
+    default_req_states.remove("operating_system")
+    default_req_states.remove("boot_progress")
+    valid_req_states.remove("operating_system")
+    valid_req_states.remove("boot_progress")
+    del default_state["operating_system"]
+    del default_state["boot_progress"]
+    del standby_match_state["operating_system"]
+    del standby_match_state["boot_progress"]
+    del os_running_match_state["operating_system"]
+    del os_running_match_state["boot_progress"]
+    del master_os_up_match["operating_system"]
+    del master_os_up_match["boot_progress"]
+    del invalid_state_match["operating_system"]
+    del invalid_state_match["boot_progress"]
+
 
 def return_state_constant(state_name='default_state'):
     r"""