Tidied updated tests.
[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
26 *** Test Cases ***
27 Verifying TSDR Data Store For Netflow Entries
28     [Documentation]    Verify the Cassandra Data store to check if Netflow data is stored.
29     Copy TSDR tables    val_table=metriclog
30     ${metric_log}=    Verify the Metrics Syslog on Cassandra Client    grep DC=NETFLOW
31     Should Contain    ${metric_log}    srcAddr=${IP_2}
32     ${netflow}=    Create Temporary Key Info    srcAddr=${IP_2}    val_table=metriclog
33     Should Contain    ${netflow}    srcAddr=${IP_2}
34     Should Contain    ${netflow}    dstAddr=${IP_1}
35     Should Contain    ${netflow}    srcPort=${port}
36     Should Contain    ${netflow}    protocol=${prot}
37     Should Contain    ${netflow}    nextHop=${nexthop}
38     Should Contain    ${netflow}    engine_type
39     Should Contain    ${netflow}    engine_id
40     Should Contain    ${netflow}    input=${int2}
41     Should Contain    ${netflow}    output=${int1}
42     Should Contain    ${netflow}    sysUpTime
43     Should Contain    ${netflow}    flow_sequence
44     Should Contain    ${netflow}    unix_nsecs
45     Should Contain    ${netflow}    dPkts
46     Should Contain    ${netflow}    tcpFlags
47     Should Contain    ${netflow}    samplingInterval=0
48     Should Contain    ${netflow}    dstAS=0
49     Should Contain    ${netflow}    srcAS=0
50     Should Contain    ${netflow}    dstMask=0
51     Should Contain    ${netflow}    srcMask=0
52     ${netflow}=    Create Temporary Key Info    srcAddr=${IP_1}    val_table=metriclog
53     Should Contain    ${netflow}    srcAddr=${IP_1}
54     Should Contain    ${netflow}    dstAddr=${IP_2}
55     Should Contain    ${netflow}    dstPort=${port}
56     Should Contain    ${netflow}    protocol=${prot}
57     Should Contain    ${netflow}    nextHop=${nexthop}
58     Should Contain    ${netflow}    engine_type
59     Should Contain    ${netflow}    engine_id
60     Should Contain    ${netflow}    input=${int1}
61     Should Contain    ${netflow}    output=${int2}
62     Should Contain    ${netflow}    sysUpTime
63     Should Contain    ${netflow}    flow_sequence
64     Should Contain    ${netflow}    unix_nsecs
65     Should Contain    ${netflow}    dPkts
66     Should Contain    ${netflow}    tcpFlags
67     Should Contain    ${netflow}    samplingInterval=0
68     Should Contain    ${netflow}    dstAS=0
69     Should Contain    ${netflow}    srcAS=0
70     Should Contain    ${netflow}    dstMask=0
71     Should Contain    ${netflow}    srcMask=0
72
73 *** Keywords ***
74 Initialize Netflow
75     [Documentation]    Initialize Netflow setup and start collecting the netflow samples.
76     Verify Feature Is Installed    odl-tsdr-cassandra
77     Bringup Netflow
78     Initialize Cassandra Tables Metricval    val_table=metriclog
79     Wait Until Keyword Succeeds    36x    5 sec    Ping Pair Hosts Cassandra    \\d{2}