VOL-2610 Update alarm sim tests to voltha api v3;
Validate raised_ts and reported_ts;
Update to reflect dying gasp changes in patch 17479
Change-Id: I05dba9850545c72278408d2e312aecd08f99c2fc
diff --git a/libraries/utils.robot b/libraries/utils.robot
index e776ed5..9143fc1 100644
--- a/libraries/utils.robot
+++ b/libraries/utils.robot
@@ -355,13 +355,34 @@
Run Keyword If ${value_1} <= ${value_2}
... Fail The value ${value_1} is not larger than ${value_2}
+Should Be Larger Than Or Equal To
+ [Documentation] Verify that value_1 is >= value_2
+ [Arguments] ${value_1} ${value_2}
+ Run Keyword If ${value_1} < ${value_2}
+ ... Fail The value ${value_1} is not larger than or equal to ${value_2}
+
Should Be Float
[Documentation] Verify that value is a floating point number type
[Arguments] ${value}
${type} Evaluate type(${value}).__name__
Should Be Equal ${type} float
+Should Be Newer Than Or Equal To
+ [Documentation] Compare two RFC3339 dates
+ [Arguments] ${value_1} ${value_2}
+ ${unix_v1} Parse RFC3339 ${value_1}
+ ${unix_v2} Parse RFC3339 ${value_2}
+ Run Keyword If ${unix_v1} < ${unix_v2}
+ ... Fail The value ${value_1} is not newer than or equal to ${value_2}
+
Get Current Time
[Documentation] Return the current time in RFC3339 format
${output}= Run date -u +"%FT%T%:z"
[return] ${output}
+
+Parse RFC3339
+ [Documentation] Parse an RFC3339 timestamp
+ [Arguments] ${dateStr}
+ ${rc} ${output}= Run and Return Rc and Output date --date="${dateStr}" "+%s"
+ Should Be Equal As Numbers ${rc} 0
+ [return] ${output}