mirror of
				https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
				synced 2025-11-03 20:17:53 +00:00 
			
		
		
		
	WIFI-1848: Gateway: Support new AWLAN_Node columns for manufacturing identity data
WIFI-1849: Gateway: Update status with additional manufacturing data
This commit is contained in:
		@@ -1,9 +1,11 @@
 | 
			
		||||
 | 
			
		||||
package com.telecominfraproject.wlan.opensync.ovsdb.dao;
 | 
			
		||||
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.Set;
 | 
			
		||||
import java.util.concurrent.CompletableFuture;
 | 
			
		||||
import java.util.concurrent.ExecutionException;
 | 
			
		||||
import java.util.concurrent.TimeUnit;
 | 
			
		||||
@@ -25,6 +27,7 @@ import com.vmware.ovsdb.protocol.operation.notation.Value;
 | 
			
		||||
import com.vmware.ovsdb.protocol.operation.result.ErrorResult;
 | 
			
		||||
import com.vmware.ovsdb.protocol.operation.result.OperationResult;
 | 
			
		||||
import com.vmware.ovsdb.protocol.operation.result.SelectResult;
 | 
			
		||||
import com.vmware.ovsdb.protocol.schema.DatabaseSchema;
 | 
			
		||||
import com.vmware.ovsdb.service.OvsdbClient;
 | 
			
		||||
 | 
			
		||||
@Component
 | 
			
		||||
@@ -85,8 +88,7 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Row row = null;
 | 
			
		||||
            if ((result != null) && (result.length > 0) && (result[0] instanceof SelectResult)
 | 
			
		||||
                    && !((SelectResult) result[0]).getRows().isEmpty()) {
 | 
			
		||||
            if ((result != null) && (result.length > 0) && (result[0] instanceof SelectResult) && !((SelectResult) result[0]).getRows().isEmpty()) {
 | 
			
		||||
                row = ((SelectResult) result[0]).getRows().iterator().next();
 | 
			
		||||
                connectNodeInfo.lanIpV4Address = getSingleValueFromSet(row, "inet_addr");
 | 
			
		||||
                connectNodeInfo.lanIfName = row.getStringColumn("if_name");
 | 
			
		||||
@@ -103,8 +105,7 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void fillInWanIpAddressAndMac(OvsdbClient ovsdbClient, ConnectNodeInfo connectNodeInfo, String ifType,
 | 
			
		||||
            String ifName) {
 | 
			
		||||
    void fillInWanIpAddressAndMac(OvsdbClient ovsdbClient, ConnectNodeInfo connectNodeInfo, String ifType, String ifName) {
 | 
			
		||||
        try {
 | 
			
		||||
            List<Operation> operations = new ArrayList<>();
 | 
			
		||||
            List<Condition> conditions = new ArrayList<>();
 | 
			
		||||
@@ -132,8 +133,7 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Row row = null;
 | 
			
		||||
            if ((result != null) && (result.length > 0) && (result[0] instanceof SelectResult)
 | 
			
		||||
                    && !((SelectResult) result[0]).getRows().isEmpty()) {
 | 
			
		||||
            if ((result != null) && (result.length > 0) && (result[0] instanceof SelectResult) && !((SelectResult) result[0]).getRows().isEmpty()) {
 | 
			
		||||
                row = ((SelectResult) result[0]).getRows().iterator().next();
 | 
			
		||||
                connectNodeInfo.ipV4Address = getSingleValueFromSet(row, "inet_addr");
 | 
			
		||||
                connectNodeInfo.ifName = row.getStringColumn("if_name");
 | 
			
		||||
@@ -166,6 +166,15 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
            columns.add("platform_version");
 | 
			
		||||
            columns.add("revision");
 | 
			
		||||
            columns.add("version_matrix");
 | 
			
		||||
            columns.add("id");
 | 
			
		||||
 | 
			
		||||
            DatabaseSchema dbSchema = ovsdbClient.getSchema(ovsdbName).get();
 | 
			
		||||
            Set<String> keys = dbSchema.getTables().get(awlanNodeDbTable).getColumns().keySet();
 | 
			
		||||
            if (keys.containsAll(Set.of("reference_design", "qr_code", "model_description", "manufacturer_url", "manufacturer_name", "manufacturer_date",
 | 
			
		||||
                    "certification_region"))) {
 | 
			
		||||
                columns.addAll(Set.of("reference_design", "qr_code", "model_description", "manufacturer_url", "manufacturer_name", "manufacturer_date",
 | 
			
		||||
                        "certification_region"));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            operations.add(new Select(awlanNodeDbTable, conditions, columns));
 | 
			
		||||
            CompletableFuture<OperationResult[]> fResult = ovsdbClient.transact(ovsdbName, operations);
 | 
			
		||||
@@ -180,8 +189,7 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Row row = null;
 | 
			
		||||
            if ((result != null) && (result.length > 0) && (result[0] instanceof SelectResult)
 | 
			
		||||
                    && !((SelectResult) result[0]).getRows().isEmpty()) {
 | 
			
		||||
            if ((result != null) && (result.length > 0) && (result[0] instanceof SelectResult) && !((SelectResult) result[0]).getRows().isEmpty()) {
 | 
			
		||||
                row = ((SelectResult) result[0]).getRows().iterator().next();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@@ -199,6 +207,17 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
            ret.serialNumber = getSingleValueFromSet(row, "serial_number");
 | 
			
		||||
            ret.model = getSingleValueFromSet(row, "model");
 | 
			
		||||
 | 
			
		||||
            if (keys.containsAll(Set.of("reference_design", "qr_code", "model_description", "manufacturer_url", "manufacturer_name", "manufacturer_date",
 | 
			
		||||
                    "certification_region"))) {
 | 
			
		||||
                    ret.referenceDesign = getSingleValueFromSet(row, "reference_design");
 | 
			
		||||
                    ret.qrCode =  row.getMapColumn("qr_code");
 | 
			
		||||
                    ret.modelDescription = getSingleValueFromSet(row, "model_description");
 | 
			
		||||
                    ret.manufacturerUrl = getSingleValueFromSet(row, "manufacturer_url");
 | 
			
		||||
                    ret.manufacturerName = getSingleValueFromSet(row, "manufacturer_name");
 | 
			
		||||
                    ret.manufacturerDate =   getSingleValueFromSet(row, "manufacturer_date");
 | 
			
		||||
                    ret.certificationRegion =  getSingleValueFromSet(row, "certification_region");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // now populate macAddress, ipV4Address from Wifi_Inet_State
 | 
			
		||||
            // first look them up for if_name = br-wan
 | 
			
		||||
            fillInWanIpAddressAndMac(ovsdbClient, ret, defaultWanInterfaceType, defaultWanInterfaceName);
 | 
			
		||||
@@ -207,8 +226,7 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
                fillInWanIpAddressAndMac(ovsdbClient, ret, defaultLanInterfaceType, defaultLanInterfaceName);
 | 
			
		||||
 | 
			
		||||
                if (ret.ipV4Address == null) {
 | 
			
		||||
                    throw new RuntimeException(
 | 
			
		||||
                            "Could not get inet address for Lan and Wan network interfaces. Node is not ready to connect.");
 | 
			
		||||
                    throw new RuntimeException("Could not get inet address for Lan and Wan network interfaces. Node is not ready to connect.");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            fillInLanIpAddressAndMac(ovsdbClient, ret, defaultLanInterfaceType);
 | 
			
		||||
@@ -262,8 +280,8 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
            serialNumber = getSingleValueFromSet(row, "serial_number");
 | 
			
		||||
            model = getSingleValueFromSet(row, "model");
 | 
			
		||||
 | 
			
		||||
            LOG.info("Redirecting AP Node: clientCn {} serialNumber {} model {} firmwareVersion {} skuNumber {}",
 | 
			
		||||
                    clientCn, serialNumber, model, firmwareVersion, skuNumber);
 | 
			
		||||
            LOG.info("Redirecting AP Node: clientCn {} serialNumber {} model {} firmwareVersion {} skuNumber {}", clientCn, serialNumber, model,
 | 
			
		||||
                    firmwareVersion, skuNumber);
 | 
			
		||||
 | 
			
		||||
            // Update table AWLAN_Node - set manager_addr
 | 
			
		||||
            operations.clear();
 | 
			
		||||
@@ -293,8 +311,7 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
 | 
			
		||||
    void rebootOrResetAp(OvsdbClient ovsdbClient, String desiredApAction) {
 | 
			
		||||
        try {
 | 
			
		||||
            LOG.debug("rebootOrResetAp on AP perform {}, setting timer for {} seconds.", desiredApAction,
 | 
			
		||||
                    rebootOrResetTimerSeconds);
 | 
			
		||||
            LOG.debug("rebootOrResetAp on AP perform {}, setting timer for {} seconds.", desiredApAction, rebootOrResetTimerSeconds);
 | 
			
		||||
            List<Operation> operations = new ArrayList<>();
 | 
			
		||||
            Map<String, Value> updateColumns = new HashMap<>();
 | 
			
		||||
            updateColumns.put("firmware_url", new Atom<>(desiredApAction));
 | 
			
		||||
@@ -315,8 +332,8 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ConnectNodeInfo updateConnectNodeInfoOnConnect(OvsdbClient ovsdbClient, String clientCn,
 | 
			
		||||
            ConnectNodeInfo incomingConnectNodeInfo, boolean preventCnAlteration) {
 | 
			
		||||
    ConnectNodeInfo updateConnectNodeInfoOnConnect(OvsdbClient ovsdbClient, String clientCn, ConnectNodeInfo incomingConnectNodeInfo,
 | 
			
		||||
            boolean preventCnAlteration) {
 | 
			
		||||
        ConnectNodeInfo ret = incomingConnectNodeInfo.clone();
 | 
			
		||||
 | 
			
		||||
        try {
 | 
			
		||||
@@ -337,8 +354,7 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
            // mqtt_settings:ins:'["map",[["broker","testportal.123wlan.com"],["topics","/ap/dev-ap-0300/opensync"],["qos","0"],["port","1883"],["remote_log","1"]]]'
 | 
			
		||||
            Map<String, String> newMqttSettings = new HashMap<>();
 | 
			
		||||
            newMqttSettings.put("broker", mqttBrokerAddress);
 | 
			
		||||
            String mqttClientName = OvsdbToWlanCloudTypeMappingUtility.getAlteredClientCnIfRequired(clientCn,
 | 
			
		||||
                    incomingConnectNodeInfo, preventCnAlteration);
 | 
			
		||||
            String mqttClientName = OvsdbToWlanCloudTypeMappingUtility.getAlteredClientCnIfRequired(clientCn, incomingConnectNodeInfo, preventCnAlteration);
 | 
			
		||||
            newMqttSettings.put("topics", "/ap/" + mqttClientName + "/opensync");
 | 
			
		||||
            newMqttSettings.put("port", "" + mqttBrokerExternalPort);
 | 
			
		||||
            newMqttSettings.put("compress", "zlib");
 | 
			
		||||
@@ -347,8 +363,8 @@ public class OvsdbNode extends OvsdbDaoBase {
 | 
			
		||||
 | 
			
		||||
            if ((ret.mqttSettings == null) || !ret.mqttSettings.equals(newMqttSettings)) {
 | 
			
		||||
                @SuppressWarnings("unchecked")
 | 
			
		||||
                com.vmware.ovsdb.protocol.operation.notation.Map<String, String> mgttSettings = com.vmware.ovsdb.protocol.operation.notation.Map
 | 
			
		||||
                        .of(newMqttSettings);
 | 
			
		||||
                com.vmware.ovsdb.protocol.operation.notation.Map<String, String> mgttSettings =
 | 
			
		||||
                        com.vmware.ovsdb.protocol.operation.notation.Map.of(newMqttSettings);
 | 
			
		||||
                ret.mqttSettings = newMqttSettings;
 | 
			
		||||
                updateColumns.put("mqtt_settings", mgttSettings);
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
 | 
			
		||||
package com.telecominfraproject.wlan.opensync.ovsdb.dao;
 | 
			
		||||
 | 
			
		||||
import static org.junit.Assert.assertNotNull;
 | 
			
		||||
@@ -60,16 +61,16 @@ import com.vmware.ovsdb.protocol.schema.TableSchema;
 | 
			
		||||
import com.vmware.ovsdb.service.OvsdbClient;
 | 
			
		||||
 | 
			
		||||
@RunWith(SpringRunner.class)
 | 
			
		||||
@ActiveProfiles(profiles = { "integration_test", }) // NOTE: these profiles will
 | 
			
		||||
@ActiveProfiles(profiles = {"integration_test",}) // NOTE: these profiles will
 | 
			
		||||
// be ADDED to the list of
 | 
			
		||||
// active profiles
 | 
			
		||||
@SpringBootTest(webEnvironment = WebEnvironment.NONE, classes = OvsdbDaoTest.class)
 | 
			
		||||
@Import(value = { OvsdbDao.class, OvsdbDaoTest.Config.class, OvsdbNode.class, OvsdbRadioConfig.class,
 | 
			
		||||
        OvsdbHotspotConfig.class, OvsdbCommandConfig.class, OvsdbMonitor.class, OvsdbFirmwareConfig.class,
 | 
			
		||||
        OvsdbStatsConfig.class, OvsdbSsidConfig.class, OvsdbRrmConfig.class, OvsdbNetworkConfig.class,
 | 
			
		||||
        OvsdbNodeConfig.class,OvsdbRadiusProxyConfig.class
 | 
			
		||||
@Import(
 | 
			
		||||
        value = {OvsdbDao.class, OvsdbDaoTest.Config.class, OvsdbNode.class, OvsdbRadioConfig.class, OvsdbHotspotConfig.class, OvsdbCommandConfig.class,
 | 
			
		||||
                OvsdbMonitor.class, OvsdbFirmwareConfig.class, OvsdbStatsConfig.class, OvsdbSsidConfig.class, OvsdbRrmConfig.class, OvsdbNetworkConfig.class,
 | 
			
		||||
                OvsdbNodeConfig.class, OvsdbRadiusProxyConfig.class
 | 
			
		||||
 | 
			
		||||
})
 | 
			
		||||
        })
 | 
			
		||||
public class OvsdbDaoTest {
 | 
			
		||||
 | 
			
		||||
    static final int DEFAULT_CUSTOMER_ID = 1;
 | 
			
		||||
@@ -178,9 +179,8 @@ public class OvsdbDaoTest {
 | 
			
		||||
    @Test
 | 
			
		||||
    public void testConfigureGreTunnels() 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);
 | 
			
		||||
        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);
 | 
			
		||||
@@ -251,25 +251,21 @@ public class OvsdbDaoTest {
 | 
			
		||||
        passpointVenueProfile.setId(VENUE_ID);
 | 
			
		||||
        Profile hotspot20IdProviderProfile = new Profile();
 | 
			
		||||
        hotspot20IdProviderProfile.setId(HOTSPOT_PROVIDER_ID_1);
 | 
			
		||||
        hotspot20IdProviderProfile = OvsdbDaoTestUtilities.createPasspointIdProviderProfile(DEFAULT_CUSTOMER_ID,
 | 
			
		||||
                hotspot20IdProviderProfile, "TipWlan-Hotspot20-OSU-Provider", "Rogers AT&T Wireless", "Canada", "ca",
 | 
			
		||||
                302, 720, "rogers.com", 1);
 | 
			
		||||
        hotspot20IdProviderProfile = OvsdbDaoTestUtilities.createPasspointIdProviderProfile(DEFAULT_CUSTOMER_ID, hotspot20IdProviderProfile,
 | 
			
		||||
                "TipWlan-Hotspot20-OSU-Provider", "Rogers AT&T Wireless", "Canada", "ca", 302, 720, "rogers.com", 1);
 | 
			
		||||
        Profile hotspot20IdProviderProfile2 = new Profile();
 | 
			
		||||
        hotspot20IdProviderProfile2.setId(HOTSPOT_PROVIDER_ID_2);
 | 
			
		||||
        hotspot20IdProviderProfile2 = OvsdbDaoTestUtilities.createPasspointIdProviderProfile(DEFAULT_CUSTOMER_ID,
 | 
			
		||||
                hotspot20IdProviderProfile2, "TipWlan-Hotspot20-OSU-Provider-2", "Telus Mobility", "Canada", "ca", 302,
 | 
			
		||||
                220, "telus.com", 1);
 | 
			
		||||
        hotspot20IdProviderProfile2 = OvsdbDaoTestUtilities.createPasspointIdProviderProfile(DEFAULT_CUSTOMER_ID, hotspot20IdProviderProfile2,
 | 
			
		||||
                "TipWlan-Hotspot20-OSU-Provider-2", "Telus Mobility", "Canada", "ca", 302, 220, "telus.com", 1);
 | 
			
		||||
 | 
			
		||||
        profileSsidOsu.getChildProfileIds().add(hotspot20IdProviderProfile.getId());
 | 
			
		||||
        profileSsidOsu.getChildProfileIds().add(hotspot20IdProviderProfile2.getId());
 | 
			
		||||
 | 
			
		||||
        Profile passpointHotspotConfig = OvsdbDaoTestUtilities.createPasspointHotspotConfig(DEFAULT_CUSTOMER_ID,
 | 
			
		||||
                hotspot20IdProviderProfile2, hotspot20IdProviderProfile, passpointOperatorProfile,
 | 
			
		||||
                passpointVenueProfile, profileSsidPsk, profileSsidOsu);
 | 
			
		||||
        Profile passpointHotspotConfig = OvsdbDaoTestUtilities.createPasspointHotspotConfig(DEFAULT_CUSTOMER_ID, hotspot20IdProviderProfile2,
 | 
			
		||||
                hotspot20IdProviderProfile, passpointOperatorProfile, passpointVenueProfile, profileSsidPsk, profileSsidOsu);
 | 
			
		||||
        passpointHotspotConfig.setId(HOTSPOT_CONFIG_ID);
 | 
			
		||||
 | 
			
		||||
        Profile hotspotProfileAp = OvsdbDaoTestUtilities.createPasspointApProfile(DEFAULT_CUSTOMER_ID, profileSsidPsk,
 | 
			
		||||
                profileSsidOsu);
 | 
			
		||||
        Profile hotspotProfileAp = OvsdbDaoTestUtilities.createPasspointApProfile(DEFAULT_CUSTOMER_ID, profileSsidPsk, profileSsidOsu);
 | 
			
		||||
        hotspotProfileAp.setId(EQUIPMENT_AP_ID);
 | 
			
		||||
 | 
			
		||||
        hsConfig.setHotspot20OperatorSet(Set.of(passpointOperatorProfile));
 | 
			
		||||
@@ -283,14 +279,12 @@ public class OvsdbDaoTest {
 | 
			
		||||
 | 
			
		||||
        apConfig.setSsidProfile(List.of(profileSsidOsu, profileSsidPsk));
 | 
			
		||||
 | 
			
		||||
        Mockito.when(futureResult.get(Mockito.anyLong(), Mockito.eq(TimeUnit.SECONDS)))
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20IconRows()).thenReturn(OvsdbDaoTestUtilities.hs20InsertIconRows())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20OsuProviders()).thenReturn(OvsdbDaoTestUtilities.hs20IconRows())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20IconRows())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20InsertProviderRows())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20Config()).thenReturn(OvsdbDaoTestUtilities.hs20OsuProviders())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.vifConfigRows()).thenReturn(OvsdbDaoTestUtilities.vifConfigRows())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20Config());
 | 
			
		||||
        Mockito.when(futureResult.get(Mockito.anyLong(), Mockito.eq(TimeUnit.SECONDS))).thenReturn(OvsdbDaoTestUtilities.hs20IconRows())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20InsertIconRows()).thenReturn(OvsdbDaoTestUtilities.hs20OsuProviders())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20IconRows()).thenReturn(OvsdbDaoTestUtilities.hs20IconRows())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20InsertProviderRows()).thenReturn(OvsdbDaoTestUtilities.hs20Config())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.hs20OsuProviders()).thenReturn(OvsdbDaoTestUtilities.vifConfigRows())
 | 
			
		||||
                .thenReturn(OvsdbDaoTestUtilities.vifConfigRows()).thenReturn(OvsdbDaoTestUtilities.hs20Config());
 | 
			
		||||
 | 
			
		||||
        Mockito.when(ovsdbClient.transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList())).thenReturn(futureResult);
 | 
			
		||||
 | 
			
		||||
@@ -352,275 +346,12 @@ public class OvsdbDaoTest {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void testGetConnectNodeInfo() throws Exception {
 | 
			
		||||
 | 
			
		||||
        Mockito.when(ovsdbClient.transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList())).thenReturn(futureResult);
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> awlanColumns = new HashMap<>();
 | 
			
		||||
        awlanColumns.put("mqtt_settings", com.vmware.ovsdb.protocol.operation.notation.Map
 | 
			
		||||
                .of(ImmutableMap.of("broker", "192.168.1.101", "port", "1883")));
 | 
			
		||||
        awlanColumns.put("redirector_addr", Atom.string(REDIRECT_ADDR));
 | 
			
		||||
        awlanColumns.put("manager_addr", Atom.string(MGR_ADDR));
 | 
			
		||||
        awlanColumns.put("platform_version", Atom.string(PLATFORM_VERSION));
 | 
			
		||||
        awlanColumns.put("firmware_version", Atom.string(FW_VERSION));
 | 
			
		||||
        awlanColumns.put("revision", Atom.string(REVISION));
 | 
			
		||||
        awlanColumns.put("sku_number", Atom.string(SKU_NUMBER));
 | 
			
		||||
        awlanColumns.put("serial_number", Atom.string(SERIAL_NUM));
 | 
			
		||||
        awlanColumns.put("model", Atom.string(MODEL));
 | 
			
		||||
        Row awlanRow = new Row(awlanColumns);
 | 
			
		||||
 | 
			
		||||
        List<Row> awlanRows = ImmutableList.of(awlanRow);
 | 
			
		||||
 | 
			
		||||
        OperationResult[] awlanResult = new OperationResult[] { new SelectResult(awlanRows) };
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> inetWanColumns = new HashMap<>();
 | 
			
		||||
        inetWanColumns.put("inet_addr", Atom.string(WAN_IP));
 | 
			
		||||
        inetWanColumns.put("hwaddr", Atom.string(WAN_MAC));
 | 
			
		||||
        inetWanColumns.put("if_name", Atom.string(WAN_IF_NAME));
 | 
			
		||||
        inetWanColumns.put("if_type", Atom.string(WAN_IF_TYPE));
 | 
			
		||||
 | 
			
		||||
        Row inetWanRow = new Row(inetWanColumns);
 | 
			
		||||
 | 
			
		||||
        List<Row> inetWanRows = ImmutableList.of(inetWanRow);
 | 
			
		||||
 | 
			
		||||
        OperationResult[] inetWanResult = new OperationResult[] { new SelectResult(inetWanRows) };
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> inetLanColumns = new HashMap<>();
 | 
			
		||||
        inetLanColumns.put("inet_addr", Atom.string(LAN_IP));
 | 
			
		||||
        inetLanColumns.put("hwaddr", Atom.string(LAN_MAC));
 | 
			
		||||
        inetLanColumns.put("if_name", Atom.string(LAN_IF_NAME));
 | 
			
		||||
        inetLanColumns.put("if_type", Atom.string(LAN_IF_TYPE));
 | 
			
		||||
 | 
			
		||||
        Row inetLanRow = new Row(inetLanColumns);
 | 
			
		||||
 | 
			
		||||
        List<Row> inetLanRows = ImmutableList.of(inetLanRow);
 | 
			
		||||
 | 
			
		||||
        OperationResult[] inetLanResult = new OperationResult[] { new SelectResult(inetLanRows) };
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> wifiRadioStateColumns = new HashMap<>();
 | 
			
		||||
        wifiRadioStateColumns.put("freq_band", Atom.string("2.4G"));
 | 
			
		||||
        wifiRadioStateColumns.put("if_name", Atom.string("home-ap-24"));
 | 
			
		||||
        Row wifiRadioStateRow = new Row(wifiRadioStateColumns);
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> wifiRadioStateColumns2 = new HashMap<>();
 | 
			
		||||
        wifiRadioStateColumns2.put("freq_band", Atom.string("5GL"));
 | 
			
		||||
        wifiRadioStateColumns2.put("if_name", Atom.string("home-ap-l50"));
 | 
			
		||||
        Row wifiRadioStateRow2 = new Row(wifiRadioStateColumns2);
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> wifiRadioStateColumns3 = new HashMap<>();
 | 
			
		||||
        wifiRadioStateColumns3.put("freq_band", Atom.string("5GU"));
 | 
			
		||||
        wifiRadioStateColumns3.put("if_name", Atom.string("home-ap-u50"));
 | 
			
		||||
        Row wifiRadioStateRow3 = new Row(wifiRadioStateColumns3);
 | 
			
		||||
 | 
			
		||||
        List<Row> wifiRadioStateRows = ImmutableList.of(wifiRadioStateRow, wifiRadioStateRow2, wifiRadioStateRow3);
 | 
			
		||||
 | 
			
		||||
        OperationResult[] wifiRadioStateResult = new OperationResult[] { new SelectResult(wifiRadioStateRows) };
 | 
			
		||||
 | 
			
		||||
        Mockito.when(futureResult.get(Mockito.anyLong(), Mockito.eq(TimeUnit.SECONDS))).thenReturn(awlanResult)
 | 
			
		||||
                .thenReturn(inetWanResult).thenReturn(inetLanResult).thenReturn(wifiRadioStateResult);
 | 
			
		||||
 | 
			
		||||
        ConnectNodeInfo connectNodeInfo = ovsdbDao.getConnectNodeInfo(ovsdbClient);
 | 
			
		||||
 | 
			
		||||
        assertNotNull(connectNodeInfo);
 | 
			
		||||
        assert (connectNodeInfo.wifiRadioStates.entrySet().size() == 3);
 | 
			
		||||
        assert (connectNodeInfo.firmwareVersion.equals(FW_VERSION));
 | 
			
		||||
        assert (connectNodeInfo.redirectorAddr.equals(REDIRECT_ADDR));
 | 
			
		||||
        assert (connectNodeInfo.ipV4Address.equals(WAN_IP));
 | 
			
		||||
 | 
			
		||||
        assert (connectNodeInfo.lanIfName.equals(LAN_IF_NAME));
 | 
			
		||||
        assert (connectNodeInfo.ifName.equals(WAN_IF_NAME));
 | 
			
		||||
 | 
			
		||||
        Mockito.verify(ovsdbClient, Mockito.times(4)).transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList());
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test(expected = RuntimeException.class)
 | 
			
		||||
    public void testFailGetConnectNodeInfo() throws Exception {
 | 
			
		||||
 | 
			
		||||
        Mockito.when(ovsdbClient.transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList())).thenReturn(futureResult);
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> awlanColumns = new HashMap<>();
 | 
			
		||||
        awlanColumns.put("mqtt_settings", com.vmware.ovsdb.protocol.operation.notation.Map
 | 
			
		||||
                .of(ImmutableMap.of("broker", "192.168.1.101", "port", "1883")));
 | 
			
		||||
        awlanColumns.put("redirector_addr", Atom.string(REDIRECT_ADDR));
 | 
			
		||||
        awlanColumns.put("manager_addr", Atom.string(MGR_ADDR));
 | 
			
		||||
        awlanColumns.put("platform_version", Atom.string(PLATFORM_VERSION));
 | 
			
		||||
        awlanColumns.put("firmware_version", Atom.string(FW_VERSION));
 | 
			
		||||
        awlanColumns.put("revision", Atom.string(REVISION));
 | 
			
		||||
        awlanColumns.put("sku_number", Atom.string(SKU_NUMBER));
 | 
			
		||||
        awlanColumns.put("serial_number", Atom.string(SERIAL_NUM));
 | 
			
		||||
        awlanColumns.put("model", Atom.string(MODEL));
 | 
			
		||||
        Row awlanRow = new Row(awlanColumns);
 | 
			
		||||
 | 
			
		||||
        List<Row> awlanRows = ImmutableList.of(awlanRow);
 | 
			
		||||
 | 
			
		||||
        OperationResult[] awlanResult = new OperationResult[] { new SelectResult(awlanRows) };
 | 
			
		||||
        java.util.Map<String, Value> inetWanColumns = new HashMap<>();
 | 
			
		||||
        inetWanColumns.put("inet_addr", Atom.string(WAN_IP));
 | 
			
		||||
        inetWanColumns.put("hwaddr", Atom.string(WAN_MAC));
 | 
			
		||||
        inetWanColumns.put("if_name", Atom.string(WAN_IF_NAME));
 | 
			
		||||
        inetWanColumns.put("if_type", Atom.string(WAN_IF_TYPE));
 | 
			
		||||
 | 
			
		||||
        Row inetWanRow = new Row(inetWanColumns);
 | 
			
		||||
 | 
			
		||||
        List<Row> inetWanRows = ImmutableList.of(inetWanRow);
 | 
			
		||||
 | 
			
		||||
        OperationResult[] inetWanResult = new OperationResult[] { new SelectResult(inetWanRows) };
 | 
			
		||||
 | 
			
		||||
        OperationResult[] errorResult = new OperationResult[] { new ErrorResult("Error", "Error") };
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> inetLanColumns = new HashMap<>();
 | 
			
		||||
        inetLanColumns.put("inet_addr", Atom.string(LAN_IP));
 | 
			
		||||
        inetLanColumns.put("hwaddr", Atom.string(LAN_MAC));
 | 
			
		||||
        inetLanColumns.put("if_name", Atom.string(LAN_IF_NAME));
 | 
			
		||||
        inetLanColumns.put("if_type", Atom.string(LAN_IF_TYPE));
 | 
			
		||||
 | 
			
		||||
        Row inetLanRow = new Row(inetLanColumns);
 | 
			
		||||
 | 
			
		||||
        List<Row> inetLanRows = ImmutableList.of(inetLanRow);
 | 
			
		||||
 | 
			
		||||
        OperationResult[] inetLanResult = new OperationResult[] { new SelectResult(inetLanRows) };
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> wifiRadioStateColumns = new HashMap<>();
 | 
			
		||||
        wifiRadioStateColumns.put("freq_band", Atom.string("2.4G"));
 | 
			
		||||
        wifiRadioStateColumns.put("if_name", Atom.string("home-ap-24"));
 | 
			
		||||
        Row wifiRadioStateRow = new Row(wifiRadioStateColumns);
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> wifiRadioStateColumns2 = new HashMap<>();
 | 
			
		||||
        wifiRadioStateColumns2.put("freq_band", Atom.string("5GL"));
 | 
			
		||||
        wifiRadioStateColumns2.put("if_name", Atom.string("home-ap-l50"));
 | 
			
		||||
        Row wifiRadioStateRow2 = new Row(wifiRadioStateColumns2);
 | 
			
		||||
 | 
			
		||||
        java.util.Map<String, Value> wifiRadioStateColumns3 = new HashMap<>();
 | 
			
		||||
        wifiRadioStateColumns3.put("freq_band", Atom.string("5GU"));
 | 
			
		||||
        wifiRadioStateColumns3.put("if_name", Atom.string("home-ap-u50"));
 | 
			
		||||
        Row wifiRadioStateRow3 = new Row(wifiRadioStateColumns3);
 | 
			
		||||
 | 
			
		||||
        List<Row> wifiRadioStateRows = ImmutableList.of(wifiRadioStateRow, wifiRadioStateRow2, wifiRadioStateRow3);
 | 
			
		||||
 | 
			
		||||
        OperationResult[] wifiRadioStateResult = new OperationResult[] { new SelectResult(wifiRadioStateRows) };
 | 
			
		||||
 | 
			
		||||
        // No 'WAN' for this test, will have an ERROR
 | 
			
		||||
        Mockito.when(futureResult.get(Mockito.anyLong(), Mockito.eq(TimeUnit.SECONDS))).thenReturn(awlanResult)
 | 
			
		||||
                .thenReturn(errorResult).thenReturn(errorResult).thenReturn(inetLanResult)
 | 
			
		||||
                .thenReturn(wifiRadioStateResult);
 | 
			
		||||
        ConnectNodeInfo connectNodeInfo = ovsdbDao.getConnectNodeInfo(ovsdbClient);
 | 
			
		||||
        assertNotNull(connectNodeInfo.firmwareVersion);
 | 
			
		||||
        assertNotNull(connectNodeInfo.model);
 | 
			
		||||
        assertNotNull(connectNodeInfo.skuNumber);
 | 
			
		||||
        assertNotNull(connectNodeInfo.platformVersion);
 | 
			
		||||
        assertNotNull(connectNodeInfo.serialNumber);
 | 
			
		||||
        assertNotNull(connectNodeInfo.mqttSettings);
 | 
			
		||||
        assertNotNull(connectNodeInfo.redirectorAddr);
 | 
			
		||||
        assertNotNull(connectNodeInfo.managerAddr);
 | 
			
		||||
 | 
			
		||||
        assertNull(connectNodeInfo.ifName);
 | 
			
		||||
        assertNull(connectNodeInfo.ifType);
 | 
			
		||||
        assertNull(connectNodeInfo.ipV4Address);
 | 
			
		||||
        assertNull(connectNodeInfo.macAddress);
 | 
			
		||||
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIfName);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIfType);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIpV4Address);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanMacAddress);
 | 
			
		||||
 | 
			
		||||
        assert (connectNodeInfo.wifiRadioStates.entrySet().size() == 3);
 | 
			
		||||
        Mockito.verify(ovsdbClient, Mockito.times(5)).transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList());
 | 
			
		||||
        Mockito.clearInvocations(ovsdbClient);
 | 
			
		||||
 | 
			
		||||
        // No 'LAN' for this test, will have an ERROR
 | 
			
		||||
        Mockito.when(futureResult.get(Mockito.anyLong(), Mockito.eq(TimeUnit.SECONDS))).thenReturn(awlanResult)
 | 
			
		||||
                .thenReturn(inetWanResult).thenReturn(errorResult).thenReturn(wifiRadioStateResult);
 | 
			
		||||
        connectNodeInfo = ovsdbDao.getConnectNodeInfo(ovsdbClient);
 | 
			
		||||
        assertNotNull(connectNodeInfo.firmwareVersion);
 | 
			
		||||
        assertNotNull(connectNodeInfo.model);
 | 
			
		||||
        assertNotNull(connectNodeInfo.skuNumber);
 | 
			
		||||
        assertNotNull(connectNodeInfo.platformVersion);
 | 
			
		||||
        assertNotNull(connectNodeInfo.serialNumber);
 | 
			
		||||
        assertNotNull(connectNodeInfo.mqttSettings);
 | 
			
		||||
        assertNotNull(connectNodeInfo.redirectorAddr);
 | 
			
		||||
        assertNotNull(connectNodeInfo.managerAddr);
 | 
			
		||||
 | 
			
		||||
        assertNotNull(connectNodeInfo.ifName);
 | 
			
		||||
        assertNotNull(connectNodeInfo.ifType);
 | 
			
		||||
        assertNotNull(connectNodeInfo.ipV4Address);
 | 
			
		||||
        assertNotNull(connectNodeInfo.macAddress);
 | 
			
		||||
 | 
			
		||||
        assertNull(connectNodeInfo.lanIfName);
 | 
			
		||||
        assertNull(connectNodeInfo.lanIfType);
 | 
			
		||||
        assertNull(connectNodeInfo.lanIpV4Address);
 | 
			
		||||
        assertNull(connectNodeInfo.lanMacAddress);
 | 
			
		||||
 | 
			
		||||
        assert (connectNodeInfo.wifiRadioStates.entrySet().size() == 3);
 | 
			
		||||
        Mockito.verify(ovsdbClient, Mockito.times(4)).transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList());
 | 
			
		||||
        Mockito.clearInvocations(ovsdbClient);
 | 
			
		||||
 | 
			
		||||
        // No 'Wifi_Radio_State data' for this test, will have an ERROR
 | 
			
		||||
        Mockito.when(futureResult.get(Mockito.anyLong(), Mockito.eq(TimeUnit.SECONDS))).thenReturn(awlanResult)
 | 
			
		||||
                .thenReturn(inetWanResult).thenReturn(inetLanResult).thenReturn(errorResult);
 | 
			
		||||
        connectNodeInfo = ovsdbDao.getConnectNodeInfo(ovsdbClient);
 | 
			
		||||
 | 
			
		||||
        assertNotNull(connectNodeInfo.firmwareVersion);
 | 
			
		||||
        assertNotNull(connectNodeInfo.model);
 | 
			
		||||
        assertNotNull(connectNodeInfo.skuNumber);
 | 
			
		||||
        assertNotNull(connectNodeInfo.platformVersion);
 | 
			
		||||
        assertNotNull(connectNodeInfo.serialNumber);
 | 
			
		||||
        assertNotNull(connectNodeInfo.mqttSettings);
 | 
			
		||||
        assertNotNull(connectNodeInfo.redirectorAddr);
 | 
			
		||||
        assertNotNull(connectNodeInfo.managerAddr);
 | 
			
		||||
 | 
			
		||||
        assertNotNull(connectNodeInfo.ifName);
 | 
			
		||||
        assertNotNull(connectNodeInfo.ifType);
 | 
			
		||||
        assertNotNull(connectNodeInfo.ipV4Address);
 | 
			
		||||
        assertNotNull(connectNodeInfo.macAddress);
 | 
			
		||||
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIfName);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIfType);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIpV4Address);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanMacAddress);
 | 
			
		||||
 | 
			
		||||
        assert (connectNodeInfo.wifiRadioStates.isEmpty());
 | 
			
		||||
 | 
			
		||||
        Mockito.verify(ovsdbClient, Mockito.times(4)).transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList());
 | 
			
		||||
        Mockito.clearInvocations(ovsdbClient);
 | 
			
		||||
 | 
			
		||||
        // No 'AWLAN_Node data' for this test, will have an ERROR
 | 
			
		||||
        Mockito.when(futureResult.get(Mockito.anyLong(), Mockito.eq(TimeUnit.SECONDS))).thenReturn(errorResult)
 | 
			
		||||
                .thenReturn(inetWanResult).thenReturn(inetLanResult).thenReturn(wifiRadioStateResult);
 | 
			
		||||
        connectNodeInfo = ovsdbDao.getConnectNodeInfo(ovsdbClient);
 | 
			
		||||
        assertNull(connectNodeInfo.firmwareVersion);
 | 
			
		||||
        assertNull(connectNodeInfo.model);
 | 
			
		||||
        assertNull(connectNodeInfo.skuNumber);
 | 
			
		||||
        assertNull(connectNodeInfo.platformVersion);
 | 
			
		||||
        assertNull(connectNodeInfo.serialNumber);
 | 
			
		||||
        assertNull(connectNodeInfo.mqttSettings);
 | 
			
		||||
        assertNull(connectNodeInfo.redirectorAddr);
 | 
			
		||||
        assertNull(connectNodeInfo.managerAddr);
 | 
			
		||||
 | 
			
		||||
        assertNotNull(connectNodeInfo.ifName);
 | 
			
		||||
        assertNotNull(connectNodeInfo.ifType);
 | 
			
		||||
        assertNotNull(connectNodeInfo.ipV4Address);
 | 
			
		||||
        assertNotNull(connectNodeInfo.macAddress);
 | 
			
		||||
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIfName);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIfType);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanIpV4Address);
 | 
			
		||||
        assertNotNull(connectNodeInfo.lanMacAddress);
 | 
			
		||||
 | 
			
		||||
        assert (connectNodeInfo.wifiRadioStates.entrySet().size() == 3);
 | 
			
		||||
 | 
			
		||||
        Mockito.verify(ovsdbClient, Mockito.times(4)).transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList());
 | 
			
		||||
        Mockito.clearInvocations(ovsdbClient);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Test
 | 
			
		||||
    public void testObsdbDaoEnableNetworkProbe() throws Exception {
 | 
			
		||||
 | 
			
		||||
        Uuid rowUuid = Uuid.of(UUID.randomUUID());
 | 
			
		||||
 | 
			
		||||
        OperationResult[] wifiStatsConfigEnableNetworkProbe = new OperationResult[] { new InsertResult(rowUuid) };
 | 
			
		||||
        OperationResult[] wifiStatsConfigEnableNetworkProbe = new OperationResult[] {new InsertResult(rowUuid)};
 | 
			
		||||
 | 
			
		||||
        Mockito.when(futureResult.get(30L, TimeUnit.SECONDS)).thenReturn(wifiStatsConfigEnableNetworkProbe);
 | 
			
		||||
 | 
			
		||||
@@ -635,9 +366,8 @@ public class OvsdbDaoTest {
 | 
			
		||||
    @Test
 | 
			
		||||
    public void testObsdbDaoEnableNetworkProbeError() throws Exception {
 | 
			
		||||
 | 
			
		||||
        OperationResult[] wifiStatsConfigEnableNetworkProbeFail = new OperationResult[] { new ErrorResult(
 | 
			
		||||
                "constraint violation",
 | 
			
		||||
                "network_probe is not one of the allowed values ([capacity, client, device, essid, neighbor, quality, radio, rssi, steering, survey])") };
 | 
			
		||||
        OperationResult[] wifiStatsConfigEnableNetworkProbeFail = new OperationResult[] {new ErrorResult("constraint violation",
 | 
			
		||||
                "network_probe is not one of the allowed values ([capacity, client, device, essid, neighbor, quality, radio, rssi, steering, survey])")};
 | 
			
		||||
 | 
			
		||||
        Mockito.when(futureResult.get(30L, TimeUnit.SECONDS)).thenReturn(wifiStatsConfigEnableNetworkProbeFail);
 | 
			
		||||
 | 
			
		||||
@@ -652,19 +382,16 @@ public class OvsdbDaoTest {
 | 
			
		||||
    @Test
 | 
			
		||||
    public void testProcessNewChannelsRequest() throws Exception {
 | 
			
		||||
 | 
			
		||||
        OperationResult[] testProcessNewChannelsRequestResult = new OperationResult[] { new UpdateResult(1),
 | 
			
		||||
                new UpdateResult(1), new UpdateResult(1), new UpdateResult(1), new UpdateResult(1),
 | 
			
		||||
                new UpdateResult(1) };
 | 
			
		||||
        OperationResult[] testProcessNewChannelsRequestResult = new OperationResult[] {new UpdateResult(1), new UpdateResult(1), new UpdateResult(1),
 | 
			
		||||
                new UpdateResult(1), new UpdateResult(1), new UpdateResult(1)};
 | 
			
		||||
 | 
			
		||||
        Mockito.when(futureResult.get(30L, TimeUnit.SECONDS)).thenReturn(testProcessNewChannelsRequestResult);
 | 
			
		||||
 | 
			
		||||
        Mockito.when(ovsdbClient.transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList())).thenReturn(futureResult);
 | 
			
		||||
 | 
			
		||||
        ovsdbDao.processNewChannelsRequest(ovsdbClient,
 | 
			
		||||
                Map.of(RadioType.is2dot4GHz, Integer.valueOf(1), RadioType.is5GHzL, Integer.valueOf(40),
 | 
			
		||||
                        RadioType.is5GHzU, Integer.valueOf(153)),
 | 
			
		||||
                Map.of(RadioType.is2dot4GHz, Integer.valueOf(6), RadioType.is5GHzL, Integer.valueOf(36),
 | 
			
		||||
                        RadioType.is5GHzU, Integer.valueOf(149)));
 | 
			
		||||
                Map.of(RadioType.is2dot4GHz, Integer.valueOf(1), RadioType.is5GHzL, Integer.valueOf(40), RadioType.is5GHzU, Integer.valueOf(153)),
 | 
			
		||||
                Map.of(RadioType.is2dot4GHz, Integer.valueOf(6), RadioType.is5GHzL, Integer.valueOf(36), RadioType.is5GHzU, Integer.valueOf(149)));
 | 
			
		||||
 | 
			
		||||
        Mockito.verify(futureResult).get(30L, TimeUnit.SECONDS);
 | 
			
		||||
 | 
			
		||||
@@ -673,8 +400,7 @@ public class OvsdbDaoTest {
 | 
			
		||||
    @Test(expected = RuntimeException.class)
 | 
			
		||||
    public void testObsdbDaoEnableNetworkProbeException() throws Exception {
 | 
			
		||||
 | 
			
		||||
        Mockito.when(futureResult.get(30L, TimeUnit.SECONDS))
 | 
			
		||||
                .thenThrow(new OvsdbClientException("OvsdbClientException"));
 | 
			
		||||
        Mockito.when(futureResult.get(30L, TimeUnit.SECONDS)).thenThrow(new OvsdbClientException("OvsdbClientException"));
 | 
			
		||||
 | 
			
		||||
        Mockito.when(ovsdbClient.transact(Mockito.eq(OvsdbDao.ovsdbName), Mockito.anyList())).thenReturn(futureResult);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user