blob: 1a1490dc247f0b01633deb5a529f2f6eabb27ea9 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishing4d6c1da2016-07-15 05:51:22 -05002Documentation This testsuites tests the autorestart policy for
3... OpenBMC project
Chris Austenb29d2e82016-06-07 12:25:35 -05004
George Keishing4d6c1da2016-07-15 05:51:22 -05005Resource ../lib/resource.txt
6Resource ../lib/connection_client.robot
George Keishingd55a4be2016-08-26 03:28:17 -05007Resource ../lib/openbmc_ffdc.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05008
George Keishing4d6c1da2016-07-15 05:51:22 -05009Suite Setup Open Connection And Log In
10Suite Teardown Close All Connections
George Keishingd55a4be2016-08-26 03:28:17 -050011Test Teardown Log FFDC
Chris Austenb29d2e82016-06-07 12:25:35 -050012
13*** Test Cases ***
14Test OpenBMC Services Autorestart Policy
15 [Documentation] This testcases is for checking all the openbmc services
16 ... restart policy is set to active
17 @{services}= Create List obmc-mapper.service
18 ... obmc-rest.service
19 ... btbridged.service
20 ... host-ipmi-bt.service
21 ... host-ipmi-hw-example.service
22 ... host-ipmid.service
23 ... obmc-phosphor-chassisd.service
24 ... obmc-phosphor-event.service
25 ... obmc-phosphor-example-pydbus.service
26 ... obmc-phosphor-example-sdbus.service
27 ... obmc-phosphor-fand.service
28 ... obmc-phosphor-flashd.service
29 ... obmc-phosphor-policyd.service
30 ... obmc-phosphor-sensord.service
31 ... obmc-phosphor-sysd.service
32 ... rest-dbus.service
33 ... skeleton.service
34 : FOR ${SERVICE} IN @{services}
35 \ Check Service Autorestart ${SERVICE}
36
37Test Restart Policy for openbmc service
38 [Documentation] This testcase will kill the service and make sure it
39 ... does restart after that
40 ${MainPID} ${stderr} ${rc}= Execute new Command systemctl -p MainPID show skeleton.service| cut -d = -f2
41 Should Not Be Equal 0 ${MainPID}
42 ${stdout} ${stderr} ${rc}= Execute new Command kill -9 ${MainPID}
43 Sleep 30s Wait for service to restart properly
44 ${ActiveState} ${stderr} ${rc}= Execute new Command systemctl -p ActiveState show skeleton.service| cut -d = -f2
45 Should Be Equal active ${ActiveState}
46 ${MainPID} ${stderr} ${rc}= Execute new Command systemctl -p MainPID show skeleton.service| cut -d = -f2
47 Should Not Be Equal 0 ${MainPID}
48
49*** Keywords ***
50Check Service Autorestart
51 [arguments] ${servicename}
52 ${restart_policy} ${stderr} ${rc}= Execute new command systemctl -p Restart show ${servicename} | cut -d = -f2
53 Should Be Equal always ${restart_policy} restart policy is npt always for ${servicename}
54
55Execute new Command
56 [arguments] ${command}
57 ${stdout} ${stderr} ${rc}= Execute Command ${command} return_stderr=True return_rc=True
58 [Return] ${stdout} ${stderr} ${rc}