Install opal prd tool on OS

Resolves  openbmc/openbmc-test-automation#613

Change-Id: Ibde07e5ae39bbf2e4c2fa37a13ddfe24d4811d8b
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/syslib/utils_install.robot b/syslib/utils_install.robot
index bdf6e5c..a5ac302 100755
--- a/syslib/utils_install.robot
+++ b/syslib/utils_install.robot
@@ -4,6 +4,7 @@
 
 
 Resource     utils_os.robot
+Resource     ../lib/boot_utils.robot
 
 ***Keywords***
 
@@ -11,7 +12,7 @@
     [Documentation]  Prepare OS for HTX tool installation.
 
     Boot To OS
-    ${status}=  Run Keyword And Return Status  HTX Tool Exist
+    ${status}=  Run Keyword And Return Status  Tool Exist  htxcmdline
 
     Return From Keyword If  '${status}' == 'True'
     ...  HTX tool already installed.
@@ -27,6 +28,22 @@
     Execute Command On OS  sudo apt-get -y install git
 
 
+Prep OS For OPAL PRD Installation
+    [Documentation]  Prepare OS for OPAL PRD tool installation.
+
+    Boot To OS
+    ${status}=  Run Keyword And Return Status  Tool Exist  opal-gard
+
+    Return From Keyword If  '${status}' == 'True'  ${False}
+
+
+    # Downloads the package lists from the repositories and "updates"
+    # them to get information on the newest versions of packages and
+    # their dependencies.
+    Log To Console  \n Update package list.
+    Execute Command On OS  sudo apt-get update
+
+
 Setup HTX On OS
     [Documentation]  Download and install HTX exerciser tool from github.
 
@@ -52,3 +69,19 @@
     Log To Console  \n Installed compiled HTX binaries.
     Execute Command On OS  sudo make install
 
+
+Setup Opal Prd On OS
+    [Documentation]  Download and install opal prd tool.
+
+    # Download and install PRD packages.
+    Execute Command  sudo apt-get install opal-prd
+    Execute Command  sudo apt-get install opal-utils
+
+    # Reboot OS to activate installation.
+    Host Reboot
+
+    # Login to OS and verify opal prd installation working.
+    Login To OS
+    ${out}=  Execute Command  opal-gard list
+    Should Contain  ${out}  No GARD entries to display
+
diff --git a/syslib/utils_os.robot b/syslib/utils_os.robot
index 71b57fe..ffccdee 100755
--- a/syslib/utils_os.robot
+++ b/syslib/utils_os.robot
@@ -36,12 +36,15 @@
     Login  ${os_username}  ${os_password}
 
 
-HTX Tool Exist
-    [Documentation]  Check whether HTX exerciser is installed on OS.
+Tool Exist
+    [Documentation]  Check whether given tool is installed on OS.
+    [Arguments]  ${tool_name}
+    # Description of argument(s):
+    # tool_name   Tool name whose existence is to be checked.
     Login To OS
-    ${output}=  Execute Command On OS  which htxcmdline
-    Should Contain  ${output}  htxcmdline
-    ...  msg=Please install HTX exerciser.
+    ${output}=  Execute Command On OS  which ${tool_name}
+    Should Contain  ${output}  ${tool_name}
+    ...  msg=Please install ${tool_name} tool.
 
 
 Boot To OS
diff --git a/systest/htx_hardbootme_test.robot b/systest/htx_hardbootme_test.robot
index 20d0f09..ab8fc17 100644
--- a/systest/htx_hardbootme_test.robot
+++ b/systest/htx_hardbootme_test.robot
@@ -129,7 +129,7 @@
     # 2. Power on
 
     Boot To OS
-    HTX Tool Exist
+    Tool Exist  htxcmdline
 
     # Shutdown if HTX is running.
     ${status}=  Run Keyword And Return Status  Is HTX Running