diff options
author | Oleksandr Naumets <oleksandrx.naumets@intel.com> | 2018-10-05 15:58:30 +0100 |
---|---|---|
committer | Oleksandr Naumets <oleksandrx.naumets@intel.com> | 2018-10-10 09:30:47 +0000 |
commit | 2f3b65755d896fc9b7a7b248ba4de550696b1a6e (patch) | |
tree | 25011e19597437477cef87e32c242bd239febaac /yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py | |
parent | 81ed5cdea4c36d45c6463523c6a0bc38495e544a (diff) |
Add IxNextgen API for creating BGP protocol layer
Added functionality to create BGP protocol layer for device group
JIRA: YARDSTICK-1465
Change-Id: Ib18b979ce09589b5eda438f01f4f8845295e4c71
Signed-off-by: Oleksandr Naumets <oleksandrx.naumets@intel.com>
Diffstat (limited to 'yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py')
-rw-r--r-- | yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py index cf625d483..feff32156 100644 --- a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py +++ b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py @@ -798,3 +798,29 @@ class IxNextgen(object): # pragma: no cover self.ixnet.commit() return obj + + def add_bgp(self, ipv4, dut_ip, local_as, bgp_type=None): + """Add BGP protocol""" + log.debug("add_bgp: ipv4='%s', dut_ip='%s', local_as='%s'", ipv4, + dut_ip, local_as) + obj = self.ixnet.add(ipv4, 'bgpIpv4Peer') + self.ixnet.commit() + + # Set DUT IP address + dut_ip_addr = self.ixnet.getAttribute(obj, '-dutIp') + self.ixnet.setAttribute(dut_ip_addr + '/singleValue', + '-value', dut_ip) + + # Set local AS number + local_as_number = self.ixnet.getAttribute(obj, '-localAs2Bytes') + self.ixnet.setAttribute(local_as_number + '/singleValue', + '-value', local_as) + + if bgp_type: + # Set BGP type. If not specified, default value is using. + # Default type is "internal" + bgp_type_field = self.ixnet.getAttribute(obj, '-type') + self.ixnet.setAttribute(bgp_type_field + '/singleValue', + '-value', bgp_type) + self.ixnet.commit() + return obj |