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