Step 1: Move vm scripts to the right place
[integration/test.git] / test / csit / suites / nic / vtn_renderer / vtn_renderer_nic_cli_test.robot
1 *** Settings ***
2 Documentation     Basic Tests for VTN Renderer using NIC CLI.
3 ...
4 ...               Copyright (c) 2015 NEC. All rights reserved.
5 ...
6 ...               This program and the accompanying materials are made available under the
7 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
8 ...               and is available at http://www.eclipse.org/legal/epl-v10.html
9 Suite Setup       Setup NIC Console Environment
10 Suite Teardown    Stop NIC Vtn Rest Test Suite
11 Library           SSHLibrary
12 Library           Collections
13 Library           ../../../libraries/Common.py
14 Resource          ../../../libraries/NicKeywords.robot
15 Resource          ../../../libraries/Scalability.robot
16
17 *** Variables ***
18 ${switches}       8
19 @{valid_intent1}    10.0.0.1    10.0.0.2    ALLOW
20 @{valid_intent2}    10.0.0.2    10.0.0.4    BLOCK
21 @{valid_intent3}    10.0.0.3    10.0.0.5    ALLOW
22 @{invalid_Intent1}    10.0.3.4.5    10.0.0.3    ALLOW
23 @{invalid_Intent2}    10.0.3.5    10.0.0.3    ALLOW
24 @{all_invalid_Intent}    ${invalid_Intent1}    ${invalid_Intent2}
25 @{all_valid_intent}    ${valid_intent1}    ${valid_intent2}    ${valid_intent3}
26 @{all_intents_ids}
27
28 *** Test Cases ***
29 Verify VTN Install
30     [Documentation]    Verify if VTN manager bundles are installed.
31     Wait Until Keyword Succeeds    1000s    10s    Verify VTNBundle
32
33 Verify VTN Renderer Command Add and Remove in CLI
34     [Documentation]    Verification of NIC Console command add and remove. It first creates the intents
35     ...    and stores the intent ids, then verifies that the intents were added. Finally, it compiles the intents
36     ...    to verify that intents were properly merged and also validates intents were removed at the end per the cleanup procedure.
37     [Tags]    NIC
38     : FOR    ${intent}    IN    @{all_valid_intent}
39     \    ${id}=    Add Intent From Karaf Console    @{intent}
40     \    Append To List    ${all_intents_ids}    ${id}
41     Switch Connection    ${mininet_conn_id}
42     Mininet Ping Should Succeed    h1    h2
43     Mininet Ping Should Succeed    h3    h5
44     Mininet Ping Should Not Succeed    h2    h4
45     : FOR    ${intent_id}    IN    @{all_intents_ids}
46     \    Remove Intent From Karaf Console    ${intent_id}
47
48 Verify Invalid VTN Renderer Command Add and Remove in CLI
49     [Documentation]    Invalid IP address for intent creation It first creates the intents
50     ...    and stores the intent ids, but flow condition and flowfilter was not created.
51     [Tags]    NIC
52     : FOR    ${intent}    IN    @{all_invalid_Intent}
53     \    ${id}=    Add Intent From Karaf Console    @{intent}
54     \    ${output}=    Issue Command On Karaf Console    log:display |grep "Invalid Address"
55     \    Should Contain    ${output}    Invalid Address
56
57 *** Keywords ***
58 Verify VTNBundle
59     ${output}=    Issue Command On Karaf Console    bundle:list |grep vtn-renderer
60     Should Contain    ${output}    Active
61
62 Setup NIC Console Environment
63     [Documentation]    Installing NIC Console related features (odl-nic-core, odl-nic-console)
64     Verify Feature Is Installed    odl-nic-core
65     Verify Feature Is Installed    odl-nic-console
66     Verify Feature Is Installed    odl-nic-renderer-vtn
67     Clean Mininet System
68     Start Mininet Linear    ${switches}