import java.util.Collections;
import java.util.List;
import java.util.Optional;
+import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
import org.opendaylight.infrautils.testutils.LogCapture;
import org.opendaylight.infrautils.testutils.internal.RememberingLogger;
+import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
import org.opendaylight.protocol.bgp.rib.spi.State;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPAfiSafiState;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.AfiSafiBuilder;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.GracefulRestartBuilder;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.StateBuilder;
+import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.operational.rev151009.BgpAfiSafiGracefulRestartState;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.operational.rev151009.BgpNeighborState;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.operational.rev151009.bgp.neighbor.prefix.counters_state.PrefixesBuilder;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.graceful.restart.GracefulRestart;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
-import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
import org.slf4j.LoggerFactory;
public class StateProviderImplTest extends ConstantSchemaAbstractDataBrokerTest {
doReturn(this.timersState).when(this.bgpPeerState).getBGPTimersState();
doReturn(10L).when(this.timersState).getNegotiatedHoldTime();
- doReturn(1L).when(this.timersState).getUpTime();
+ doReturn(10L).when(this.timersState).getUpTime();
doReturn(this.bgpTransportState).when(this.bgpPeerState).getBGPTransportState();
doReturn(this.localPort).when(this.bgpTransportState).getLocalPort();
doReturn(true).when(this.bgpGracelfulRestartState).isLocalRestarting();
doReturn(true).when(this.bgpGracelfulRestartState).isPeerRestarting();
doReturn(this.restartTime).when(this.bgpGracelfulRestartState).getPeerRestartTime();
+ doReturn(BgpAfiSafiGracefulRestartState.Mode.BILATERAL).when(this.bgpGracelfulRestartState).getMode();
doReturn(this.bgpAfiSafiState).when(this.bgpPeerState).getBGPAfiSafiState();
doReturn(Collections.singleton(TABLES_KEY)).when(this.bgpAfiSafiState).getAfiSafisAdvertized();
doReturn(true).when(this.bgpAfiSafiState).isAfiSafiSupported(any());
doReturn(true).when(this.bgpAfiSafiState).isGracefulRestartAdvertized(any());
doReturn(true).when(this.bgpAfiSafiState).isGracefulRestartReceived(any());
+ doReturn(true).when(this.bgpAfiSafiState).isLlGracefulRestartAdvertised(any());
+ doReturn(true).when(this.bgpAfiSafiState).isLlGracefulRestartReceived(any());
+ doReturn(60).when(this.bgpAfiSafiState).getLlGracefulRestartTimer(any());
}
@Override
- protected Iterable<YangModuleInfo> getModuleInfos() throws Exception {
+ protected Set<YangModuleInfo> getModuleInfos() throws Exception {
return ImmutableSet.of(BindingReflections.getModuleInfo(NetworkInstances.class),
BindingReflections.getModuleInfo(NetworkInstanceProtocol.class));
}
.setGracefulRestart(new GracefulRestartBuilder().setState(new StateBuilder().setEnabled(false)
.addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class,
new NeighborAfiSafiGracefulRestartStateAugmentationBuilder()
- .setAdvertised(true).setReceived(true).build())
+ .setAdvertised(true)
+ .setReceived(true)
+ .setLlStaleTimer(60L)
+ .setLlAdvertised(true)
+ .setLlReceived(true)
+ .build())
.build()).build())
.setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp
.common.afi.safi.list.afi.safi.StateBuilder().setEnabled(false).addAugmentation(
gracefulAugmentation.setLocalRestarting(false);
gracefulAugmentation.setPeerRestartTime(0);
gracefulAugmentation.setLocalRestarting(true)
- .setPeerRestarting(true).setPeerRestartTime(this.restartTime);
+ .setPeerRestarting(true)
+ .setPeerRestartTime(this.restartTime)
+ .setMode(BgpAfiSafiGracefulRestartState.Mode.BILATERAL);
final GracefulRestart gracefulRestart = new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp
.rev151009.bgp.graceful.restart.GracefulRestartBuilder().setState(new org.opendaylight.yang.gen.v1.http
.openconfig.net.yang.bgp.rev151009.bgp.graceful.restart.graceful.restart.StateBuilder()