use of org.openkilda.model.SwitchProperties in project open-kilda by telstra.
the class FlowValidatorTest method checkForEncapsulationTypeRequirementDifferentTypeTest.
@Test(expected = InvalidFlowException.class)
public void checkForEncapsulationTypeRequirementDifferentTypeTest() throws InvalidFlowException {
SwitchProperties properties = SwitchProperties.builder().supportedTransitEncapsulation(Sets.newHashSet(VXLAN)).build();
flowValidator.checkForEncapsulationTypeRequirement(SRC_ENDPOINT, properties, TRANSIT_VLAN);
}
use of org.openkilda.model.SwitchProperties in project open-kilda by telstra.
the class FlowValidatorTest method checkForEncapsulationTypeRequirementCorrectTypeTest.
@Test
public void checkForEncapsulationTypeRequirementCorrectTypeTest() throws InvalidFlowException {
SwitchProperties properties = SwitchProperties.builder().supportedTransitEncapsulation(Sets.newHashSet(VXLAN, TRANSIT_VLAN)).build();
flowValidator.checkForEncapsulationTypeRequirement(SRC_ENDPOINT, properties, TRANSIT_VLAN);
}
use of org.openkilda.model.SwitchProperties in project open-kilda by telstra.
the class InMemoryPathComputerBaseTest method createSwitch.
Switch createSwitch(String name) {
Switch sw = Switch.builder().switchId(new SwitchId(name)).status(SwitchStatus.ACTIVE).build();
switchRepository.add(sw);
SwitchProperties switchProperties = SwitchProperties.builder().switchObj(sw).supportedTransitEncapsulation(SwitchProperties.DEFAULT_FLOW_ENCAPSULATION_TYPES).build();
switchPropertiesRepository.add(switchProperties);
return sw;
}
use of org.openkilda.model.SwitchProperties in project open-kilda by telstra.
the class FermaIslRepositoryTest method setUp.
@Before
public void setUp() {
islRepository = repositoryFactory.createIslRepository();
switchRepository = repositoryFactory.createSwitchRepository();
flowRepository = repositoryFactory.createFlowRepository();
flowPathRepository = repositoryFactory.createFlowPathRepository();
switchPropertiesRepository = repositoryFactory.createSwitchPropertiesRepository();
switchA = createTestSwitch(TEST_SWITCH_A_ID);
SwitchProperties switchAFeatures = SwitchProperties.builder().switchObj(switchA).supportedTransitEncapsulation(SwitchProperties.DEFAULT_FLOW_ENCAPSULATION_TYPES).build();
switchPropertiesRepository.add(switchAFeatures);
switchB = createTestSwitch(TEST_SWITCH_B_ID);
SwitchProperties switchBFeatures = SwitchProperties.builder().switchObj(switchB).supportedTransitEncapsulation(SwitchProperties.DEFAULT_FLOW_ENCAPSULATION_TYPES).build();
switchPropertiesRepository.add(switchBFeatures);
switchC = createTestSwitch(TEST_SWITCH_C_ID);
SwitchProperties switchCFeatures = SwitchProperties.builder().switchObj(switchC).supportedTransitEncapsulation(SwitchProperties.DEFAULT_FLOW_ENCAPSULATION_TYPES).build();
switchPropertiesRepository.add(switchCFeatures);
assertEquals(3, switchRepository.findAll().size());
}
use of org.openkilda.model.SwitchProperties in project open-kilda by telstra.
the class FermaSwitchPropertiesRepositoryTest method shouldCreatePropertiesWithNullServer42Props.
@Test
public void shouldCreatePropertiesWithNullServer42Props() {
Switch origSwitch = Switch.builder().switchId(TEST_SWITCH_ID).description("Some description").build();
switchRepository.add(origSwitch);
SwitchProperties switchProperties = SwitchProperties.builder().switchObj(origSwitch).server42Port(null).server42Vlan(null).server42MacAddress(null).supportedTransitEncapsulation(SwitchProperties.DEFAULT_FLOW_ENCAPSULATION_TYPES).build();
switchPropertiesRepository.add(switchProperties);
Optional<SwitchProperties> switchPropertiesOptional = switchPropertiesRepository.findBySwitchId(TEST_SWITCH_ID);
assertTrue(switchPropertiesOptional.isPresent());
assertFalse(switchPropertiesOptional.get().isServer42FlowRtt());
assertNull(switchPropertiesOptional.get().getServer42Port());
assertNull(switchPropertiesOptional.get().getServer42MacAddress());
}
Aggregations