39b57a9b1f04a12453be8d2fc0e0f54c2c7a7366
[integration/test.git] / csit / suites / tsdr / HBase / 070_Netflow.robot
1 *** Settings ***
2 Documentation     Test suite for Hbase 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 ${protocol}    1
22 ${int1}    1
23 ${int2}    2
24 ${version}    5
25 *** Test Cases ***
26
27
28 Verification of Full Record Text for Netflow Dumps
29     [Documentation]    Verify the Netflow Record Text Hbase client
30     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1' , LIMIT => 10, FILTER => "ValueFilter( =, 'regexstring:srcAddr=${IP_2}' )" }
31     Should Contain    ${out}    srcAddr=${IP_2}
32     Should Contain    ${out}    dstAddr=${IP_1}
33     Should Contain    ${out}    srcPort=${port}
34     Should Contain    ${out}    protocol=${protocol}
35     Should Contain    ${out}    nextHop=${nexthop}
36     Should Contain    ${out}    engine_type
37     Should Contain    ${out}    engine_id
38     Should Contain    ${out}    input=${int2}
39     Should Contain    ${out}    output=${int1}
40
41     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1' , LIMIT => 10, FILTER => "ValueFilter( =, 'regexstring:srcAddr=${IP_1}' )" }
42     Should Contain    ${out}    srcAddr=${IP_1}
43     Should Contain    ${out}    dstAddr=${IP_2}
44     Should Contain    ${out}    dstPort=${port}
45     Should Contain    ${out}    protocol=${protocol}
46     Should Contain    ${out}    nextHop=${nexthop}
47     Should Contain    ${out}    engine_type
48     Should Contain    ${out}    engine_id
49     Should Contain    ${out}    input=${int1}
50     Should Contain    ${out}    output=${int2}
51
52     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW'
53     Should Contain    ${out}    sysUpTime
54     Should Contain    ${out}    flow_sequence
55     Should Contain    ${out}    unix_nsecs
56     Should Contain    ${out}    dPkts
57     Should Contain    ${out}    tcpFlags
58     Should Contain    ${out}    dstAS=0
59     Should Contain    ${out}    srcAS=0
60     Should Contain    ${out}    dstMask=0
61     Should Contain    ${out}    srcMask=0
62
63
64
65 Verification of Metric Record for Netflow Dumps
66     [Documentation]    Verify the Netflow Metric Record Hbase client
67     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:dstAddr' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${IP_1}' )" }
68     Should Contain    ${out}    value=${IP_1}
69     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:srcAddr' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${IP_1}' )" }
70     Should Contain    ${out}    value=${IP_1}
71     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:dstAddr' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${IP_2}' )" }
72     Should Contain    ${out}    value=${IP_2}
73     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:srcAddr' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${IP_2}' )" }
74     Should Contain    ${out}    value=${IP_2}
75     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:input' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${int1}' )" }
76     Should Contain    ${out}    value=${int1}
77
78     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:output' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${int2}' )" }
79     Should Contain    ${out}    value=${int2}
80
81     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:input' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${int2}' )" }
82     Should Contain    ${out}    value=${int2}
83
84     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:output' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${int1}' )" }
85     Should Contain    ${out}    value=${int1}
86
87     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:flowDuration' , LIMIT => 10}
88     Should Contain    ${out}    flowDuration
89
90     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:nextHop' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${nextHop}' )" }
91     Should Contain    ${out}    value=${nextHop}
92
93     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:version' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${version}' )" }
94     Should Contain    ${out}    value=${version}
95
96     ${out}=    Query the Data from HBaseClient    scan 'NETFLOW',{ COLUMNS => 'c1:protocol' , LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:${protocol}' )" }
97     Should Contain    ${out}    value=${protocol}
98
99
100 *** Keywords ***
101 Initialize Netflow
102     [Documentation]    Initialize Netflow setup and start collecting the netflow samples.
103     Query the Data from HBaseClient    truncate 'NETFLOW'
104     Bringup Netflow
105     Wait Until Keyword Succeeds    36x    5 sec    Ping Pair Hosts Hbase    \\d{2} row
106
107
108
109