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