Add testcase for periodic telemetry report
Telemetry:Verify Basic Periodic Telemetry Report Creation
Changes:
- Added test case 'Verify Basic Periodic Telemetry Report Creation'
- Added report deletion after successful creation. Otherwise next
run will produce error
Change-Id: I81da259b0dedbdd790870a4af43450adfc588e5c
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/redfish/telemetry_service/test_telemetry_report.robot b/redfish/telemetry_service/test_telemetry_report.robot
index 061023e..e34887b 100644
--- a/redfish/telemetry_service/test_telemetry_report.robot
+++ b/redfish/telemetry_service/test_telemetry_report.robot
@@ -19,6 +19,8 @@
Verify Basic Telemetry Report Creation
[Documentation] Verify if a telemetry basic report is created.
[Tags] Verify_Basic_Telemetry_Report_Creation
+ [Teardown] Redfish.Delete ${metric_definition_base_uri}/${report_name}
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
${report_name}= Set Variable Test_basic_report_ambient_temp
${resp}= Redfish.Get Properties
@@ -37,6 +39,33 @@
... valid_status_codes=[${HTTP_OK}]
+Verify Basic Periodic Telemetry Report Creation
+ [Documentation] Verify if a telemetry basic periodic report is created.
+ [Tags] Verify_Basic_Periodic_Telemetry_Report_Creation
+ [Teardown] Redfish.Delete ${metric_definition_base_uri}/${report_name}
+ ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]
+
+ ${report_name}= Set Variable Test_basic_periodic_report_ambient_temp
+ ${resp}= Redfish.Get Properties
+ ... /redfish/v1/TelemetryService/MetricDefinitions/Ambient_0_Temp
+ ${body}= Catenate {"Id": "${report_name}",
+ ... "MetricReportDefinitionType": "Periodic",
+ ... "Name": "Report",
+ ... "ReportActions":["LogToMetricReportsCollection"],
+ ... "Metrics":[{"CollectionDuration": "PT30.000S",
+ ... "CollectionFunction": "Average","MetricProperties":${resp["MetricProperties"]}}],
+ ... "ReportUpdates": "AppendWrapsWhenFull",
+ ... "AppendLimit":10,
+ ... "Schedule": {"RecurrenceInterval": "PT5.000S"}}
+ ${body}= Replace String ${body} ' "
+ ${dict} Evaluate json.loads('''${body}''') json
+
+ Redfish.Post ${metric_definition_base_uri} body=&{dict}
+ ... valid_status_codes=[${HTTP_CREATED}]
+
+ ${resp}= Redfish.Get ${metric_definition_base_uri}/${report_name}
+ Should Be True '${resp.dict["MetricReportDefinitionType"]}' == 'Periodic'
+
*** Keywords ***
Suite Setup Execution