use of com.cloud.agent.api.OvsDestroyTunnelCommand in project cloudstack by apache.
the class LibvirtComputingResourceTest method testOvsDestroyTunnelCommandFailure2.
@SuppressWarnings("unchecked")
@Test
public void testOvsDestroyTunnelCommandFailure2() {
final String networkName = "Test";
final Long networkId = 1l;
final String inPortName = "eth";
final OvsDestroyTunnelCommand command = new OvsDestroyTunnelCommand(networkId, networkName, inPortName);
when(libvirtComputingResource.findOrCreateTunnelNetwork(command.getBridgeName())).thenThrow(Exception.class);
final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
assertNotNull(wrapper);
final Answer answer = wrapper.execute(command, libvirtComputingResource);
assertFalse(answer.getResult());
verify(libvirtComputingResource, times(1)).findOrCreateTunnelNetwork(command.getBridgeName());
}
Aggregations