Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru {

public NiciraNvpGuestNetworkGuru() {
super();
_isolationMethods = new IsolationMethod[] {IsolationMethod.STT};
_isolationMethods = new IsolationMethod[] {IsolationMethod.STT, IsolationMethod.VXLAN};
}

@Override
Expand All @@ -115,7 +115,7 @@ protected boolean canHandle(final NetworkOffering offering, final NetworkType ne

@Override
public Network design(final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner) {
// Check of the isolation type of the related physical network is STT
// Check of the isolation type of the related physical network is supported
PhysicalNetworkVO physnet = physicalNetworkDao.findById(plan.getPhysicalNetworkId());
DataCenter dc = _dcDao.findById(plan.getDataCenterId());
if (!canHandle(offering, dc.getNetworkType(), physnet)) {
Expand All @@ -130,7 +130,7 @@ public Network design(final NetworkOffering offering, final DeploymentPlan plan,
}
s_logger.debug("Nicira Nvp " + devices.get(0).getUuid() + " found on physical network " + physnet.getId());

s_logger.debug("Physical isolation type is STT, asking GuestNetworkGuru to design this network");
s_logger.debug("Physical isolation type is supported, asking GuestNetworkGuru to design this network");
NetworkVO networkObject = (NetworkVO)super.design(offering, plan, userSpecified, owner);
if (networkObject == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,17 @@ public void testCanHandle() {
when(offering.getGuestType()).thenReturn(GuestType.Isolated);

final PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT"}));
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT", "VXLAN"}));
when(physnet.getId()).thenReturn(NETWORK_ID);

when(nosd.areServicesSupportedByNetworkOffering(NETWORK_ID, Service.Connectivity)).thenReturn(true);

assertTrue(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);

// Supported: IsolationMethod == VXLAN
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"VXLAN"}));
assertTrue(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);

// Not supported TrafficType != Guest
when(offering.getTrafficType()).thenReturn(TrafficType.Management);
assertFalse(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);
Expand All @@ -134,7 +138,7 @@ public void testCanHandle() {
when(offering.getGuestType()).thenReturn(GuestType.Isolated);
assertFalse(guru.canHandle(offering, NetworkType.Basic, physnet) == true);

// Not supported: IsolationMethod != STT
// Not supported: IsolationMethod != STT, VXLAN
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"VLAN"}));
assertFalse(guru.canHandle(offering, NetworkType.Advanced, physnet) == true);

Expand All @@ -144,7 +148,7 @@ public void testCanHandle() {
public void testDesign() {
final PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
when(physnetdao.findById((Long)any())).thenReturn(physnet);
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT"}));
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT", "VXLAN"}));
when(physnet.getId()).thenReturn(NETWORK_ID);

final NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
Expand All @@ -171,7 +175,7 @@ public void testDesign() {
public void testDesignNoElementOnPhysicalNetwork() {
final PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
when(physnetdao.findById((Long)any())).thenReturn(physnet);
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT"}));
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT", "VXLAN"}));
when(physnet.getId()).thenReturn(NETWORK_ID);

mock(NiciraNvpDeviceVO.class);
Expand Down Expand Up @@ -217,7 +221,7 @@ public void testDesignNoIsolationMethodSTT() {
public void testDesignNoConnectivityInOffering() {
final PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
when(physnetdao.findById((Long)any())).thenReturn(physnet);
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT"}));
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT", "VXLAN"}));
when(physnet.getId()).thenReturn(NETWORK_ID);

final NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
Expand All @@ -243,7 +247,7 @@ public void testDesignNoConnectivityInOffering() {
public void testImplement() throws InsufficientVirtualNetworkCapacityException {
final PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
when(physnetdao.findById((Long)any())).thenReturn(physnet);
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT"}));
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT", "VXLAN"}));
when(physnet.getId()).thenReturn(NETWORK_ID);

final NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
Expand Down Expand Up @@ -412,7 +416,7 @@ public void testImplementURIException() throws InsufficientVirtualNetworkCapacit
public void testShutdown() throws InsufficientVirtualNetworkCapacityException, URISyntaxException {
final PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
when(physnetdao.findById((Long)any())).thenReturn(physnet);
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT"}));
when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] {"STT", "VXLAN"}));
when(physnet.getId()).thenReturn(NETWORK_ID);

final NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
Expand Down