Add OPAL Terminate Immeadiate boot test

Changes:
   - Added new keyword for OPAL TI.
   - Changes in boot table JSON file.

Signed-off-by: Michael Shepos <shepos@us.ibm.com>
Change-Id: I4bb26f18f6ed6d1722ea79f4b95b69bbd27dd94b
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/data/boot_lists/All b/data/boot_lists/All
index 8a3acd3..a77d00d 100755
--- a/data/boot_lists/All
+++ b/data/boot_lists/All
@@ -66,3 +66,4 @@
 pflash
 Out of Band Code Update
 OS Code Update
+OPAL TI
diff --git a/data/boot_table.json b/data/boot_table.json
index b38a9fb..b8af1b3 100644
--- a/data/boot_table.json
+++ b/data/boot_table.json
@@ -791,5 +791,32 @@
         "method_type": "keyword",
         "method": "Redfish Power Operation  ForceRestart",
         "lib_file_path": "bmc_redfish_utils.robot"
+    },
+    # OPAL Terminate Immediate.
+    "OPAL TI": {
+        "start": {
+            "rest": "^1$",
+            "chassis": "^On$",
+            "boot_progress": "^FW Progress, Starting OS|OSStart$",
+            "operating_system": "^BootComplete$",
+            "host": "^Running$",
+            "os_ping": "^1$",
+            "os_login": "^1$",
+            "os_run_cmd": "^1$"
+        },
+        "end": {
+            "rest": "^1$",
+            "chassis": "^On$",
+            "boot_progress": "^FW Progress, Starting OS|OSStart$",
+            "operating_system": "^BootComplete$",
+            "host": "^Running$",
+            "os_ping": "^1$",
+            "os_login": "^1$",
+            "os_run_cmd": "^1$"
+        },
+        "bmc_reboot": 0,
+        "method_type": "keyword",
+        "method": "Inject OPAL TI",
+        "lib_file_path": "open_power_utils.robot"
     }
 }
diff --git a/lib/open_power_utils.robot b/lib/open_power_utils.robot
index d936379..5274534 100644
--- a/lib/open_power_utils.robot
+++ b/lib/open_power_utils.robot
@@ -3,6 +3,7 @@
 
 Variables      ../data/variables.py
 Resource       ../lib/utils.robot
+Resource       ../lib/connection_client.robot
 
 *** Keywords ***
 
@@ -169,3 +170,28 @@
     ${resp}=  Read Properties  ${OPENPOWER_CONTROL}gard/enumerate
     Log Dictionary  ${resp}
     Should Be Empty  ${resp}  msg=Found gard records.
+
+
+Inject OPAL TI
+    [Documentation]  OPAL terminate immediate procedure.
+    [Arguments]      ${stable_branch}=master
+    ...              ${repo_dir_path}=${EXECDIR}/repository
+    ...              ${repo_github_url}=https://github.com/open-power/op-test
+
+    # Description of arguments:
+    # stable_branch    Git branch to clone. (default: master)
+    # repo_dir_path    Directory path for repo tool (e.g. "op-test").
+    # repo_github_url  Github URL link (e.g. "https://github.com/open-power/op-test").
+
+    ${value}=  Generate Random String  4  [NUMBERS]
+
+    ${cmd_buf}=  Catenate  git clone --branch ${stable_branch} ${repo_github_url} ${repo_dir_path}/${value}
+    Shell Cmd  ${cmd_buf}
+
+    Open Connection for SCP
+    scp.Put File  ${repo_dir_path}/${value}/test_binaries/deadbeef  /tmp
+    Pdbg  -a putmem 0x300000f8 < /tmp/deadbeef
+
+    # Clean up the repo once done.
+    ${cmd_buf}=  Catenate  rm -rf ${repo_dir_path}${/}${value}
+    Shell Cmd  ${cmd_buf}