mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 11:37:49 +00:00
WIFI-2052: Country Code displayed in UI doesn't match AP
Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
This commit is contained in:
@@ -550,8 +550,11 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
protocolStatusData.setBaseMacAddress(MacAddress.valueOf(connectNodeInfo.macAddress));
|
protocolStatusData.setBaseMacAddress(MacAddress.valueOf(connectNodeInfo.macAddress));
|
||||||
protocolStatusData.setCloudCfgDataVersion(42L);
|
protocolStatusData.setCloudCfgDataVersion(42L);
|
||||||
protocolStatusData.setReportedCfgDataVersion(42L);
|
protocolStatusData.setReportedCfgDataVersion(42L);
|
||||||
protocolStatusData.setCountryCode("CA");
|
CountryCode countryCode = Location.getCountryCode(locationServiceInterface.get(ce.getLocationId()));
|
||||||
protocolStatusData.setReportedCC(CountryCode.CA);
|
protocolStatusData.setCountryCode(countryCode.getName());
|
||||||
|
if (connectNodeInfo.country != null) {
|
||||||
|
protocolStatusData.setReportedCC(CountryCode.getByName(connectNodeInfo.country));
|
||||||
|
}
|
||||||
protocolStatusData.setReportedHwVersion(connectNodeInfo.platformVersion);
|
protocolStatusData.setReportedHwVersion(connectNodeInfo.platformVersion);
|
||||||
if (connectNodeInfo.versionMatrix.containsKey(OvsdbStringConstants.FW_IMAGE_ACTIVE_KEY)) {
|
if (connectNodeInfo.versionMatrix.containsKey(OvsdbStringConstants.FW_IMAGE_ACTIVE_KEY)) {
|
||||||
protocolStatusData.setReportedSwVersion(connectNodeInfo.versionMatrix.get(OvsdbStringConstants.FW_IMAGE_ACTIVE_KEY));
|
protocolStatusData.setReportedSwVersion(connectNodeInfo.versionMatrix.get(OvsdbStringConstants.FW_IMAGE_ACTIVE_KEY));
|
||||||
@@ -1309,6 +1312,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
LOG.debug("Protocol Status reportedCC {} radioStatus.getCountry {} radioStatus CountryCode fromName {}", protocolStatusData.getReportedCC(),
|
LOG.debug("Protocol Status reportedCC {} radioStatus.getCountry {} radioStatus CountryCode fromName {}", protocolStatusData.getReportedCC(),
|
||||||
radioState.getCountry(), CountryCode.getByName((radioState.getCountry())));
|
radioState.getCountry(), CountryCode.getByName((radioState.getCountry())));
|
||||||
protocolStatusData.setReportedCC(CountryCode.getByName((radioState.getCountry())));
|
protocolStatusData.setReportedCC(CountryCode.getByName((radioState.getCountry())));
|
||||||
|
protocolStatusData.setCountryCode(radioState.getCountry());
|
||||||
protocolStatus.setDetails(protocolStatusData);
|
protocolStatus.setDetails(protocolStatusData);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -170,10 +170,12 @@ public class OpensyncExternalIntegrationCloudTest {
|
|||||||
Location location = new Location();
|
Location location = new Location();
|
||||||
location.setId(8L);
|
location.setId(8L);
|
||||||
location.setCustomerId(2);
|
location.setCustomerId(2);
|
||||||
location.setDetails(LocationDetails.createWithDefaults());
|
LocationDetails details = LocationDetails.createWithDefaults();
|
||||||
|
details.setCountryCode(CountryCode.CA);
|
||||||
|
location.setDetails(details);
|
||||||
location.setName("Location-UT");
|
location.setName("Location-UT");
|
||||||
location.setLocationType(LocationType.BUILDING);
|
location.setLocationType(LocationType.BUILDING);
|
||||||
|
Mockito.when(locationServiceInterface.get(8L)).thenReturn(location);
|
||||||
Customer customer = new Customer();
|
Customer customer = new Customer();
|
||||||
customer.setId(2);
|
customer.setId(2);
|
||||||
CustomerDetails customerDetails = new CustomerDetails();
|
CustomerDetails customerDetails = new CustomerDetails();
|
||||||
@@ -239,7 +241,7 @@ public class OpensyncExternalIntegrationCloudTest {
|
|||||||
|
|
||||||
|
|
||||||
Mockito.verify(firmwareServiceInterface).getDefaultCustomerTrackSetting();
|
Mockito.verify(firmwareServiceInterface).getDefaultCustomerTrackSetting();
|
||||||
Mockito.verifyNoInteractions(locationServiceInterface);
|
Mockito.verify(locationServiceInterface).get(8L);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,10 +250,11 @@ public class OpensyncExternalIntegrationCloudTest {
|
|||||||
Location location = new Location();
|
Location location = new Location();
|
||||||
location.setId(8L);
|
location.setId(8L);
|
||||||
location.setCustomerId(2);
|
location.setCustomerId(2);
|
||||||
location.setDetails(LocationDetails.createWithDefaults());
|
LocationDetails details = LocationDetails.createWithDefaults();
|
||||||
|
details.setCountryCode(CountryCode.CA);
|
||||||
|
location.setDetails(details);
|
||||||
location.setName("Location-UT");
|
location.setName("Location-UT");
|
||||||
location.setLocationType(LocationType.BUILDING);
|
location.setLocationType(LocationType.BUILDING);
|
||||||
|
|
||||||
Mockito.when(locationServiceInterface.get(8L)).thenReturn(location);
|
Mockito.when(locationServiceInterface.get(8L)).thenReturn(location);
|
||||||
|
|
||||||
Customer customer = new Customer();
|
Customer customer = new Customer();
|
||||||
@@ -339,7 +342,7 @@ public class OpensyncExternalIntegrationCloudTest {
|
|||||||
Mockito.verify(customerServiceInterface).getOrNull(ArgumentMatchers.anyInt());
|
Mockito.verify(customerServiceInterface).getOrNull(ArgumentMatchers.anyInt());
|
||||||
Mockito.verify(equipmentServiceInterface).getByInventoryIdOrNull("Test_Client_21P10C68818122");
|
Mockito.verify(equipmentServiceInterface).getByInventoryIdOrNull("Test_Client_21P10C68818122");
|
||||||
Mockito.verify(firmwareServiceInterface).getDefaultCustomerTrackSetting();
|
Mockito.verify(firmwareServiceInterface).getDefaultCustomerTrackSetting();
|
||||||
Mockito.verify(locationServiceInterface).get(ArgumentMatchers.anyLong());
|
Mockito.verify(locationServiceInterface, Mockito.times(2)).get(ArgumentMatchers.anyLong());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,9 +364,12 @@ public class OpensyncExternalIntegrationCloudTest {
|
|||||||
Location location = new Location();
|
Location location = new Location();
|
||||||
location.setId(8L);
|
location.setId(8L);
|
||||||
location.setCustomerId(2);
|
location.setCustomerId(2);
|
||||||
location.setDetails(LocationDetails.createWithDefaults());
|
LocationDetails details = LocationDetails.createWithDefaults();
|
||||||
|
details.setCountryCode(CountryCode.CA);
|
||||||
|
location.setDetails(details);
|
||||||
location.setName("Location-UT");
|
location.setName("Location-UT");
|
||||||
location.setLocationType(LocationType.BUILDING);
|
location.setLocationType(LocationType.BUILDING);
|
||||||
|
Mockito.when(locationServiceInterface.get(8L)).thenReturn(location);
|
||||||
|
|
||||||
Equipment equipment = new Equipment();
|
Equipment equipment = new Equipment();
|
||||||
equipment.setCustomerId(2);
|
equipment.setCustomerId(2);
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class OvsdbDaoBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fillInRadioInterfaceNames(OvsdbClient ovsdbClient, ConnectNodeInfo ret) {
|
void fillInRadioInterfaceNamesAndCountry(OvsdbClient ovsdbClient, ConnectNodeInfo ret) {
|
||||||
try {
|
try {
|
||||||
List<Operation> operations = new ArrayList<>();
|
List<Operation> operations = new ArrayList<>();
|
||||||
List<Condition> conditions = new ArrayList<>();
|
List<Condition> conditions = new ArrayList<>();
|
||||||
@@ -273,6 +273,7 @@ public class OvsdbDaoBase {
|
|||||||
|
|
||||||
columns.add("freq_band");
|
columns.add("freq_band");
|
||||||
columns.add("if_name");
|
columns.add("if_name");
|
||||||
|
columns.add("country");
|
||||||
|
|
||||||
operations.add(new Select(wifiRadioStateDbTable, conditions, columns));
|
operations.add(new Select(wifiRadioStateDbTable, conditions, columns));
|
||||||
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
|
CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
|
||||||
@@ -292,6 +293,7 @@ public class OvsdbDaoBase {
|
|||||||
for (Row row : ((SelectResult) result[0]).getRows()) {
|
for (Row row : ((SelectResult) result[0]).getRows()) {
|
||||||
ret.wifiRadioStates.put(getSingleValueFromSet(row, "freq_band"),
|
ret.wifiRadioStates.put(getSingleValueFromSet(row, "freq_band"),
|
||||||
getSingleValueFromSet(row, "if_name"));
|
getSingleValueFromSet(row, "if_name"));
|
||||||
|
ret.country = getSingleValueFromSet(row, "country");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ public class OvsdbNode extends OvsdbDaoBase {
|
|||||||
}
|
}
|
||||||
fillInLanIpAddressAndMac(ovsdbClient, ret, defaultLanInterfaceType);
|
fillInLanIpAddressAndMac(ovsdbClient, ret, defaultLanInterfaceType);
|
||||||
|
|
||||||
fillInRadioInterfaceNames(ovsdbClient, ret);
|
fillInRadioInterfaceNamesAndCountry(ovsdbClient, ret);
|
||||||
|
|
||||||
} catch (OvsdbClientException | TimeoutException | ExecutionException | InterruptedException e) {
|
} catch (OvsdbClientException | TimeoutException | ExecutionException | InterruptedException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user