[VOL-4902] Delivery OMCI counter statistics

Precondition is release of voltctl at least 1.8.1!!!

Change-Id: Ic1ee9f2cacb8fb8b00694208e6eb1531b18568cb
diff --git a/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot b/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
index f021982..3e90bd0 100755
--- a/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
+++ b/tests/openonu-go-adapter/Voltha_ONUTemplateTests.robot
@@ -270,6 +270,26 @@
     Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    3s
     ...    Verify MIB Template Data Available    ${INFRA_NAMESPACE}
     ${MibTemplateDataBaseline}=    Get ONU MIB Template Data    ${INFRA_NAMESPACE}
+    # get ONU OMCI counter statistics
+    ${onu_device_id}=    Get Device ID From SN    ${src['onu']}
+    ${rc}    ${OMCI_counter_dict}=    Get OMCI counter statistics dictionary   ${onu_device_id}
+    Run Keyword If    ${rc} != 0    FAIL    Could not get baseline ONU OMCI counter statistic of ONU ${src['onu']}!
+    ${BaseTxArFrames}=    Get From Dictionary    ${OMCI_counter_dict}     BaseTxArFrames
+    ${BaseRxAkFrames}=    Get From Dictionary    ${OMCI_counter_dict}     BaseRxAkFrames
+    Should Be Equal As Integers   ${BaseTxArFrames}   ${BaseRxAkFrames}   Number of baseline Rx and Tx frames do not match!
+    # some additional checks
+    ${ExtRxAkFrames}=           Get From Dictionary   ${OMCI_counter_dict}   ExtRxAkFrames
+    ${ExtRxNoAkFrames}=         Get From Dictionary   ${OMCI_counter_dict}   ExtRxNoAkFrames
+    ${ExtTxArFrames}=           Get From Dictionary   ${OMCI_counter_dict}   ExtTxArFrames
+    ${ExtTxNoArFrames}=         Get From Dictionary   ${OMCI_counter_dict}   ExtTxNoArFrames
+    ${TxOmciCounterRetries}=    Get From Dictionary   ${OMCI_counter_dict}   TxOmciCounterRetries
+    ${TxOmciCounterTimeouts}=   Get From Dictionary   ${OMCI_counter_dict}   TxOmciCounterTimeouts
+    Should Be Equal   0   ${ExtRxAkFrames}          ExtRxAkFrames found in baseline OMCI!
+    Should Be Equal   0   ${ExtRxNoAkFrames}        ExtRxNoAkFrames found in baseline OMCI!
+    Should Be Equal   0   ${ExtTxArFrames}          ExtTxArFrames found in baseline OMCI!
+    Should Be Equal   0   ${ExtTxNoArFrames}        ExtTxNoArFrames found in baseline OMCI!
+    Should Be Equal   0   ${TxOmciCounterRetries}   TxOmciCounterRetries found in baseline OMCI!
+    Should Be Equal   0   ${TxOmciCounterTimeouts}  TxOmciCounterTimeouts found in baseline OMCI!
     Delete All Devices and Verify
     Delete MIB Template Data    ${INFRA_NAMESPACE}
     # Restart BBSIM with OMCI Extended Message
@@ -307,6 +327,23 @@
     ${MibTemplateDataExtended}=    Remove String Using Regexp    ${MibTemplateDataExtended}    ${remove_regexp}
     # end of handling for VOL-4721
     Should Be Equal As Strings    ${MibTemplateDataBaseline}    ${MibTemplateDataExtended}    MIB Templates not equal!
+    # get ONU OMCI counter statistics
+    ${onu_device_id}=    Get Device ID From SN    ${src['onu']}
+    ${rc}    ${OMCI_counter_dict}=    Get OMCI counter statistics dictionary   ${onu_device_id}
+    Run Keyword If    ${rc} != 0    FAIL    Could not get extended ONU OMCI counter statistic of ONU ${src['onu']}!
+    ${ExtTxArFrames}=    Get From Dictionary    ${OMCI_counter_dict}    ExtTxArFrames
+    ${ExtRxAkFrames}=    Get From Dictionary    ${OMCI_counter_dict}    ExtRxAkFrames
+    Should Be Equal As Integers   ${ExtTxArFrames}   ${ExtRxAkFrames}   Number of extended Rx and Tx frames do not match!
+    # check baseline and extended OMCI frames counter
+    ${TxArFrames_compare}=    Evaluate    ${BaseTxArFrames}*0.05 > ${ExtTxArFrames}
+    Should Be True    ${TxArFrames_compare}   Comparison of TxArFrames failed (${BaseTxArFrames}:${ExtTxArFrames})!
+    ${RxAkFrames_compare}=    Evaluate    ${BaseRxAkFrames}*0.05 > ${ExtRxAkFrames}
+    Should Be True    ${RxAkFrames_compare}   Comparison of RxAkFrames failed (${BaseRxAkFrames}:${ExtRxAkFrames})!
+    # some additional checks
+    ${TxOmciCounterRetries}=    Get From Dictionary   ${OMCI_counter_dict}   TxOmciCounterRetries
+    ${TxOmciCounterTimeouts}=   Get From Dictionary   ${OMCI_counter_dict}   TxOmciCounterTimeouts
+    Should Be Equal   0   ${TxOmciCounterRetries}   TxOmciCounterRetries found in extended OMCI!
+    Should Be Equal   0   ${TxOmciCounterTimeouts}  TxOmciCounterTimeouts found in extended OMCI!
     # Restart BBSIM with OMCI Message Version read at begin of test
     ${extra_helm_flags}=    Catenate
     ...    --set onu=2,pon=2,controlledActivation=only-onu,injectOmciUnknownAttributes=true,injectOmciUnknownMe=true