mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 03:28:00 +00:00
WIFI-1432: Remove unused fields from GreTunnelConfiguration object in profile-models
This commit is contained in:
@@ -46,10 +46,7 @@
|
|||||||
{
|
{
|
||||||
"model_type": "GreTunnelConfiguration",
|
"model_type": "GreTunnelConfiguration",
|
||||||
"greTunnelName": null,
|
"greTunnelName": null,
|
||||||
"greParentIfName": null,
|
|
||||||
"greLocalInetAddr": null,
|
|
||||||
"greRemoteInetAddr": null,
|
"greRemoteInetAddr": null,
|
||||||
"greRemoteMacAddr": null,
|
|
||||||
"vlanIdsInGreTunnel": [
|
"vlanIdsInGreTunnel": [
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,10 +46,7 @@
|
|||||||
{
|
{
|
||||||
"model_type": "GreTunnelConfiguration",
|
"model_type": "GreTunnelConfiguration",
|
||||||
"greTunnelName": null,
|
"greTunnelName": null,
|
||||||
"greParentIfName": null,
|
|
||||||
"greLocalInetAddr": null,
|
|
||||||
"greRemoteInetAddr": null,
|
"greRemoteInetAddr": null,
|
||||||
"greRemoteMacAddr": null,
|
|
||||||
"vlanIdsInGreTunnel": [
|
"vlanIdsInGreTunnel": [
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,14 +42,11 @@
|
|||||||
"bestAPSteerType": "both"
|
"bestAPSteerType": "both"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"greTunnelConfigurations": [
|
"greTunnelConfigurations": [
|
||||||
{
|
{
|
||||||
"model_type": "GreTunnelConfiguration",
|
"model_type": "GreTunnelConfiguration",
|
||||||
"greTunnelName": null,
|
"greTunnelName": null,
|
||||||
"greParentIfName": null,
|
|
||||||
"greLocalInetAddr": null,
|
|
||||||
"greRemoteInetAddr": null,
|
"greRemoteInetAddr": null,
|
||||||
"greRemoteMacAddr": null,
|
|
||||||
"vlanIdsInGreTunnel": [
|
"vlanIdsInGreTunnel": [
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,14 +42,11 @@
|
|||||||
"bestAPSteerType": "both"
|
"bestAPSteerType": "both"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"greTunnelConfigurations": [
|
"greTunnelConfigurations": [
|
||||||
{
|
{
|
||||||
"model_type": "GreTunnelConfiguration",
|
"model_type": "GreTunnelConfiguration",
|
||||||
"greTunnelName": null,
|
"greTunnelName": null,
|
||||||
"greParentIfName": null,
|
|
||||||
"greLocalInetAddr": null,
|
|
||||||
"greRemoteInetAddr": null,
|
"greRemoteInetAddr": null,
|
||||||
"greRemoteMacAddr": null,
|
|
||||||
"vlanIdsInGreTunnel": [
|
"vlanIdsInGreTunnel": [
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
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.core.model.equipment.RadioType;
|
||||||
import com.telecominfraproject.wlan.location.models.Location;
|
import com.telecominfraproject.wlan.location.models.Location;
|
||||||
import com.telecominfraproject.wlan.opensync.external.integration.models.ConnectNodeInfo;
|
import com.telecominfraproject.wlan.opensync.external.integration.models.ConnectNodeInfo;
|
||||||
@@ -159,9 +158,11 @@ public class OvsdbDaoTest {
|
|||||||
apProfile.setName("ApProfile");
|
apProfile.setName("ApProfile");
|
||||||
apProfile.setProfileType(ProfileType.equipment_ap);
|
apProfile.setProfileType(ProfileType.equipment_ap);
|
||||||
ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults();
|
ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults();
|
||||||
Set<GreTunnelConfiguration> greTunnels = Set.of(new GreTunnelConfiguration("gre", "wan",
|
GreTunnelConfiguration greTunnelConfiguration = GreTunnelConfiguration.createWithDefaults();
|
||||||
null, InetAddress.getByName("192.168.0.10"),
|
greTunnelConfiguration.setGreRemoteInetAddr(InetAddress.getByName("192.168.0.10"));
|
||||||
null, Set.of(Integer.valueOf(100))));
|
greTunnelConfiguration.setGreTunnelName("gre");
|
||||||
|
greTunnelConfiguration.setVlanIdsInGreTunnel(Set.of(Integer.valueOf(100)));
|
||||||
|
Set<GreTunnelConfiguration> greTunnels = Set.of(greTunnelConfiguration);
|
||||||
tunnelProfileDetails.setGreTunnelConfigurations(greTunnels);
|
tunnelProfileDetails.setGreTunnelConfigurations(greTunnels);
|
||||||
apProfile.setDetails(tunnelProfileDetails);
|
apProfile.setDetails(tunnelProfileDetails);
|
||||||
|
|
||||||
@@ -318,33 +319,6 @@ public class OvsdbDaoTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testConfigureGreTunnelsWithNoLocalAddress() throws Exception {
|
|
||||||
List<Row> 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<GreTunnelConfiguration> 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
|
@Test
|
||||||
public void testConfigureGreTunnelsWithNoRemoteAddress() throws Exception {
|
public void testConfigureGreTunnelsWithNoRemoteAddress() throws Exception {
|
||||||
Profile apProfile = new Profile();
|
Profile apProfile = new Profile();
|
||||||
@@ -354,9 +328,11 @@ public class OvsdbDaoTest {
|
|||||||
apProfile.setProfileType(ProfileType.equipment_ap);
|
apProfile.setProfileType(ProfileType.equipment_ap);
|
||||||
ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults();
|
ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults();
|
||||||
|
|
||||||
Set<GreTunnelConfiguration> greTunnels = Set.of(new GreTunnelConfiguration("gre", "wan",
|
GreTunnelConfiguration greTunnelConfiguration = GreTunnelConfiguration.createWithDefaults();
|
||||||
InetAddress.getByName("10.0.10.10"), null,
|
greTunnelConfiguration.setGreRemoteInetAddr(null);
|
||||||
MacAddress.valueOf("3c:22:fb:18:43:16"), Set.of(Integer.valueOf(100))));
|
greTunnelConfiguration.setGreTunnelName("gre");
|
||||||
|
greTunnelConfiguration.setVlanIdsInGreTunnel(Set.of(Integer.valueOf(100)));
|
||||||
|
Set<GreTunnelConfiguration> greTunnels = Set.of(greTunnelConfiguration);
|
||||||
tunnelProfileDetails.setGreTunnelConfigurations(greTunnels);
|
tunnelProfileDetails.setGreTunnelConfigurations(greTunnels);
|
||||||
apProfile.setDetails(tunnelProfileDetails);
|
apProfile.setDetails(tunnelProfileDetails);
|
||||||
|
|
||||||
@@ -378,11 +354,12 @@ public class OvsdbDaoTest {
|
|||||||
apProfile.setProfileType(ProfileType.equipment_ap);
|
apProfile.setProfileType(ProfileType.equipment_ap);
|
||||||
ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults();
|
ApNetworkConfiguration tunnelProfileDetails = ApNetworkConfiguration.createWithDefaults();
|
||||||
|
|
||||||
Set<GreTunnelConfiguration> greTunnels = Set.of(new GreTunnelConfiguration(null, "wan",
|
GreTunnelConfiguration greTunnelConfiguration = GreTunnelConfiguration.createWithDefaults();
|
||||||
null, InetAddress.getByName("192.168.0.10"),
|
greTunnelConfiguration.setGreRemoteInetAddr(InetAddress.getByName("192.168.0.10"));
|
||||||
null, Set.of(Integer.valueOf(100))));
|
greTunnelConfiguration.setGreTunnelName(null);
|
||||||
|
greTunnelConfiguration.setVlanIdsInGreTunnel(Set.of(Integer.valueOf(100)));
|
||||||
|
Set<GreTunnelConfiguration> greTunnels = Set.of(greTunnelConfiguration);
|
||||||
tunnelProfileDetails.setGreTunnelConfigurations(greTunnels);
|
tunnelProfileDetails.setGreTunnelConfigurations(greTunnels);
|
||||||
|
|
||||||
apProfile.setDetails(tunnelProfileDetails);
|
apProfile.setDetails(tunnelProfileDetails);
|
||||||
|
|
||||||
OpensyncAPConfig apConfig = Mockito.mock(OpensyncAPConfig.class);
|
OpensyncAPConfig apConfig = Mockito.mock(OpensyncAPConfig.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user