Support only Oxygen+ distributions
[integration/test.git] / csit / libraries / BierTeResource.robot
1 *** Settings ***
2 Documentation       Robot keyword library (Resource) for BIER information configuration and verification Python utilities.
3 ...
4 ...                 Copyright (c) 2016-2017 Zte, Inc. and others. All rights reserved.
5 ...
6 ...                 This resource contains some keywords which complete four main functions:
7 ...                 Send corresponding request to datastore,
8 ...                 Construct BIER information,
9 ...                 Verity Configuration success or not and its result,
10 ...                 Delete BIER configuration and close all session.
11
12 Resource            TemplatedRequests.robot
13 Library             SSHLibrary
14
15
16 *** Variables ***
17 ${BIER_TE_VAR_FOLDER}       ${CURDIR}/../variables/bier
18 @{NETCONF_PORT_LIST}        17830    17831    17832    17833    17834
19 ${TESTTOOL_PATH}            /root
20 ${TESTTOOL_VERSION}         netconf-testtool-1.3.0-SNAPSHOT-executable.jar
21 ${TESTTOOL_SCHEME}          ./yang_ietf_bier
22
23
24 *** Keywords ***
25 Init All
26     [Documentation]    Init the configuration datastore defined by YANG modules bier-network-topology and bier-network-channel, the Testtool for to simulate the netconf devices, and the netconf connecting IP address and port for the ODL controller.
27     Init Bier Topology
28     Init Channel
29
30 Init Bier Topology
31     [Documentation]    Init the configuration datastore defined by the YANG module bier-network-topology.
32     ${resp}    TemplatedRequests.Put_As_Json_Templated
33     ...    ${BIER_TE_VAR_FOLDER}/bier_init_all/bier_init_biertopology
34     ...    {}
35     ...    session
36
37 Init Channel
38     [Documentation]    Init the configuration datastore defined by the YANG module bier-network-channel.
39     ${resp}    TemplatedRequests.Put_As_Json_Templated
40     ...    ${BIER_TE_VAR_FOLDER}/bier_init_all/bier_init_channel
41     ...    {}
42     ...    session
43
44 Node Online
45     [Documentation]    Verify the Keyword Init Bier Topology has been successfully executed by query and verify the nodes in the datastore.
46     ${resp}    TemplatedRequests.Post_As_Json_Templated
47     ...    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_node
48     ...    {}
49     ...    session
50     ...    True
51
52 Second Layer Loop
53     [Documentation]    The keyword is used for the second layer of loop TC5_Configure Te Node.
54     [Arguments]    ${node-id}    ${tp-id-list}    ${bp-list}    ${length}
55     FOR    ${j}    IN RANGE    ${length}
56         ${tp-id}    Get From List    ${tp-id-list}    ${j}
57         ${bp}    Get From List    ${bp-list}    ${j}
58         ${mapping}    Create Dictionary
59         ...    TOPOLOGYID=${TOPOLOGY_ID}
60         ...    NODEID=${node-id}
61         ...    DOMAINID=${DOMAIN_ID_LIST[0]}
62         ...    SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]}
63         ...    TPID=${tp-id}
64         ...    BP=${bp}
65         ${resp}    TemplatedRequests.Post_As_Json_Templated
66         ...    ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node
67         ...    ${mapping}
68         ...    session
69         Verify_Response_As_Json_Templated    ${resp}    ${BIER_TE_VAR_FOLDER}/common    success_response
70     END