Update REST services list for restart policy check

This address the following :
   - Update the current policy list with Restart=always
   - Use settings.service to test auto restart functionality

Resolves openbmc/openbmc-test-automation#86

Change-Id: I7269ef114ff19960b77eeb5eb4cbbd1a16aa23e3
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tests/test_openbmc_service_restart_policy.robot b/tests/test_openbmc_service_restart_policy.robot
index 1a1490d..9c41471 100644
--- a/tests/test_openbmc_service_restart_policy.robot
+++ b/tests/test_openbmc_service_restart_policy.robot
@@ -14,45 +14,80 @@
 Test OpenBMC Services Autorestart Policy
     [Documentation]     This testcases is for checking all the openbmc services
     ...                 restart policy is set to active
-    @{services}=    Create List     obmc-mapper.service
-    ...                             obmc-rest.service
-    ...                             btbridged.service
-    ...                             host-ipmi-bt.service
-    ...                             host-ipmi-hw-example.service
+    @{services}=    Create List     btbridged.service
     ...                             host-ipmid.service
+    ...                             inarp.service
+    ...                             network.service
+    ...                             network-update-dns.service
+    ...                             obmc-console.service
+    ...                             obmc-hwmon.service
     ...                             obmc-phosphor-chassisd.service
     ...                             obmc-phosphor-event.service
-    ...                             obmc-phosphor-example-pydbus.service
-    ...                             obmc-phosphor-example-sdbus.service
     ...                             obmc-phosphor-fand.service
     ...                             obmc-phosphor-flashd.service
     ...                             obmc-phosphor-policyd.service
     ...                             obmc-phosphor-sensord.service
     ...                             obmc-phosphor-sysd.service
+    ...                             obmc-phosphor-user.service
+    ...                             org.openbmc.buttons.Power.service
+    ...                             org.openbmc.buttons.reset.service
+    ...                             org.openbmc.control.BmcFlash.service
+    ...                             org.openbmc.control.Bmc.service
+    ...                             org.openbmc.control.Chassis.service
+    ...                             org.openbmc.control.Checkstop.service
+    ...                             org.openbmc.control.Fans.service
+    ...                             org.openbmc.control.Flash.service
+    ...                             org.openbmc.control.Host.service
+    ...                             org.openbmc.control.led.service
+    ...                             org.openbmc.control.Power.service
+    ...                             org.openbmc.examples.PythonService.service
+    ...                             org.openbmc.examples.SDBusService.service
+    ...                             org.openbmc.Inventory.service
+    ...                             org.openbmc.managers.Download.service
+    ...                             org.openbmc.managers.System.service
+    ...                             org.openbmc.ObjectMapper.service
+    ...                             org.openbmc.Sensors.service
+    ...                             org.openbmc.watchdog.Host.service
+    ...                             phosphor-rest.service
     ...                             rest-dbus.service
-    ...                             skeleton.service
+    ...                             settings.service
     : FOR    ${SERVICE}    IN    @{services}
     \    Check Service Autorestart    ${SERVICE}
 
+
 Test Restart Policy for openbmc service
     [Documentation]     This testcase will kill the service and make sure it
     ...                 does restart after that
-    ${MainPID}   ${stderr}   ${rc}=  Execute new Command    systemctl -p MainPID show skeleton.service| cut -d = -f2
+
+    ${MainPID}=   Execute Restart Policy Command
+    ...   systemctl -p MainPID show settings.service| cut -d = -f2
     Should Not Be Equal     0   ${MainPID}
-    ${stdout}   ${stderr}   ${rc}=  Execute new Command     kill -9 ${MainPID}
-    Sleep   30s     Wait for service to restart properly
-    ${ActiveState}   ${stderr}   ${rc}=  Execute new Command    systemctl -p ActiveState show skeleton.service| cut -d = -f2
+
+    Execute Restart Policy Command    kill -9 ${MainPID}
+    Sleep   30s   reason=Wait for service to restart properly
+
+    ${ActiveState}=   Execute Restart Policy Command
+    ...   systemctl -p ActiveState show settings.service| cut -d = -f2
     Should Be Equal     active   ${ActiveState}
-    ${MainPID}   ${stderr}   ${rc}=  Execute new Command    systemctl -p MainPID show skeleton.service| cut -d = -f2
+
+    ${MainPID}=   Execute Restart Policy Command
+    ...  systemctl -p MainPID show settings.service| cut -d = -f2
     Should Not Be Equal     0   ${MainPID}
 
+
 *** Keywords ***
+
 Check Service Autorestart
     [arguments]    ${servicename}
-    ${restart_policy}   ${stderr}   ${rc}=  Execute new command     systemctl -p Restart show ${servicename} | cut -d = -f2
-    Should Be Equal     always   ${restart_policy}   restart policy is npt always for ${servicename}
+    ${restart_policy}=
+    ...  Execute Restart Policy Command
+    ...  systemctl -p Restart show ${servicename} | cut -d = -f2
+    Should Be Equal     always   ${restart_policy}
+    ...  msg=restart policy is not always for ${servicename}
 
-Execute new Command
+
+Execute Restart Policy Command
     [arguments]    ${command}
-    ${stdout}   ${stderr}   ${rc}=  Execute Command    ${command}    return_stderr=True     return_rc=True
-    [Return]    ${stdout}   ${stderr}   ${rc}
+    ${stdout}   ${stderr} =   Execute Command   ${command}   return_stderr=True
+    Should Be Empty    ${stderr}
+    [Return]    ${stdout}