New watchdog interface util keyword

Fixes:
   - Replace old org method with new REST interface
   - Remove poweroff test use case as the watchdog interface is
     only applicable when powered on

Resolves  openbmc/openbmc-test-automation#707

Change-Id: I1dec84029d66c0e9fc4fd6ee61cc8e129765d639
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index ce51f2e..517322a 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -165,25 +165,8 @@
 
     # Set the auto reboot policy.
     Set Auto Reboot  yes
-
-    SSHLibrary.Open connection  ${openbmc_host}
-    Login  ${openbmc_username}  ${openbmc_password}
-
     # Set the watchdog timer.  Note: 5000 = milliseconds which is 5 seconds.
-    ${cmd_buf}=  Catenate  /usr/sbin/mapper call /org/openbmc/watchdog/host0
-    ...  org.openbmc.Watchdog set i 5000
-    ${output}  ${stderr}  ${rc}=  Execute Command  ${cmd_buf}
-    ...  return_stderr=True  return_rc=True
-    Should Be Empty  ${stderr}
-    Should be equal  ${rc}  ${0}
-
-    # Start the watchdog.
-    ${cmd_buf}=  Catenate  /usr/sbin/mapper call /org/openbmc/watchdog/host0
-    ...  org.openbmc.Watchdog start
-    ${output}  ${stderr}  ${rc}=  Execute Command  ${cmd_buf}
-    ...  return_stderr=True  return_rc=True
-    Should Be Empty  ${stderr}
-    Should be equal  ${rc}  ${0}
+    Trigger Host Watchdog Error  5000
 
 Trigger Warm Reset
     log to console    "Triggering warm reset"
@@ -816,7 +799,7 @@
     ...  Log  **Warning** BMC core dump files exist  level=WARN
 
 Trigger Host Watchdog Error
-    [Documentation]  Inject host watchdog error using BMC.
+    [Documentation]  Inject host watchdog timeout error via REST.
     [Arguments]  ${milliseconds}=1000  ${sleep_time}=5s
     # Description of argument(s):
     # milliseconds  The time watchdog timer value in milliseconds (e.g. 1000 =
@@ -824,10 +807,12 @@
     # sleep_time    Time delay for host watchdog error to get injected.
     #               Default is 5 seconds.
 
-    Execute Command On BMC
-    ...  /usr/sbin/mapper call /org/openbmc/watchdog/host0 org.openbmc.Watchdog set i ${milliseconds}
-    Execute Command On BMC
-    ...  /usr/sbin/mapper call /org/openbmc/watchdog/host0 org.openbmc.Watchdog start
+    ${data}=  Create Dictionary  data=${True}
+    Write Attribute  /xyz/openbmc_project/watchdog/host0  Enabled  data=${data}
+
+    ${data}=  Create Dictionary  data=${milliseconds}
+    Write Attribute  /xyz/openbmc_project/watchdog/host0  TimeRemaining  data=${data}
+
     Sleep  ${sleep_time}
 
 Login To OS Host