fixing play.py and data change counter
[integration/test.git] / csit / libraries / ChangeCounter.robot
index 64a281b4af7db94cf0b76f89386b45da6d80f1e8..2f02fc74d43d6f45d25737f332d133f17ed599e2 100644 (file)
@@ -31,7 +31,9 @@ Get_Change_Count
     ${response} =    RequestsLibrary.Get_Request    operational    data-change-counter:data-change-counter
     BuiltIn.Should_Be_Equal    ${response.status_code}    ${200}    Got status: ${response.status_code} and message: ${response.text}
     # TODO: The following line can be insecure. Should we use regexp instead?
-    ${count} =    BuiltIn.Evaluate    ${response.text}["data-change-counter"]["count"]
+    # TODO: beware of new releases (carbon ...) and mind if more counters are used
+    ${count} =    BuiltIn.Run Keyword If      "${ODL_STREAM}" in ["beryllium", "stable-lithium"]      BuiltIn.Evaluate    ${response.text}["data-change-counter"]["count"]
+    ...           ELSE     BuiltIn.Evaluate    ${response.text}["data-change-counter"]["counter"][0]["count"]
     [Return]    ${count}
 
 Reconfigure_Topology_Name