use of com.cloud.network.nicira.ControlClusterStatus in project cloudstack by apache.
the class NiciraCheckHealthCommandWrapperTest method tetsExecuteWhenClusterIsNotStable.
@Test
public void tetsExecuteWhenClusterIsNotStable() throws Exception {
when(niciraApi.getControlClusterStatus()).thenReturn(new ControlClusterStatus());
final NiciraCheckHealthCommandWrapper commandWrapper = new NiciraCheckHealthCommandWrapper();
final Answer answer = commandWrapper.execute(new CheckHealthCommand(), niciraResource);
assertThat(answer.getResult(), equalTo(false));
}
use of com.cloud.network.nicira.ControlClusterStatus in project cloudstack by apache.
the class NiciraNvpResourceTest method testPingCommandStatusOk.
@Test
public void testPingCommandStatusOk() throws ConfigurationException, NiciraNvpApiException {
resource.configure("NiciraNvpResource", parameters);
final ControlClusterStatus ccs = mock(ControlClusterStatus.class);
when(ccs.getClusterStatus()).thenReturn("stable");
when(nvpApi.getControlClusterStatus()).thenReturn(ccs);
final PingCommand ping = resource.getCurrentStatus(42);
assertTrue(ping != null);
assertTrue(ping.getHostId() == 42);
assertTrue(ping.getHostType() == Host.Type.L2Networking);
}
Aggregations