Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 2 | Documentation This testsuites tests the autorestart policy for |
| 3 | ... OpenBMC project |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 5 | Resource ../lib/resource.txt |
| 6 | Resource ../lib/connection_client.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 7 | Resource ../lib/openbmc_ffdc.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 8 | |
George Keishing | 4d6c1da | 2016-07-15 05:51:22 -0500 | [diff] [blame] | 9 | Suite Setup Open Connection And Log In |
| 10 | Suite Teardown Close All Connections |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 11 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 12 | |
| 13 | *** Test Cases *** |
| 14 | Test OpenBMC Services Autorestart Policy |
| 15 | [Documentation] This testcases is for checking all the openbmc services |
| 16 | ... restart policy is set to active |
George Keishing | 7949e47 | 2016-09-22 11:35:05 -0500 | [diff] [blame] | 17 | ... Disabling this test as use case is not well define and |
| 18 | ... developement point of view this may keep changing. So |
| 19 | ... untill then, this remains commented piece of test. |
| 20 | [Tags] Test_OpenBMC_Services_Autorestart_Policy |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 21 | @{services}= Create List btbridged.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 22 | ... host-ipmid.service |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 23 | ... inarp.service |
| 24 | ... network.service |
| 25 | ... network-update-dns.service |
| 26 | ... obmc-console.service |
| 27 | ... obmc-hwmon.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 28 | ... obmc-phosphor-chassisd.service |
| 29 | ... obmc-phosphor-event.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 30 | ... obmc-phosphor-fand.service |
| 31 | ... obmc-phosphor-flashd.service |
| 32 | ... obmc-phosphor-policyd.service |
| 33 | ... obmc-phosphor-sensord.service |
| 34 | ... obmc-phosphor-sysd.service |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 35 | ... obmc-phosphor-user.service |
| 36 | ... org.openbmc.buttons.Power.service |
| 37 | ... org.openbmc.buttons.reset.service |
| 38 | ... org.openbmc.control.BmcFlash.service |
| 39 | ... org.openbmc.control.Bmc.service |
| 40 | ... org.openbmc.control.Chassis.service |
| 41 | ... org.openbmc.control.Checkstop.service |
| 42 | ... org.openbmc.control.Fans.service |
| 43 | ... org.openbmc.control.Flash.service |
| 44 | ... org.openbmc.control.Host.service |
| 45 | ... org.openbmc.control.led.service |
| 46 | ... org.openbmc.control.Power.service |
| 47 | ... org.openbmc.examples.PythonService.service |
| 48 | ... org.openbmc.examples.SDBusService.service |
| 49 | ... org.openbmc.Inventory.service |
| 50 | ... org.openbmc.managers.Download.service |
| 51 | ... org.openbmc.managers.System.service |
| 52 | ... org.openbmc.ObjectMapper.service |
| 53 | ... org.openbmc.Sensors.service |
| 54 | ... org.openbmc.watchdog.Host.service |
| 55 | ... phosphor-rest.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 56 | ... rest-dbus.service |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 57 | ... settings.service |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 58 | : FOR ${SERVICE} IN @{services} |
| 59 | \ Check Service Autorestart ${SERVICE} |
| 60 | |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 61 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 62 | Test Restart Policy for openbmc service |
| 63 | [Documentation] This testcase will kill the service and make sure it |
| 64 | ... does restart after that |
George Keishing | 524cb04 | 2016-10-13 10:20:17 -0500 | [diff] [blame] | 65 | [Tags] Test_Restart_Policy_for_openbmc_service |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 66 | |
| 67 | ${MainPID}= Execute Restart Policy Command |
George Keishing | 1e94be4 | 2016-10-03 04:57:17 -0500 | [diff] [blame] | 68 | ... systemctl -p MainPID show phosphor-settings.service| cut -d = -f2 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 69 | Should Not Be Equal 0 ${MainPID} |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 70 | |
| 71 | Execute Restart Policy Command kill -9 ${MainPID} |
| 72 | Sleep 30s reason=Wait for service to restart properly |
| 73 | |
| 74 | ${ActiveState}= Execute Restart Policy Command |
George Keishing | 1e94be4 | 2016-10-03 04:57:17 -0500 | [diff] [blame] | 75 | ... systemctl -p ActiveState show phosphor-settings.service| cut -d = -f2 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 76 | Should Be Equal active ${ActiveState} |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 77 | |
| 78 | ${MainPID}= Execute Restart Policy Command |
George Keishing | 1e94be4 | 2016-10-03 04:57:17 -0500 | [diff] [blame] | 79 | ... systemctl -p MainPID show phosphor-settings.service| cut -d = -f2 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 80 | Should Not Be Equal 0 ${MainPID} |
| 81 | |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 82 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 83 | *** Keywords *** |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 84 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 85 | Check Service Autorestart |
| 86 | [arguments] ${servicename} |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 87 | ${restart_policy}= |
| 88 | ... Execute Restart Policy Command |
| 89 | ... systemctl -p Restart show ${servicename} | cut -d = -f2 |
| 90 | Should Be Equal always ${restart_policy} |
| 91 | ... msg=restart policy is not always for ${servicename} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 92 | |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 93 | |
| 94 | Execute Restart Policy Command |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 95 | [arguments] ${command} |
George Keishing | c4f06d73 | 2016-09-02 07:06:53 -0500 | [diff] [blame] | 96 | ${stdout} ${stderr} = Execute Command ${command} return_stderr=True |
| 97 | Should Be Empty ${stderr} |
| 98 | [Return] ${stdout} |