Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Commit

Permalink
add testDiagStatus() to OpenFlowPluginWiringTest
Browse files Browse the repository at this point in the history
to "prove" that those asynchronously initialized ports really came up

This requires changes in infrautils as well as openflowplugin:

* https://git.opendaylight.org/gerrit/#/c/78897/

*  https://git.opendaylight.org/gerrit/78898
  • Loading branch information
vorburger committed Feb 4, 2019
1 parent d1db91d commit eceb1cc
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@

import static com.google.common.truth.Truth.assertThat;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.inject.Inject;
import junit.framework.AssertionFailedError;
import org.junit.Rule;
import org.junit.Test;
import org.opendaylight.aaa.web.testutils.WebTestModule;
import org.opendaylight.controller.simple.InMemoryControllerModule;
import org.opendaylight.infrautils.diagstatus.DiagStatusService;
import org.opendaylight.infrautils.diagstatus.ServiceStatusSummary;
import org.opendaylight.infrautils.inject.guice.GuiceClassPathBinder;
import org.opendaylight.infrautils.inject.guice.testutils.AnnotationsModule;
import org.opendaylight.infrautils.inject.guice.testutils.GuiceRule;
import org.opendaylight.infrautils.ready.guice.ReadyModule;
import org.opendaylight.infrautils.simple.DiagStatusModule;
import org.opendaylight.infrautils.simple.testutils.AbstractSimpleDistributionTest;
import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProvider;
import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl;
import org.opendaylight.openflowplugin.simple.OpenFlowPluginModule;
import org.opendaylight.serviceutils.simple.ServiceUtilsModule;
import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
Expand All @@ -40,9 +47,21 @@ public class OpenFlowPluginModuleTest extends AbstractSimpleDistributionTest {
@Inject OpenflowProviderConfig ofpConfig;
@Inject ForwardingRulesManagerConfig frmConfig;

@Inject OpenFlowPluginProviderImpl openFlowPluginProviderImpl;
@Inject DiagStatusService diagStatus;

@Test public void testConfig() throws InterruptedException {
assertThat(ofpConfig.getGlobalNotificationQuota()).named("globalNotificationQuota").isEqualTo(64000L);
assertThat(frmConfig.getReconciliationRetryCount()).named("reconciliationRetryCount").isEqualTo(5);
}

@Test public void testDiagStatus() throws InterruptedException, ExecutionException, TimeoutException {
openFlowPluginProviderImpl.getFullyStarted().get(60, TimeUnit.SECONDS);
ServiceStatusSummary status = diagStatus.getServiceStatusSummary();
if (!status.isOperational()) {
throw new AssertionFailedError(
"diagStatus reports non operational, details: " + status);
}
}

}

0 comments on commit eceb1cc

Please sign in to comment.