1*** Settings ***
2Documentation  Network diagnostic tool report and logs to console
3...            for information. For more information 'man mtr'.
4
5Library       OperatingSystem
6Library       ../lib/utilities.py
7Resource      ../lib/utils.robot
8Test Setup    Check If Tool Exist
9
10Test Tags    Network_Diagnostic_Report
11
12*** Test Cases ***
13
14Check Network Latency
15    [Documentation]  Check network connection between host MTR and BMC host.
16    [Tags]  Check_Network_Latency
17
18    Ping Host  ${OPENBMC_HOST}
19    Repeat Keyword  3 times  Log Network Loss
20
21*** Keywords ***
22
23Log Network Loss
24    [Documentation]  Log Network packets loss percentage from MTR report.
25    ${report}=  Get MTR Row  ${OPENBMC_HOST}
26    Log To Console  \n Network packets loss: ${report['loss']} percent
27    Sleep  3s
28
29Check If Tool Exist
30    [Documentation]  Check if mtr tool exists.
31
32    ${bin_path}=  Run  which mtr
33    Should Contain  ${bin_path}  mtr  msg=mtr tool is not installed.
34