use of org.openkilda.messaging.model.SwitchPropertiesDto in project open-kilda by telstra.
the class SwitchOperationsServiceTest method shouldValidateServer42MacAddressWhenEnableIslRttInSwitchProperties.
@Test(expected = IllegalSwitchPropertiesException.class)
public void shouldValidateServer42MacAddressWhenEnableIslRttInSwitchProperties() {
// user can't enable server42FlowRtt and do not specify server42MacAddress
SwitchPropertiesDto properties = new SwitchPropertiesDto();
properties.setServer42IslRtt(SwitchPropertiesDto.RttState.ENABLED);
properties.setServer42Port(SERVER_42_PORT_2);
properties.setServer42Vlan(SERVER_42_VLAN_2);
properties.setServer42MacAddress(null);
runInvalidServer42PropsTest(properties);
}
use of org.openkilda.messaging.model.SwitchPropertiesDto in project open-kilda by telstra.
the class SwitchOperationsServiceTest method shouldValidateMultiTableFlagWhenUpdatingSwitchProperties.
@Test(expected = IllegalSwitchPropertiesException.class)
public void shouldValidateMultiTableFlagWhenUpdatingSwitchProperties() {
Switch sw = Switch.builder().switchId(TEST_SWITCH_ID).status(SwitchStatus.ACTIVE).build();
switchRepository.add(sw);
createSwitchProperties(sw, Collections.singleton(FlowEncapsulationType.TRANSIT_VLAN), true, true, false);
// user can't disable multiTable without disabling LLDP
SwitchPropertiesDto update = new SwitchPropertiesDto();
update.setSupportedTransitEncapsulation(Collections.singleton(org.openkilda.messaging.payload.flow.FlowEncapsulationType.TRANSIT_VLAN));
update.setMultiTable(false);
update.setSwitchLldp(true);
switchOperationsService.updateSwitchProperties(TEST_SWITCH_ID, update);
}
use of org.openkilda.messaging.model.SwitchPropertiesDto in project open-kilda by telstra.
the class SwitchOperationsServiceTest method shouldValidateFlowMirrorPathWhenUpdatingServer42PortSwitchProperties.
@Test(expected = IllegalSwitchPropertiesException.class)
public void shouldValidateFlowMirrorPathWhenUpdatingServer42PortSwitchProperties() {
Switch firstSwitch = Switch.builder().switchId(TEST_SWITCH_ID).status(SwitchStatus.ACTIVE).build();
Switch secondSwitch = Switch.builder().switchId(TEST_SWITCH_ID_2).status(SwitchStatus.ACTIVE).build();
switchRepository.add(firstSwitch);
switchRepository.add(secondSwitch);
FlowMirrorPath flowMirrorPath = FlowMirrorPath.builder().pathId(new PathId("test_path_id")).mirrorSwitch(secondSwitch).egressSwitch(firstSwitch).egressPort(TEST_FLOW_SRC_PORT).build();
flowMirrorPathRepository.add(flowMirrorPath);
createSwitchProperties(firstSwitch, Collections.singleton(FlowEncapsulationType.TRANSIT_VLAN), true, false, false);
SwitchPropertiesDto update = new SwitchPropertiesDto();
update.setSupportedTransitEncapsulation(Collections.singleton(org.openkilda.messaging.payload.flow.FlowEncapsulationType.TRANSIT_VLAN));
update.setServer42Port(TEST_FLOW_SRC_PORT);
switchOperationsService.updateSwitchProperties(TEST_SWITCH_ID, update);
}
use of org.openkilda.messaging.model.SwitchPropertiesDto in project open-kilda by telstra.
the class SwitchOperationsServiceTest method shouldValidateServer42VlanWhenEnableFlowRttInSwitchProperties.
@Test(expected = IllegalSwitchPropertiesException.class)
public void shouldValidateServer42VlanWhenEnableFlowRttInSwitchProperties() {
// user can't enable server42FlowRtt and do not specify server42Vlan
SwitchPropertiesDto properties = new SwitchPropertiesDto();
properties.setServer42FlowRtt(true);
properties.setServer42Port(SERVER_42_PORT_2);
properties.setServer42Vlan(null);
properties.setServer42MacAddress(SERVER_42_MAC_ADDRESS_2);
runInvalidServer42PropsTest(properties);
}
use of org.openkilda.messaging.model.SwitchPropertiesDto in project open-kilda by telstra.
the class SwitchOperationsServiceTest method shouldValidateFlowMirrorPointsWhenUpdatingSwitchArpProperties.
@Test(expected = IllegalSwitchPropertiesException.class)
public void shouldValidateFlowMirrorPointsWhenUpdatingSwitchArpProperties() {
Switch mirrorSwitch = Switch.builder().switchId(TEST_SWITCH_ID).status(SwitchStatus.ACTIVE).build();
switchRepository.add(mirrorSwitch);
MirrorGroup mirrorGroup = MirrorGroup.builder().switchId(TEST_SWITCH_ID).groupId(new GroupId(12L)).pathId(new PathId("test_path_id")).flowId(TEST_FLOW_ID_1).mirrorGroupType(MirrorGroupType.TRAFFIC_INTEGRITY).mirrorDirection(MirrorDirection.INGRESS).build();
mirrorGroupRepository.add(mirrorGroup);
FlowMirrorPoints flowMirrorPoints = FlowMirrorPoints.builder().mirrorGroup(mirrorGroup).mirrorSwitch(mirrorSwitch).build();
flowMirrorPointsRepository.add(flowMirrorPoints);
createSwitchProperties(mirrorSwitch, Collections.singleton(FlowEncapsulationType.TRANSIT_VLAN), true, false, false);
SwitchPropertiesDto update = new SwitchPropertiesDto();
update.setSupportedTransitEncapsulation(Collections.singleton(org.openkilda.messaging.payload.flow.FlowEncapsulationType.TRANSIT_VLAN));
update.setMultiTable(true);
update.setSwitchArp(true);
switchOperationsService.updateSwitchProperties(TEST_SWITCH_ID, update);
}
Aggregations