Fix minor bugs in WifiRssiTest and WifiSensitivityTest

This CL fixes minor metric reporting bugs and test case3 generation bugs
introduced to WifiRssiTest and WifiSensitivityTest.

Test: Done
Bug: None

Change-Id: If23dc38bd1bdc9682c41633b975478854749ffab
Signed-off-by: Omar El Ayach <oelayach@google.com>
diff --git a/acts/tests/google/wifi/WifiSensitivityTest.py b/acts/tests/google/wifi/WifiSensitivityTest.py
index 1511923..6e32e0e 100644
--- a/acts/tests/google/wifi/WifiSensitivityTest.py
+++ b/acts/tests/google/wifi/WifiSensitivityTest.py
@@ -243,15 +243,15 @@
         # calculate average metrics
         metrics_dict = collections.OrderedDict()
         id_fields = ['channel', 'mode', 'num_streams', 'chain_mask']
-        for test_id, channel in itertools.product(
-                testclass_results_dict.keys(), channels_tested):
-            metric_tag = collections.OrderedDict(test_id, channel=channel)
-            metric_tag = self.extract_test_id(metric_tag, id_fields)
-            metric_tag = tuple(metric_tag.items())
-            metrics_dict.setdefault(metric_tag, [])
-            sensitivity_result = testclass_results_dict[test_id][channel]
-            if sensitivity_result != '':
-                metrics_dict[metric_tag].append(sensitivity_result)
+        for test_id in testclass_results_dict.keys():
+            for channel in testclass_results_dict[test_id].keys():
+                metric_tag = collections.OrderedDict(test_id, channel=channel)
+                metric_tag = self.extract_test_id(metric_tag, id_fields)
+                metric_tag = tuple(metric_tag.items())
+                metrics_dict.setdefault(metric_tag, [])
+                sensitivity_result = testclass_results_dict[test_id][channel]
+                if sensitivity_result != '':
+                    metrics_dict[metric_tag].append(sensitivity_result)
         for metric_tag_tuple, metric_data in metrics_dict.items():
             metric_tag_dict = collections.OrderedDict(metric_tag_tuple)
             metric_tag = 'ch{}_{}_nss{}_chain{}'.format(
@@ -547,8 +547,10 @@
         """Function that auto-generates test cases for a test class."""
         test_cases = []
         for channel in channels:
-            requested_modes = set(modes).intersection(
-                set(self.VALID_TEST_CONFIGS[channel]))
+            requested_modes = [
+                mode for mode in modes
+                if mode in self.VALID_TEST_CONFIGS[channel]
+            ]
             for mode in requested_modes:
                 if 'VHT' in mode:
                     rates = self.VALID_RATES[mode]
@@ -774,8 +776,10 @@
         """Function that auto-generates test cases for a test class."""
         test_cases = []
         for channel in channels:
-            requested_modes = set(modes).intersection(
-                set(self.VALID_TEST_CONFIGS[channel]))
+            requested_modes = [
+                mode for mode in modes
+                if mode in self.VALID_TEST_CONFIGS[channel]
+            ]
             for mode in requested_modes:
                 if 'VHT' in mode:
                     valid_rates = self.VALID_RATES[mode]