diff options
author | Kai Shi <kaishi@google.com> | 2020-06-25 23:29:12 -0700 |
---|---|---|
committer | Kai Shi <kaishi@google.com> | 2020-06-29 18:39:54 -0700 |
commit | 2800851c885bd0f228e42a587c1db33da98f29ce (patch) | |
tree | 017335d573c8abeaebfba1c9c5317e01aaf95df5 /tests | |
parent | 90723104f67badbfd95ca374fea2b514d3a314f3 (diff) |
Bug fix channel utilization during high traffic
In some wifi hal implmentations, ccaBusyTime includes the device's own packet Rx time which results in high channel utilization during full-buffer downlink throughput test. The fix is to add config_wifiChannelUtilizationOverridingEnabled to allow OEM to use fixed band-dependent values. These band-dependent values are programmable through overlay.
Test: atest com.android.server.wifi
Test: manually check reported cca level during iperf downlink and uplink test
Bug: 159866355
Change-Id: If8432929f767ceaf6f18a7d269636dcaf909f33a
Merged-In: I6e131f149d242e5dbf0b8b0087303e85ed428f9f
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java | 30 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java | 2 |
2 files changed, 30 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java b/tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java index 31fc7b7a9..bb6ff74a3 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java @@ -30,10 +30,13 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.*; import static org.mockito.Mockito.validateMockitoUsage; +import android.content.Context; + import androidx.test.filters.SmallTest; import com.android.server.wifi.WifiLinkLayerStats.ChannelStats; import com.android.server.wifi.util.InformationElementUtil.BssLoad; +import com.android.wifi.resources.R; import org.junit.After; import org.junit.Before; @@ -48,13 +51,19 @@ import org.mockito.MockitoAnnotations; public class WifiChannelUtilizationTest extends WifiBaseTest { private WifiChannelUtilization mWifiChannelUtilization; @Mock private Clock mClock; + @Mock Context mContext; + MockResources mMockResources = new MockResources(); /** * Called before each test */ @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); - mWifiChannelUtilization = new WifiChannelUtilization(mClock); + when(mContext.getResources()).thenReturn(mMockResources); + mMockResources.setBoolean( + R.bool.config_wifiChannelUtilizationOverrideEnabled, + false); + mWifiChannelUtilization = new WifiChannelUtilization(mClock, mContext); mWifiChannelUtilization.init(null); } @@ -428,4 +437,23 @@ public class WifiChannelUtilizationTest extends WifiBaseTest { mWifiChannelUtilization.setUtilizationRatio(freq, utilizationRatio); assertEquals(utilizationRatio, mWifiChannelUtilization.getUtilizationRatio(freq)); } + + @Test + public void verifyOverridingUtilizationRatio() throws Exception { + mMockResources.setBoolean( + R.bool.config_wifiChannelUtilizationOverrideEnabled, + true); + mMockResources.setInteger( + R.integer.config_wifiChannelUtilizationOverride2g, + 60); + mMockResources.setInteger( + R.integer.config_wifiChannelUtilizationOverride5g, + 20); + mMockResources.setInteger( + R.integer.config_wifiChannelUtilizationOverride6g, + 10); + assertEquals(60, mWifiChannelUtilization.getUtilizationRatio(2412)); + assertEquals(20, mWifiChannelUtilization.getUtilizationRatio(5810)); + assertEquals(10, mWifiChannelUtilization.getUtilizationRatio(6710)); + } } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java b/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java index 61979f1e8..b1eb5e9a8 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java @@ -212,7 +212,7 @@ public class WifiDataStallTest extends WifiBaseTest { } /** - * Verify throughtput when Rx link speed is unavailable. + * Verify throughput when Rx link speed is unavailable. * Also verify the logging of channel utilization and throughput. */ @Test |