diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2016-02-10 03:50:12 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-02-10 15:19:30 +0000 |
commit | ed2805a57ca103d82092b6758c54d505568d312a (patch) | |
tree | 251eb502717a979adcec9cb9e8c70b378a5b64d8 | |
parent | 82d1d69e71db304af5dc153da280f1e503b54398 (diff) |
Remove test code from V3poProvider initialization.
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: Id0f5b13093fc3ea0aa2a67cc18f3af341b2448e2
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
-rw-r--r-- | v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java | 163 |
1 files changed, 0 insertions, 163 deletions
diff --git a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java index 263e255c2..5f9a523b4 100644 --- a/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java +++ b/v3po/impl/src/main/java/io/fd/honeycomb/v3po/impl/V3poProvider.java @@ -76,105 +76,6 @@ public class V3poProvider implements BindingAwareProvider, AutoCloseable { private DataBroker db; VppPollOperDataImpl vppPollOperData; - private void writeToBridgeDomain(final String bdName, final Boolean flood, - final Boolean forward, final Boolean learn, - final Boolean unknownUnicastFlood, - final Boolean arpTermination) { - - BridgeDomainBuilder bdBuilder = new BridgeDomainBuilder(); - bdBuilder.setName(bdName); - bdBuilder.setFlood(flood); - bdBuilder.setForward(forward); - bdBuilder.setLearn(learn); - bdBuilder.setUnknownUnicastFlood(unknownUnicastFlood); - bdBuilder.setArpTermination(arpTermination); - - LOG.info("VPPCFG-INFO: Adding Bridge Domain " + bdName + " to DataStore."); - InstanceIdentifier<BridgeDomain> iid = - InstanceIdentifier.create(Vpp.class) - .child(BridgeDomains.class) - .child(BridgeDomain.class, new BridgeDomainKey(bdName)); - WriteTransaction transaction = db.newWriteOnlyTransaction(); - transaction.put(LogicalDatastoreType.CONFIGURATION, iid, bdBuilder.build()); - CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit(); - Futures.addCallback(future, new LoggingFuturesCallBack<Void>( - "VPPCFG-WARNING: Failed to write bridge domain " + bdName + " to Bridge Domains", LOG)); - } - - private void writeIpv4AddressToInterface(final String name, final Ipv4AddressNoZone ipv4Addr, final short plen) { - AddressKey addrKey = new AddressKey(ipv4Addr); - AddressBuilder addrBuilder = new AddressBuilder(); - PrefixLength prefixLen = new PrefixLengthBuilder().setPrefixLength(plen).build(); - addrBuilder.setSubnet(prefixLen); - addrBuilder.setIp(new Ipv4AddressNoZone(ipv4Addr)); - addrBuilder.setKey(addrKey); - - List<Address> addrs = new ArrayList<Address>(); - addrs.add(addrBuilder.build()); - - Ipv4 ip4 = new Ipv4Builder().setAddress(addrs).build(); - Interface1Builder if1Builder = new Interface1Builder(); - if1Builder.setIpv4(ip4); - - InterfaceBuilder ifBuilder = new InterfaceBuilder(); - ifBuilder.setName(name); - ifBuilder.addAugmentation(Interface1.class, if1Builder.build()); - - LOG.info("VPPCFG-INFO: Adding ipv4 address {} to interface {} to DataStore.", ipv4Addr, name); - InstanceIdentifier<Interface> iid = - InstanceIdentifier.create(Interfaces.class) - .child(Interface.class, new InterfaceKey(name)); - WriteTransaction transaction = db.newWriteOnlyTransaction(); - transaction.put(LogicalDatastoreType.CONFIGURATION, iid, ifBuilder.build()); - CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit(); - Futures.addCallback(future, new LoggingFuturesCallBack<Void>( - "VPPCFG-WARNING: Failed to write " + name + "interface to ietf-interfaces", LOG)); - } - - private void writeToInterface(final String name, final String description, - final Boolean enabled, final String bdName, final int vrfId) { - VppInterfaceAugmentationBuilder ifAugBuilder = new VppInterfaceAugmentationBuilder(); - - EthernetBuilder ethBuilder = new EthernetBuilder(); - ethBuilder.setMtu(1234); - ifAugBuilder.setEthernet(ethBuilder.build()); - - if (bdName != null) { - BridgeBasedBuilder bridgeBuilder = new BridgeBasedBuilder(); - bridgeBuilder.setBridgeDomain(bdName); - bridgeBuilder.setSplitHorizonGroup((short)0); - bridgeBuilder.setBridgedVirtualInterface(false); - - L2Builder l2Builder = new L2Builder(); - l2Builder.setInterconnection(bridgeBuilder.build()); - ifAugBuilder.setL2(l2Builder.build()); - } - - if (vrfId > 0) { - RoutingBuilder rtBuilder = new RoutingBuilder(); - rtBuilder.setVrfId(new Long(vrfId)); - ifAugBuilder.setRouting(rtBuilder.build()); - } - - InterfaceBuilder ifBuilder = new InterfaceBuilder(); - ifBuilder.setName(name); - ifBuilder.setDescription(description); - ifBuilder.setType(EthernetCsmacd.class); - ifBuilder.setEnabled(enabled); - ifBuilder.setLinkUpDownTrapEnable(Interface.LinkUpDownTrapEnable.Disabled); - - ifBuilder.addAugmentation(VppInterfaceAugmentation.class, ifAugBuilder.build()); - - LOG.info("VPPCFG-INFO: Adding interface " + name + " to DataStore."); - InstanceIdentifier<Interface> iid = InstanceIdentifier.create(Interfaces.class) - .child(Interface.class, new InterfaceKey(name)); - WriteTransaction transaction = db.newWriteOnlyTransaction(); - transaction.put(LogicalDatastoreType.CONFIGURATION, iid, ifBuilder.build()); - CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit(); - Futures.addCallback(future, new LoggingFuturesCallBack<Void>( - "VPPCFG-WARNING: Failed to write " + name + "interface to ietf-interfaces", LOG)); - } - private void initializeVppConfig() { WriteTransaction transaction = db.newWriteOnlyTransaction(); @@ -200,70 +101,6 @@ public class V3poProvider implements BindingAwareProvider, AutoCloseable { LOG)); vppInterfaceListener = new VppIetfInterfaceListener(db, api); - /* DAW-DEBUG: - try { - int wait = 3; - LOG.info("VPPCFG-INFO: Sleeping for {} seconds...", wait); - TimeUnit.SECONDS.sleep(wait); - } catch (InterruptedException e) { - LOG.info("VPPCFG-INFO: Sleep Interrupted!"); - } - LOG.info("VPPCFG-INFO: Nap complete. I feel much better now."); - */ - - /* Test DataChangeListener by writing to db */ - writeToBridgeDomain("CocaCola", true /*flood*/, true /*forward*/, - true /*learn*/, true /*uuFlood*/, - false /*arpTermination*/); - writeToBridgeDomain("PepsiCola", true /*flood*/, true /*forward*/, - true /*learn*/, true /*uuFlood*/, - false /*arpTermination*/); - - - writeToInterface("TenGigabitEthernet86/0/1", - "Physical 10GbE Interface (Transport)", - true, null, 7); - writeToInterface("TenGigabitEthernet86/0/0", "Physical 10GbE Interface", - true, "CocaCola", 0); - writeToInterface("GigabitEthernet8/0/1", "Physical 1GbE Interface", - true, "PepsiCola", 0); - - /* - writeIpv4AddressToInterface("GigabitEthernet86/0/1", - new Ipv4AddressNoZone("10.10.10.10"), - (short)24); - writeIpv4AddressToInterface("GigabitEthernet86/0/1", - new Ipv4AddressNoZone("11.11.11.10"), - (short)24); - writeIpv4AddressToInterface("GigabitEthernet86/0/1", - new Ipv4AddressNoZone("11.11.11.10"), - (short)24); - */ - /* Interfaces on virtual testbed VMs (e.g. js-cluster-1) */ - writeToBridgeDomain("Balvenie", true /*flood*/, true /*forward*/, - true /*learn*/, true /*uuFlood*/, - false /*arpTermination*/); - writeToBridgeDomain("Laphroaig", true /*flood*/, true /*forward*/, - true /*learn*/, true /*uuFlood*/, - false /*arpTermination*/); - writeToBridgeDomain("Glenfiddich", true /*flood*/, true /*forward*/, - true /*learn*/, true /*uuFlood*/, - false /*arpTermination*/); - writeToBridgeDomain("Macallan", true /*flood*/, true /*forward*/, - true /*learn*/, true /*uuFlood*/, - false /*arpTermination*/); - - writeToInterface("GigabitEthernet2/2/0", "Physical 1GbE Interface", - true, "Balvenie", 0); - writeToInterface("GigabitEthernet2/3/0", "Physical 1GbE Interface", - true, "Laphroaig", 0); - writeToInterface("GigabitEthernet2/4/0", "Physical 1GbE Interface", - true, "Glenfiddich", 0); - writeToInterface("GigabitEthernet2/5/0", "Physical 1GbE Interface", - true, "Macallan", 0); - writeToInterface("GigabitEthernet2/6/0", - "Physical 1GbE Interface (Transport)", - true, null, 7); } /* operational data */ |