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/data/boot_table_x86.json b/data/boot_table_x86.json
index 412a5cf..ec830aa 100644
--- a/data/boot_table_x86.json
+++ b/data/boot_table_x86.json
@@ -6,13 +6,11 @@
         "start": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -28,13 +26,11 @@
         "start": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -50,13 +46,11 @@
         "start": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -79,7 +73,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$",
             "os_ping": "^0$",
             "os_login": "^0$",
@@ -99,7 +92,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$",
             "os_ping": "^0$",
             "os_login": "^0$",
@@ -119,7 +111,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$",
             "os_ping": "^0$",
             "os_login": "^0$",
@@ -139,7 +130,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$",
             "os_ping": "^0$",
             "os_login": "^0$",
@@ -159,7 +149,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$",
             "os_ping": "^0$",
             "os_login": "^0$",
@@ -179,7 +168,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$",
             "os_ping": "^0$",
             "os_login": "^0$",
@@ -195,7 +183,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -204,7 +191,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$",
             "os_ping": "^0$",
             "os_login": "^0$",
@@ -224,7 +210,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -233,7 +218,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -249,7 +233,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -258,7 +241,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -273,7 +255,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -282,7 +263,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -298,7 +278,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -307,7 +286,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -327,7 +305,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "bmc_reboot": 1,
@@ -343,7 +320,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "bmc_reboot": 1,
@@ -360,7 +336,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "bmc_reboot": 1,
@@ -373,7 +348,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -382,7 +356,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -402,7 +375,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "bmc_reboot": 1,
@@ -416,7 +388,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -425,7 +396,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -446,7 +416,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "bmc_reboot": 1,
@@ -460,7 +429,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -469,7 +437,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -490,7 +457,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "bmc_reboot": 1,
@@ -504,7 +470,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -513,7 +478,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -534,7 +498,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "bmc_reboot": 1,
@@ -548,7 +511,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -557,7 +519,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -578,7 +539,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^Off$",
-            "operating_system": "^Inactive$",
             "host": "^Off$"
         },
         "bmc_reboot": 1,
@@ -594,7 +554,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -603,7 +562,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -620,7 +578,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -629,7 +586,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -645,7 +601,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -654,7 +609,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -670,7 +624,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -679,7 +632,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -695,7 +647,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -704,7 +655,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -720,7 +670,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -729,7 +678,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -745,7 +693,6 @@
         "start": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
@@ -754,7 +701,6 @@
         "end": {
             "rest": "^1$",
             "chassis": "^On$",
-            "operating_system": "^BootComplete$",
             "host": "^Running$",
             "os_ping": "^1$",
             "os_login": "^1$",
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"""