From: Peter Gubka Date: Tue, 21 Jun 2016 09:30:42 +0000 (+0200) Subject: basic bmp suite added X-Git-Tag: release/beryllium-sr3~83 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=e95e74b027c82ec9023dc288d0a6895c1edf4384;p=integration%2Ftest.git basic bmp suite added Change-Id: I7fc85a71df43c22ca72977fdefcb86f10b6b5390 Signed-off-by: Peter Gubka --- diff --git a/csit/suites/bgpcep/bgpfunct/050_bmp_basic.robot b/csit/suites/bgpcep/bgpfunct/050_bmp_basic.robot new file mode 100644 index 0000000000..4fb11c0a10 --- /dev/null +++ b/csit/suites/bgpcep/bgpfunct/050_bmp_basic.robot @@ -0,0 +1,70 @@ +*** Settings *** +Documentation Basic tests for odl-bgpcep-bmp feature +... +... Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved. +... +... This program and the accompanying materials are made available under the +... terms of the Eclipse Public License v1.0 which accompanies this distribution, +... and is available at http://www.eclipse.org/legal/epl-v10.html +... +... This is a basic suite for bgp monitoring protocol feature. +... After the feature odl-bgpcep-bmp installation the port 12345 should be +... bound for listening, +... To test this feature bgp-bmp-mock tool is used. It is a part of the +... bgpcep project. It is a java tool which simulates more peers and more +... routers. +... In this particular test suite it simulates 1 peer with 1 router, which +... means it advertizes one peer ipv4 address towards odl. As a result one +... route should appear in the restconf/operational/bmp-monitor:bmp-monitor. +Suite Setup Set_It_Up +Suite Teardown Tear_It_Down +Library SSHLibrary +Library RequestsLibrary +Resource ${CURDIR}/../../../libraries/NexusKeywords.robot +Resource ${CURDIR}/../../../libraries/Utils.robot +Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot + +*** Variables *** +${CONFIG_SESSION} config-session +${BGP_BMP_DIR} ${CURDIR}/../../../variables/bgpfunctional/bmp_basic +${BMP_LOG_FILE} bmpmock.log + +*** Test Cases *** +Start_Bmp_Mock + [Documentation] Starts bmp-mock on tools vm + ${command}= NexusKeywords.Compose_Full_Java_Command -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_IP} --routers_count 1 --peers_count 1 --log_level DEBUG 2>&1 | tee ${BMP_LOG_FILE} + BuiltIn.Log ${command} + SSHLibrary.Set_Client_Configuration timeout=30s + SSHLibrary.Write ${command} + SSHLibrary.Read_Until successfully established. + +Verify Data Reported + [Documentation] Verifies if the tool reported expected data + &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP} + BuiltIn.Wait_Until_Keyword_Succeeds 3x 2s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_DIR} mapping=${mapping} session=${CONFIG_SESSION} + ... verify=True + +Stop_Bmp_Mock + [Documentation] Send ctrl+c to bmp-mock to stop it + Utils.Write_Bare_Ctrl_C + ${output}= SSHLibrary.Read_Until_Prompt + BuiltIn.Log ${output} + +*** Keywords *** +Set_It_Up + [Documentation] Create SSH session to ToolsVm, prepare HTTP client session to Controller. + ... Figure out latest pcc-mock version and download it from Nexus to ToolsVm. + NexusKeywords.Initialize_Artifact_Deployment_And_Usage + RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} + ${name}= NexusKeywords.Deploy_Test_Tool bgpcep bgp-bmp-mock + BuiltIn.Set_Suite_Variable ${filename} ${name} + +Tear_It_Down + [Documentation] Download pccmock.log and Log its contents. + ... Compute and Log the diff between expected and actual normalized responses. + ... Close both HTTP client session and SSH connection to Mininet. + SSHLibrary.Get_File ${BMP_LOG_FILE} + ${cnt}= OperatingSystem.Get_File ${BMP_LOG_FILE} + Log ${cnt} + Delete_All_Sessions + Close_All_Connections diff --git a/csit/testplans/bgpcep-userfeatures.txt b/csit/testplans/bgpcep-userfeatures.txt index 501c050969..b4d1806683 100644 --- a/csit/testplans/bgpcep-userfeatures.txt +++ b/csit/testplans/bgpcep-userfeatures.txt @@ -6,6 +6,7 @@ # Place the suites in run order: integration/test/csit/suites/netconf/ready/netconfready.robot +integration/test/csit/suites/bgpcep/bgpfunct/050_bmp_basic.robot integration/test/csit/suites/bgpcep/pcepuser/pcepuser.robot integration/test/csit/suites/bgpcep/tcpmd5user/tcpmd5user.robot integration/test/csit/suites/bgpcep/bgpuser/cases.robot @@ -14,3 +15,4 @@ integration/test/csit/suites/bgpcep/bgpuser/ibgp_peers_basic.robot integration/test/csit/suites/bgpcep/bgpuser/ebgp_peers_basic.robot integration/test/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot integration/test/csit/suites/bgpcep/bgpuser/ibgp_peer_lsp.robot + diff --git a/csit/variables/bgpfunctional/bmp_basic/data.json b/csit/variables/bgpfunctional/bmp_basic/data.json new file mode 100644 index 0000000000..ccbeb8cf8f --- /dev/null +++ b/csit/variables/bgpfunctional/bmp_basic/data.json @@ -0,0 +1,68 @@ +{ + "bmp-monitor": { + "monitor": [ + { + "monitor-id": "example-bmp-monitor", + "router": [ + { + "router-id": "$TOOL_IP", + "peer": [ + { + "peer-id": "1.1.1.1", + "as": 65431, + "address": "1.1.1.1", + "bgp-id": "1.1.1.1", + "pre-policy-rib": { + "tables": [ + { + "afi": "bgp-types:ipv4-address-family", + "safi": "bgp-types:unicast-subsequent-address-family", + "bgp-inet:ipv4-routes": {}, + "attributes": { + "uptodate": false + } + } + ] + }, + "peer-session": { + "received-open": { + "hold-timer": 180, + "bgp-identifier": "1.1.1.1", + "my-as-number": 65431 + }, + "remote-port": 179, + "status": "up", + "local-address": "$TOOL_IP", + "timestamp-sec": 0, + "sent-open": { + "hold-timer": 180, + "bgp-identifier": "$TOOL_IP", + "my-as-number": 65431 + }, + "local-port": 179 + }, + "post-policy-rib": { + "tables": [ + { + "afi": "bgp-types:ipv4-address-family", + "safi": "bgp-types:unicast-subsequent-address-family", + "bgp-inet:ipv4-routes": {}, + "attributes": { + "uptodate": false + } + } + ] + }, + "type": "global" + } + ], + "status": "up", + "info": "", + "description": "OpenDaylight", + "name": "BMP mock" + } + ] + } + ] + } +} diff --git a/csit/variables/bgpfunctional/bmp_basic/location.uri b/csit/variables/bgpfunctional/bmp_basic/location.uri new file mode 100644 index 0000000000..513abc0ac6 --- /dev/null +++ b/csit/variables/bgpfunctional/bmp_basic/location.uri @@ -0,0 +1 @@ +/restconf/operational/bmp-monitor:bmp-monitor