X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FGBP%2FRestconfUtils.robot;h=268226a6a34903ca167c874816cd00a5dec03e24;hb=94651ca9711d8eb316721775561e815830bc6c7e;hp=2593df6390637a04b4d32421ac05c3f0fae0f9ea;hpb=674eae99c92a91e591d474f81b665cec20e711fe;p=integration%2Ftest.git diff --git a/csit/libraries/GBP/RestconfUtils.robot b/csit/libraries/GBP/RestconfUtils.robot index 2593df6390..268226a6a3 100644 --- a/csit/libraries/GBP/RestconfUtils.robot +++ b/csit/libraries/GBP/RestconfUtils.robot @@ -30,16 +30,18 @@ Unregister Endpoints Unregister L2Endpoints [Arguments] ${l2_eps} [Documentation] Unregister Endpoints L2Endpoints from ODL - : FOR ${endpoint} IN @{l2_eps} - \ ${l2_data} = Create L2 Endpoint JSON Data ${endpoint} - \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l2_data} ${HEADERS_YANG_JSON} + FOR ${endpoint} IN @{l2_eps} + ${l2_data} = Create L2 Endpoint JSON Data ${endpoint} + Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l2_data} ${HEADERS_YANG_JSON} + END Unregister L3Endpoints [Arguments] ${l3_eps} [Documentation] Unregister Endpoints L3Endpoints from ODL - : FOR ${endpoint} IN @{l3_eps} - \ ${l3_data} = Create L3 Endpoint JSON Data ${endpoint} - \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l3_data} ${HEADERS_YANG_JSON} + FOR ${endpoint} IN @{l3_eps} + ${l3_data} = Create L3 Endpoint JSON Data ${endpoint} + Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l3_data} ${HEADERS_YANG_JSON} + END Create L2 Endpoint JSON Data [Arguments] ${endpoint} @@ -54,157 +56,156 @@ Create L3 Endpoint JSON Data [Return] ${data} Get Endpoint Path - [Documentation] Returns path for a registered endpoint based on key in arguments [Arguments] ${l2-context} ${mac_address} + [Documentation] Returns path for a registered endpoint based on key in arguments ${mac_address} Convert To Uppercase ${mac_address} [Return] restconf/operational/endpoint:endpoints/endpoint/${l2-context}/${mac_address} Get EndpointL3 Path - [Documentation] Returns path for a registered endpoint-l3 based on key in arguments [Arguments] ${l3-context} ${ip_address} + [Documentation] Returns path for a registered endpoint-l3 based on key in arguments [Return] restconf/operational/endpoint:endpoints/endpoint-l3/${l3-context}/${ip_address} Get Tenant Path - [Documentation] Returns path for a tenant based on key in arguments [Arguments] ${tenant_id} + [Documentation] Returns path for a tenant based on key in arguments [Return] ${TENANTS_CONF_PATH}/policy:tenant/${tenant_id} Get Policy Path - [Documentation] Returns policy path for a particular tenant [Arguments] ${tenant_id} + [Documentation] Returns policy path for a particular tenant ${tenant_path} Get Tenant Path ${tenant_id} [Return] ${tenant_path}/policy Get Contract Path - [Documentation] Returns path for a contract based on key and tenant-id in arguments [Arguments] ${tenant_id} ${contract_id} + [Documentation] Returns path for a contract based on key and tenant-id in arguments ${policy_path} Get Policy Path ${tenant_id} [Return] ${policy_path}/contract/${contract_id} Get Endpoint Group Path - [Documentation] Returns path for an EPG based on key and tenant-id in arguments [Arguments] ${tenant_id} ${endpoint_group_id} + [Documentation] Returns path for an EPG based on key and tenant-id in arguments ${policy_path} Get Policy Path ${tenant_id} [Return] ${policy_path}/endpoint-group/${endpoint_group_id} Get Classifier Instance Path - [Documentation] Returns path for a classifier-instance based on key and tenant-id in arguments [Arguments] ${tenant_id} ${classif_instance_id} + [Documentation] Returns path for a classifier-instance based on key and tenant-id in arguments ${policy_path} Get Policy Path ${tenant_id} [Return] ${policy_path}/subject-feature-instances/classifier-instance/${classif_instance_id} Get Forwarding Context Path - [Documentation] Returns forwarding path for a particular tenant [Arguments] ${tenant_id} + [Documentation] Returns forwarding path for a particular tenant ${tenant_path} Get Tenant Path ${tenant_id} [Return] ${tenant_path}/forwarding-context Get L3 Context Path - [Documentation] Returns l3-context path based on key and tenant-id in arguments [Arguments] ${tenant_id} ${l3_ctx_id} + [Documentation] Returns l3-context path based on key and tenant-id in arguments ${fwd_ctx_path} Get Forwarding Context Path ${tenant_id} [Return] ${fwd_ctx_path}/l3-context/${l3_ctx_id} Get L2 Bridge Domain Path - [Documentation] Returns l2-bridge-domain path based on key and tenant-id in arguments [Arguments] ${tenant_id} ${l2_br_domain_id} + [Documentation] Returns l2-bridge-domain path based on key and tenant-id in arguments ${fwd_ctx_path} Get Forwarding Context Path ${tenant_id} [Return] ${fwd_ctx_path}/l2-bridge-domain/${l2_br_domain_id} Get L2 Flood Domain Path - [Documentation] Returns l2-flood-domain path based on key and tenant-id in arguments [Arguments] ${tenant_id} ${l2_flood_domain_id} + [Documentation] Returns l2-flood-domain path based on key and tenant-id in arguments ${fwd_ctx_path} Get Forwarding Context Path ${tenant_id} [Return] ${fwd_ctx_path}/l2-flood-domain/${l2_flood_domain_id} Get Subnet Path - [Documentation] Returns path for a subnet based on key and tenant-id in arguments [Arguments] ${tenant_id} ${subnet_id} + [Documentation] Returns path for a subnet based on key and tenant-id in arguments ${fwd_ctx_path} Get Forwarding Context Path ${tenant_id} [Return] ${fwd_ctx_path}/subnet/${subnet_id} Get Prefix Constraint of Single Rule Contract - [Documentation] Returns first prefix-constraint from a single rule contract [Arguments] ${contract} + [Documentation] Returns first prefix-constraint from a single rule contract ${contract_json} To Json ${contract} - ${eic} Set Variable - ... ${contract_json['contract'][0]['clause'][0]['consumer-matchers']['endpoint-identification-constraints']} + ${eic} Set Variable ${contract_json['contract'][0]['clause'][0]['consumer-matchers']['endpoint-identification-constraints']} [Return] ${eic['l3-endpoint-identification-constraints']['prefix-constraint'][0]} Get Action of Single Rule Contract - [Documentation] Returns first action-ref from a single rule contract [Arguments] ${contract} + [Documentation] Returns first action-ref from a single rule contract ${contract_json} To Json ${contract} [Return] ${contract_json['contract'][0]['subject'][0]['rule'][0]['action-ref'][0]} Get Ip Prefix of Subnet - [Documentation] Returns ip-prefix from a given subnet [Arguments] ${subnet} + [Documentation] Returns ip-prefix from a given subnet ${subnet_json} To Json ${subnet} [Return] ${subnet_json['subnet'][0]['ip-prefix']} Get Action Instance Name of Single Rule Contract - [Documentation] Returns action-instance name from a single rule contract [Arguments] ${contract} + [Documentation] Returns action-instance name from a single rule contract ${contract_json} To Json ${contract} [Return] ${contract_json['contract'][0]['subject'][0]['rule'][0]['classifier-ref'][0]['instance-name']} Get Groups of Endpoint - [Documentation] Returns endpoint-groups from a given endpoint [Arguments] ${endpoint} + [Documentation] Returns endpoint-groups from a given endpoint ${endpoint_json} To Json ${endpoint} [Return] ${endpoint_json['endpoint'][0]['endpoint-groups']} Get Groups of Endpoint-L3 - [Documentation] Returns endpoint-groups from a given endpoint-l3 [Arguments] ${endpoint-l3} + [Documentation] Returns endpoint-groups from a given endpoint-l3 ${endpoint_json} To Json ${endpoint-l3} [Return] ${endpoint_json['endpoint-l3'][0]['endpoint-groups']} Get L3-Addresses of Endpoint - [Documentation] Returns l3-addresses from a given endpoint [Arguments] ${endpoint} + [Documentation] Returns l3-addresses from a given endpoint ${endpoint_json} To Json ${endpoint} [Return] ${endpoint_json['endpoint'][0]['l3-address']} Get Tenant of Endpoint - [Documentation] Returns tenant-id from a given endpoint [Arguments] ${endpoint} + [Documentation] Returns tenant-id from a given endpoint ${endpoint_json} To Json ${endpoint} [Return] ${endpoint_json['endpoint'][0]['tenant']} Get Tenant of Endpoint-L3 - [Documentation] Returns tenant-id from a given endpoint-l3 [Arguments] ${endpoint-l3} + [Documentation] Returns tenant-id from a given endpoint-l3 ${endpoint_json} To Json ${endpoint-l3} [Return] ${endpoint_json['endpoint-l3'][0]['tenant']} Get Network Containment of Endpoint - [Documentation] Returns network-containment from a given endpoint [Arguments] ${endpoint} + [Documentation] Returns network-containment from a given endpoint ${endpoint_json} To Json ${endpoint} [Return] ${endpoint_json['endpoint'][0]['network-containment']} Get Network Containment of Endpoint-L3 - [Documentation] Returns network-containment from a given endpoint-l3 [Arguments] ${endpoint-l3} + [Documentation] Returns network-containment from a given endpoint-l3 ${endpoint_json} To Json ${endpoint-l3} [Return] ${endpoint_json['endpoint-l3'][0]['network-containment']} Get Mac Address of Endpoint - [Documentation] Returns mac-address from a given endpoint [Arguments] ${endpoint} - ${endpoint_json} To Json ${endpoint} - [Return] ${endpoint_json['endpoint'][0]['mac-address']} + [Documentation] Returns mac-address from a given endpoint + ${endpoint_json} To Json ${endpoint} + [Return] ${endpoint_json['endpoint'][0]['mac-address']} Get Mac Address of Endpoint-L3 - [Documentation] Returns mac-address from a given endpoint-l3 [Arguments] ${endpoint-l3} - ${endpoint_json} To Json ${endpoint-l3} - [Return] ${endpoint_json['endpoint-l3'][0]['mac-address']} + [Documentation] Returns mac-address from a given endpoint-l3 + ${endpoint_json} To Json ${endpoint-l3} + [Return] ${endpoint_json['endpoint-l3'][0]['mac-address']} Get L2 Context of Endpoint-L3 - [Documentation] Returns l2-context from a given endpoint-l3 [Arguments] ${endpoint-l3} + [Documentation] Returns l2-context from a given endpoint-l3 ${endpoint_json} To Json ${endpoint-l3} [Return] ${endpoint_json['endpoint-l3'][0]['l2-context']}