Merge "Fix RSSI poll interval and renaming test_params" am: 3d39d5922e am: 54a8d70080
am: eb1cd6c68f

Test: Done
Bug: 65563975

Change-Id: Ia353a84aafe1caf371b117386068cebb52f8e198
(cherry picked from commit dd5b22053c479938eb8273aed19343fdedbab5e2)
diff --git a/acts/tests/google/wifi/WifiRssiTest.py b/acts/tests/google/wifi/WifiRssiTest.py
index 167343d..aa95b23 100644
--- a/acts/tests/google/wifi/WifiRssiTest.py
+++ b/acts/tests/google/wifi/WifiRssiTest.py
@@ -31,7 +31,6 @@
 
 SHORT_SLEEP = 1
 MED_SLEEP = 6
-TIME_TO_POLL = 0.13
 STATION_DUMP = "iw wlan0 station dump"
 SCAN = "wpa_cli scan"
 SCAN_RESULTS = "wpa_cli scan_results"
@@ -46,9 +45,10 @@
 
     def setup_class(self):
         self.dut = self.android_devices[0]
-        req_params = ["test_params", "main_network"]
+        req_params = ["rssi_test_params", "main_network"]
         opt_params = ["RetailAccessPoints"]
         self.unpack_userparams(req_params, opt_params)
+        self.test_params = self.rssi_test_params
         self.num_atten = self.attenuators[0].instrument.num_atten
         self.iperf_server = self.iperf_servers[0]
         self.access_points = retail_ap.create(self.RetailAccessPoints)
@@ -371,6 +371,7 @@
             "chain_1_rssi": []
         }
         for idx in range(num_measurements):
+            measurement_start_time = time.time()
             # Get signal poll RSSI
             signal_poll_output = self.dut.adb.shell(SIGNAL_POLL)
             match = re.search("RSSI=.*", signal_poll_output)
@@ -400,7 +401,8 @@
             else:
                 connected_rssi["chain_0_rssi"].append(RSSI_ERROR_VAL)
                 connected_rssi["chain_1_rssi"].append(RSSI_ERROR_VAL)
-            time.sleep(max(0, polling_frequency - TIME_TO_POLL))
+            measurement_elapsed_time = time.time() - measurement_start_time
+            time.sleep(max(0, polling_frequency - measurement_elapsed_time))
 
         # Compute mean RSSIs. Only average valid readings.
         # Output RSSI_ERROR_VAL if no valid connected readings found.