diff --git a/opensync-ext-static/src/main/resources/ProfileAPExample.json b/opensync-ext-static/src/main/resources/ProfileAPExample.json index b2c6ae0..d3ff906 100644 --- a/opensync-ext-static/src/main/resources/ProfileAPExample.json +++ b/opensync-ext-static/src/main/resources/ProfileAPExample.json @@ -46,10 +46,7 @@ { "model_type": "GreTunnelConfiguration", "greTunnelName": null, - "greParentIfName": null, - "greLocalInetAddr": null, "greRemoteInetAddr": null, - "greRemoteMacAddr": null, "vlanIdsInGreTunnel": [ ] } diff --git a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json index b2c6ae0..d3ff906 100644 --- a/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-docker/src/main/docker-opensync-gateway-and-mqtt/app/opensync/ProfileAPExample.json @@ -46,10 +46,7 @@ { "model_type": "GreTunnelConfiguration", "greTunnelName": null, - "greParentIfName": null, - "greLocalInetAddr": null, "greRemoteInetAddr": null, - "greRemoteMacAddr": null, "vlanIdsInGreTunnel": [ ] } diff --git a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json index b2c6ae0..1165a84 100644 --- a/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-docker/src/main/docker/app/opensync/ProfileAPExample.json @@ -42,14 +42,11 @@ "bestAPSteerType": "both" } }, - "greTunnelConfigurations": [ + "greTunnelConfigurations": [ { "model_type": "GreTunnelConfiguration", "greTunnelName": null, - "greParentIfName": null, - "greLocalInetAddr": null, "greRemoteInetAddr": null, - "greRemoteMacAddr": null, "vlanIdsInGreTunnel": [ ] } diff --git a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json index b2c6ae0..0aaf60e 100644 --- a/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json +++ b/opensync-gateway-static-process/src/main/resources/app/opensync/ProfileAPExample.json @@ -42,14 +42,11 @@ "bestAPSteerType": "both" } }, - "greTunnelConfigurations": [ + "greTunnelConfigurations": [ { "model_type": "GreTunnelConfiguration", "greTunnelName": null, - "greParentIfName": null, - "greLocalInetAddr": null, "greRemoteInetAddr": null, - "greRemoteMacAddr": null, "vlanIdsInGreTunnel": [ ] } diff --git a/opensync-gateway/src/test/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDaoTest.java b/opensync-gateway/src/test/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDaoTest.java index d6c9614..3c4129f 100644 --- a/opensync-gateway/src/test/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDaoTest.java +++ b/opensync-gateway/src/test/java/com/telecominfraproject/wlan/opensync/ovsdb/dao/OvsdbDaoTest.java @@ -34,7 +34,6 @@ import org.springframework.test.context.junit4.SpringRunner; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.telecominfraproject.wlan.core.model.equipment.MacAddress; import com.telecominfraproject.wlan.core.model.equipment.RadioType; import com.telecominfraproject.wlan.location.models.Location; import com.telecominfraproject.wlan.opensync.external.integration.models.ConnectNodeInfo; @@ -159,9 +158,11 @@ public class OvsdbDaoTest { apProfile.setName("ApProfile"); apProfile.setProfileType(ProfileType.equipment_ap); ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults(); - Set greTunnels = Set.of(new GreTunnelConfiguration("gre", "wan", - null, InetAddress.getByName("192.168.0.10"), - null, Set.of(Integer.valueOf(100)))); + GreTunnelConfiguration greTunnelConfiguration = GreTunnelConfiguration.createWithDefaults(); + greTunnelConfiguration.setGreRemoteInetAddr(InetAddress.getByName("192.168.0.10")); + greTunnelConfiguration.setGreTunnelName("gre"); + greTunnelConfiguration.setVlanIdsInGreTunnel(Set.of(Integer.valueOf(100))); + Set greTunnels = Set.of(greTunnelConfiguration); tunnelProfileDetails.setGreTunnelConfigurations(greTunnels); apProfile.setDetails(tunnelProfileDetails); @@ -318,33 +319,6 @@ public class OvsdbDaoTest { } - @Test - public void testConfigureGreTunnelsWithNoLocalAddress() throws Exception { - List rows = new ArrayList<>(); - OperationResult[] operationResult = new OperationResult[] { new SelectResult(rows) }; - Mockito.when(ovsdbClient.transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList())) - .thenReturn(selectionFutureResult); - Mockito.when(selectionFutureResult.get(30, TimeUnit.SECONDS)).thenReturn(operationResult); - Profile apProfile = new Profile(); - apProfile.setCustomerId(2); - apProfile.setId(1L); - apProfile.setName("ApProfile"); - apProfile.setProfileType(ProfileType.equipment_ap); - ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults(); - Set greTunnels = Set.of(new GreTunnelConfiguration("gre", "wan", - null, InetAddress.getByName("192.168.0.10"), - null, Set.of(Integer.valueOf(100)))); - tunnelProfileDetails.setGreTunnelConfigurations(greTunnels); - apProfile.setDetails(tunnelProfileDetails); - - OpensyncAPConfig apConfig = Mockito.mock(OpensyncAPConfig.class); - Mockito.when(apConfig.getApProfile()).thenReturn(apProfile); - ovsdbDao.configureGreTunnels(ovsdbClient, apConfig); - Mockito.verify(ovsdbClient, Mockito.times(1)).transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList()); - Mockito.verify(apConfig, Mockito.times(3)).getApProfile(); - - } - @Test public void testConfigureGreTunnelsWithNoRemoteAddress() throws Exception { Profile apProfile = new Profile(); @@ -354,9 +328,11 @@ public class OvsdbDaoTest { apProfile.setProfileType(ProfileType.equipment_ap); ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults(); - Set greTunnels = Set.of(new GreTunnelConfiguration("gre", "wan", - InetAddress.getByName("10.0.10.10"), null, - MacAddress.valueOf("3c:22:fb:18:43:16"), Set.of(Integer.valueOf(100)))); + GreTunnelConfiguration greTunnelConfiguration = GreTunnelConfiguration.createWithDefaults(); + greTunnelConfiguration.setGreRemoteInetAddr(null); + greTunnelConfiguration.setGreTunnelName("gre"); + greTunnelConfiguration.setVlanIdsInGreTunnel(Set.of(Integer.valueOf(100))); + Set greTunnels = Set.of(greTunnelConfiguration); tunnelProfileDetails.setGreTunnelConfigurations(greTunnels); apProfile.setDetails(tunnelProfileDetails); @@ -378,11 +354,12 @@ public class OvsdbDaoTest { apProfile.setProfileType(ProfileType.equipment_ap); ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults(); - Set greTunnels = Set.of(new GreTunnelConfiguration(null, "wan", - null, InetAddress.getByName("192.168.0.10"), - null, Set.of(Integer.valueOf(100)))); + GreTunnelConfiguration greTunnelConfiguration = GreTunnelConfiguration.createWithDefaults(); + greTunnelConfiguration.setGreRemoteInetAddr(InetAddress.getByName("192.168.0.10")); + greTunnelConfiguration.setGreTunnelName(null); + greTunnelConfiguration.setVlanIdsInGreTunnel(Set.of(Integer.valueOf(100))); + Set greTunnels = Set.of(greTunnelConfiguration); tunnelProfileDetails.setGreTunnelConfigurations(greTunnels); - apProfile.setDetails(tunnelProfileDetails); OpensyncAPConfig apConfig = Mockito.mock(OpensyncAPConfig.class);