Event Service restart fix
The change addresses:
- updating the Event service name
- Add command execution failure check
- update documentation
- Add tags by test case name
Resolves openbmc/openbmc-test-automation#234
Change-Id: Ie69581d4ada775043cff7cbf735d801979768bc9
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tests/test_eventlog.robot b/tests/test_eventlog.robot
index 7ec4d1b..89f7d04 100644
--- a/tests/test_eventlog.robot
+++ b/tests/test_eventlog.robot
@@ -101,29 +101,41 @@
${resp}= openbmc get request ${event2}
should be equal as strings ${resp.status_code} ${HTTP_NOT_FOUND}
-restarting event process retains logs
- [Documentation] This is to test events are in place even after the
- ... event service is restarted.
- [Tags] CI
+Test Event Logs Persistency
+ [Documentation] Create event logs, restart the event service
+ ... and verify if logs persist.
+ [Tags] CI Test_Event_Logs_Persistency
${resp}= openbmc get request ${EVENT_RECORD}
${json}= to json ${resp.content}
${logs_pre_restart}= set variable ${json['data']}
- ${uptime}= Execute Command systemctl restart obmc-phosphor-event.service
+ ${output} ${stderr} ${rc}= Execute Command
+ ... systemctl restart org.openbmc.records.events.service
+ ... return_stderr=True return_rc=True
+ Should Be Empty ${stderr}
+ Should Be Equal ${rc} ${0}
Sleep ${10}
${resp}= openbmc get request ${EVENT_RECORD}
${json}= to json ${resp.content}
${logs_post_restart}= set variable ${json['data']}
- List Should Contain Sub List ${logs_post_restart} ${logs_pre_restart} msg=Failed to find all the eventlogs which are present before restart of event service
+ List Should Contain Sub List
+ ... ${logs_post_restart} ${logs_pre_restart}
+ ... msg=The event logs are mismatched.
-deleting log after obmc-phosphor-event.service restart
- [Documentation] This is to test event can be deleted created prior to
- ... event service is restarted.
- [Tags] CI
- ${uri}= create a test log
- ${uptime}= Execute Command systemctl restart obmc-phosphor-event.service
+Test Event Deletion Post Restarting Event Manager
+ [Documentation] Create event log, restart event service and
+ ... delete the event created earlier.
+ [Tags] CI Test_Event_Deletion Post_Restarting_Event_Manager
+
+ ${uri}= create a test log
+
+ ${output} ${stderr} ${rc}= Execute Command
+ ... systemctl restart org.openbmc.records.events.service
+ ... return_stderr=True return_rc=True
+ Should Be Empty ${stderr}
+ Should Be Equal ${rc} ${0}
Sleep ${10}
${deluri}= catenate SEPARATOR= ${uri} /action/delete
@@ -134,16 +146,24 @@
[Documentation] This is for testing event creation after the
... event service is restarted.
[Tags] CI
- ${uptime}= Execute Command systemctl restart obmc-phosphor-event.service
+ ${output} ${stderr} ${rc}= Execute Command
+ ... systemctl restart org.openbmc.records.events.service
+ ... return_stderr=True return_rc=True
+ Should Be Empty ${stderr}
+ Should Be Equal ${rc} ${0}
Sleep ${10}
create a test log
deleting new log after obmc-phosphor-event.service restart
- [Documentation] This testcase is for testing deleted newly created event
- ... after event service is restarted.
+ [Documentation] This testcase is for testing deleted newly created event
+ ... after event service is restarted.
[Tags] CI
- ${uptime}= Execute Command systemctl restart obmc-phosphor-event.service
+ ${output} ${stderr} ${rc}= Execute Command
+ ... systemctl restart org.openbmc.records.events.service
+ ... return_stderr=True return_rc=True
+ Should Be Empty ${stderr}
+ Should Be Equal ${rc} ${0}
Sleep ${10}
${uri}= create a test log
@@ -194,7 +214,7 @@
${resp}= openbmc get request ${EVENT_RECORD}
${json}= to json ${resp.content}
Should Be Empty ${json['data']}
- ${resp} = openbmc post request ${EVENT_RECORD}action/clear data=${NIL}
+ ${resp}= openbmc post request ${EVENT_RECORD}action/clear data=${NIL}
should be equal as strings ${resp.status_code} ${HTTP_OK}