2eff1d23bf4138f1bfc195c301c2bf694705c05a
[integration/test.git] / csit / suites / tsdr / Cassandra / 070_Netflow.robot
1 *** Settings ***
2 Documentation     Test suite for Cassandra DataStore Netflow Stats Verification
3 Suite Setup       Initialize Netflow
4 Suite Teardown    Stop Tsdr Suite
5 Library           SSHLibrary
6 Library           Collections
7 Library           String
8 Library           ../../../libraries/Common.py
9 Resource          ../../../libraries/KarafKeywords.robot
10 Resource          ../../../libraries/TsdrUtils.robot
11 Variables         ../../../variables/Variables.py
12
13 *** Variables ***
14 ${IP_1}    10.0.0.1
15 ${IP_2}    10.0.0.2
16 ${NODE_ID}    127.0.0.1
17 ${engine_type}    11
18 ${engine_id}    11
19 ${nexthop}    0
20 ${port}    0
21 ${prot}    1
22 ${int1}    1
23 ${int2}    2
24 ${version}    5
25 *** Test Cases ***
26
27
28
29 Verifying TSDR Data Store For Netflow Entries
30     [Documentation]    Verify the Cassandra Data store to check if Netflow data is stored.
31     Copy TSDR tables     val_table=metriclog
32     ${metric_log}=    Verify the Metrics Syslog on Cassandra Client    grep DC=NETFLOW
33     Should Contain    ${metric_log}    srcAddr=${IP_2}
34     ${netflow}=    Create Temporary Key Info    srcAddr=${IP_2}    val_table=metriclog
35     Should Contain    ${netflow}    srcAddr=${IP_2}
36     Should Contain    ${netflow}    dstAddr=${IP_1}
37     Should Contain    ${netflow}    srcPort=${port}
38     Should Contain    ${netflow}    protocol=${prot}
39     Should Contain    ${netflow}    nextHop=${nexthop}
40     Should Contain    ${netflow}    engine_type
41     Should Contain    ${netflow}    engine_id
42     Should Contain    ${netflow}    input=${int2}
43     Should Contain    ${netflow}    output=${int1}
44     Should Contain    ${netflow}    sysUpTime
45     Should Contain    ${netflow}    flow_sequence
46     Should Contain    ${netflow}    unix_nsecs
47     Should Contain    ${netflow}    dPkts
48     Should Contain    ${netflow}    tcpFlags
49     Should Contain    ${netflow}    samplingInterval=0
50     Should Contain    ${netflow}    dstAS=0
51     Should Contain    ${netflow}    srcAS=0
52     Should Contain    ${netflow}    dstMask=0
53     Should Contain    ${netflow}    srcMask=0
54
55     ${netflow}=    Create Temporary Key Info    srcAddr=${IP_1}    val_table=metriclog
56     Should Contain    ${netflow}    srcAddr=${IP_1}
57     Should Contain    ${netflow}    dstAddr=${IP_2}
58     Should Contain    ${netflow}    dstPort=${port}
59     Should Contain    ${netflow}    protocol=${prot}
60     Should Contain    ${netflow}    nextHop=${nexthop}
61     Should Contain    ${netflow}    engine_type
62     Should Contain    ${netflow}    engine_id
63     Should Contain    ${netflow}    input=${int1}
64     Should Contain    ${netflow}    output=${int2}
65     Should Contain    ${netflow}    sysUpTime
66     Should Contain    ${netflow}    flow_sequence
67     Should Contain    ${netflow}    unix_nsecs
68     Should Contain    ${netflow}    dPkts
69     Should Contain    ${netflow}    tcpFlags
70     Should Contain    ${netflow}    samplingInterval=0
71     Should Contain    ${netflow}    dstAS=0
72     Should Contain    ${netflow}    srcAS=0
73     Should Contain    ${netflow}    dstMask=0
74     Should Contain    ${netflow}    srcMask=0
75
76
77 *** Keywords ***
78 Initialize Netflow
79     [Documentation]    Initialize Netflow setup and start collecting the netflow samples.
80     Verify Feature Is Installed    odl-tsdr-cassandra
81     Bringup Netflow
82     Initialize Cassandra Tables Metricval    val_table=metriclog
83     Wait Until Keyword Succeeds    36x    5 sec    Ping Pair Hosts Cassandra    \\d{2}
84
85
86
87