Update Wifi performances tests to enable 11ax tests
This CL enables testing both 11ac and 11ax tests using generically named
test cases so that test suites do not need to be replicated for each
different wifi standard. WiFi 6 phones will be tested in WiFi 6 setups
and WiFi 5 in WiFi 5. It is still possible to specify technology, e.g.,
test a WiFi 6 DUT in WiFi 5 mode.
Test: Done
Bug: None
Signed-off-by: Omar El Ayach <oelayach@google.com>
Change-Id: I2bb387ac41f5275d362c9d6f11e58e5160932dcb
diff --git a/acts_tests/tests/google/wifi/WifiPingTest.py b/acts_tests/tests/google/wifi/WifiPingTest.py
index 0fb3823..4d25f26 100644
--- a/acts_tests/tests/google/wifi/WifiPingTest.py
+++ b/acts_tests/tests/google/wifi/WifiPingTest.py
@@ -91,7 +91,7 @@
if self.testclass_params.get('airplane_mode', 1):
self.log.info('Turning on airplane mode.')
asserts.assert_true(utils.force_airplane_mode(self.dut, True),
- "Can not turn on airplane mode.")
+ 'Can not turn on airplane mode.')
wutils.wifi_toggle_state(self.dut, True)
# Configure test retries
@@ -193,7 +193,7 @@
'LLStats at Range: {}'.format(
result['range'], result['llstats_at_range']))
if result['peak_throughput_pct'] < 95:
- asserts.fail("(RESULT NOT RELIABLE) {}".format(test_message))
+ asserts.fail('(RESULT NOT RELIABLE) {}'.format(test_message))
# If pass, set Blackbox metric
if self.publish_testcase_metrics:
@@ -299,7 +299,7 @@
self.sniffer.start_capture(
testcase_params['test_network'],
chan=int(testcase_params['channel']),
- bw=int(testcase_params['mode'][3:]),
+ bw=testcase_params['bandwidth'],
duration=testcase_params['ping_duration'] *
len(testcase_params['atten_range']) + self.TEST_TIMEOUT)
# Run ping and sweep attenuation as needed
@@ -409,7 +409,7 @@
self.atten_dut_chain_map[testcase_params[
'channel']] = wputils.get_current_atten_dut_chain_map(
self.attenuators, self.dut, self.ping_server)
- self.log.info("Current Attenuator-DUT Chain Map: {}".format(
+ self.log.info('Current Attenuator-DUT Chain Map: {}'.format(
self.atten_dut_chain_map[testcase_params['channel']]))
for idx, atten in enumerate(self.attenuators):
if self.atten_dut_chain_map[testcase_params['channel']][
@@ -511,18 +511,22 @@
def generate_test_cases(self, ap_power, channels, modes, chain_mask,
test_types):
+ """Function that auto-generates test cases for a test class."""
test_cases = []
allowed_configs = {
- 'VHT20': [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 149, 153,
- 157, 161
+ 20: [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 64, 100,
+ 116, 132, 140, 149, 153, 157, 161
],
- 'VHT40': [36, 44, 149, 157],
- 'VHT80': [36, 149]
+ 40: [36, 44, 100, 149, 157],
+ 80: [36, 100, 149],
+ 160: [36]
}
+
for channel, mode, chain, test_type in itertools.product(
channels, modes, chain_mask, test_types):
- if channel not in allowed_configs[mode]:
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
+ if channel not in allowed_configs[bandwidth]:
continue
testcase_name = '{}_ch{}_{}_ch{}'.format(test_type, channel, mode,
chain)
@@ -530,6 +534,7 @@
ap_power=ap_power,
channel=channel,
mode=mode,
+ bandwidth=bandwidth,
chain_mask=chain)
setattr(self, testcase_name,
partial(self._test_ping, testcase_params))
@@ -543,7 +548,7 @@
self.tests = self.generate_test_cases(
ap_power='standard',
channels=[1, 6, 11, 36, 40, 44, 48, 149, 153, 157, 161],
- modes=['VHT20', 'VHT40', 'VHT80'],
+ modes=['bw20', 'bw40', 'bw80'],
test_types=[
'test_ping_range', 'test_fast_ping_rtt', 'test_slow_ping_rtt'
],
@@ -557,7 +562,7 @@
ap_power='standard',
chain_mask=['0', '1', '2x2'],
channels=[1, 6, 11, 36, 40, 44, 48, 149, 153, 157, 161],
- modes=['VHT20', 'VHT40', 'VHT80'],
+ modes=['bw20', 'bw40', 'bw80'],
test_types=['test_ping_range'])
@@ -568,7 +573,7 @@
ap_power='low_power',
chain_mask=['0', '1', '2x2'],
channels=[1, 6, 11, 36, 40, 44, 48, 149, 153, 157, 161],
- modes=['VHT20', 'VHT40', 'VHT80'],
+ modes=['bw20', 'bw40', 'bw80'],
test_types=['test_ping_range'])
@@ -710,16 +715,18 @@
positions):
test_cases = []
allowed_configs = {
- 'VHT20': [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 149, 153,
- 157, 161
+ 20: [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 64, 100,
+ 116, 132, 140, 149, 153, 157, 161
],
- 'VHT40': [36, 44, 149, 157],
- 'VHT80': [36, 149]
+ 40: [36, 44, 100, 149, 157],
+ 80: [36, 100, 149],
+ 160: [36]
}
for channel, mode, position in itertools.product(
channels, modes, positions):
- if channel not in allowed_configs[mode]:
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
+ if channel not in allowed_configs[bandwidth]:
continue
testcase_name = 'test_ping_range_ch{}_{}_pos{}'.format(
channel, mode, position)
@@ -728,6 +735,7 @@
ap_power=ap_power,
channel=channel,
mode=mode,
+ bandwidth=bandwidth,
chain_mask='2x2',
chamber_mode=chamber_mode,
total_positions=len(positions),
@@ -743,7 +751,7 @@
WifiOtaPingTest.__init__(self, controllers)
self.tests = self.generate_test_cases(ap_power='standard',
channels=[6, 36, 149],
- modes=['VHT20'],
+ modes=['bw20'],
chamber_mode='orientation',
positions=list(range(0, 360,
10)))
@@ -755,7 +763,7 @@
self.tests = self.generate_test_cases(
ap_power='standard',
channels=[1, 6, 11, 36, 40, 44, 48, 149, 153, 157, 161],
- modes=['VHT20'],
+ modes=['bw20'],
chamber_mode='orientation',
positions=list(range(0, 360, 45)))
@@ -765,7 +773,7 @@
WifiOtaPingTest.__init__(self, controllers)
self.tests = self.generate_test_cases(ap_power='standard',
channels=[6, 36, 149],
- modes=['VHT20'],
+ modes=['bw20'],
chamber_mode='stepped stirrers',
positions=list(range(100)))
@@ -775,7 +783,7 @@
WifiOtaPingTest.__init__(self, controllers)
self.tests = self.generate_test_cases(ap_power='low_power',
channels=[6, 36, 149],
- modes=['VHT20'],
+ modes=['bw20'],
chamber_mode='orientation',
positions=list(range(0, 360,
10)))
@@ -787,7 +795,7 @@
self.tests = self.generate_test_cases(
ap_power='low_power',
channels=[1, 6, 11, 36, 40, 44, 48, 149, 153, 157, 161],
- modes=['VHT20'],
+ modes=['bw20'],
chamber_mode='orientation',
positions=list(range(0, 360, 45)))
@@ -797,6 +805,6 @@
WifiOtaPingTest.__init__(self, controllers)
self.tests = self.generate_test_cases(ap_power='low_power',
channels=[6, 36, 149],
- modes=['VHT20'],
+ modes=['bw20'],
chamber_mode='stepped stirrers',
positions=list(range(100)))
\ No newline at end of file
diff --git a/acts_tests/tests/google/wifi/WifiRssiTest.py b/acts_tests/tests/google/wifi/WifiRssiTest.py
index 3055985..1c0c6df 100644
--- a/acts_tests/tests/google/wifi/WifiRssiTest.py
+++ b/acts_tests/tests/google/wifi/WifiRssiTest.py
@@ -84,7 +84,7 @@
if self.testclass_params.get('airplane_mode', 1):
self.log.info('Turning on airplane mode.')
asserts.assert_true(utils.force_airplane_mode(self.dut, True),
- "Can not turn on airplane mode.")
+ 'Can not turn on airplane mode.')
wutils.wifi_toggle_state(self.dut, True)
def teardown_test(self):
@@ -785,17 +785,19 @@
"""Function that auto-generates test cases for a test class."""
test_cases = []
allowed_configs = {
- 'VHT20': [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 149, 153,
- 157, 161
+ 20: [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 64, 100,
+ 116, 132, 140, 149, 153, 157, 161
],
- 'VHT40': [36, 44, 149, 157],
- 'VHT80': [36, 149]
+ 40: [36, 44, 100, 149, 157],
+ 80: [36, 100, 149],
+ 160: [36]
}
for channel, mode, traffic_mode, test_type in itertools.product(
channels, modes, traffic_modes, test_types):
- if channel not in allowed_configs[mode]:
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
+ if channel not in allowed_configs[bandwidth]:
continue
test_name = test_type + '_ch{}_{}_{}'.format(
channel, mode, traffic_mode)
@@ -817,7 +819,7 @@
super().__init__(controllers)
self.tests = self.generate_test_cases(
['test_rssi_stability', 'test_rssi_vs_atten'], [1, 2, 6, 10, 11],
- ['VHT20'], ['ActiveTraffic'])
+ ['bw20'], ['ActiveTraffic'])
class WifiRssi_5GHz_ActiveTraffic_Test(WifiRssiTest):
@@ -825,7 +827,7 @@
super().__init__(controllers)
self.tests = self.generate_test_cases(
['test_rssi_stability', 'test_rssi_vs_atten'],
- [36, 40, 44, 48, 149, 153, 157, 161], ['VHT20', 'VHT40', 'VHT80'],
+ [36, 40, 44, 48, 149, 153, 157, 161], ['bw20', 'bw40', 'bw80'],
['ActiveTraffic'])
@@ -835,7 +837,7 @@
self.tests = self.generate_test_cases(
['test_rssi_stability', 'test_rssi_vs_atten'],
[1, 6, 11, 36, 40, 44, 48, 149, 153, 157, 161],
- ['VHT20', 'VHT40', 'VHT80'], ['ActiveTraffic'])
+ ['bw20', 'bw40', 'bw80'], ['ActiveTraffic'])
class WifiRssi_SampleChannels_NoTraffic_Test(WifiRssiTest):
@@ -843,7 +845,7 @@
super().__init__(controllers)
self.tests = self.generate_test_cases(
['test_rssi_stability', 'test_rssi_vs_atten'], [6, 36, 149],
- ['VHT20', 'VHT40', 'VHT80'], ['NoTraffic'])
+ ['bw20', 'bw40', 'bw80'], ['NoTraffic'])
class WifiRssiTrackingTest(WifiRssiTest):
@@ -851,7 +853,7 @@
super().__init__(controllers)
self.tests = self.generate_test_cases(['test_rssi_tracking'],
[6, 36, 149],
- ['VHT20', 'VHT40', 'VHT80'],
+ ['bw20', 'bw40', 'bw80'],
['ActiveTraffic', 'NoTraffic'])
@@ -964,10 +966,10 @@
Args:
testcase_params: dict containing test-specific parameters
"""
- if "rssi_over_orientation" in self.test_name:
+ if 'rssi_over_orientation' in self.test_name:
rssi_test_duration = self.testclass_params[
'rssi_over_orientation_duration']
- elif "rssi_variation" in self.test_name:
+ elif 'rssi_variation' in self.test_name:
rssi_test_duration = self.testclass_params[
'rssi_variation_duration']
@@ -1015,19 +1017,21 @@
chamber_modes, orientations):
test_cases = []
allowed_configs = {
- 'VHT20': [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 149, 153,
- 157, 161
+ 20: [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 64, 100,
+ 116, 132, 140, 149, 153, 157, 161
],
- 'VHT40': [36, 44, 149, 157],
- 'VHT80': [36, 149]
+ 40: [36, 44, 100, 149, 157],
+ 80: [36, 100, 149],
+ 160: [36]
}
for (channel, mode, traffic, chamber_mode, orientation,
test_type) in itertools.product(channels, modes, traffic_modes,
chamber_modes, orientations,
test_types):
- if channel not in allowed_configs[mode]:
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
+ if channel not in allowed_configs[bandwidth]:
continue
test_name = test_type + '_ch{}_{}_{}_{}deg'.format(
channel, mode, traffic, orientation)
@@ -1049,7 +1053,7 @@
def __init__(self, controllers):
super().__init__(controllers)
self.tests = self.generate_test_cases(['test_rssi_vs_atten'],
- [6, 36, 149], ['VHT20'],
+ [6, 36, 149], ['bw20'],
['ActiveTraffic'],
['orientation'],
list(range(0, 360, 45)))
@@ -1059,7 +1063,7 @@
def __init__(self, controllers):
WifiRssiTest.__init__(self, controllers)
self.tests = self.generate_test_cases(['test_rssi_variation'],
- [6, 36, 149], ['VHT20'],
+ [6, 36, 149], ['bw20'],
['ActiveTraffic'],
['StirrersOn'], [0])
@@ -1068,7 +1072,7 @@
def __init__(self, controllers):
WifiRssiTest.__init__(self, controllers)
self.tests = self.generate_test_cases(['test_rssi_over_orientation'],
- [6, 36, 149], ['VHT20'],
+ [6, 36, 149], ['bw20'],
['ActiveTraffic'],
['orientation'],
list(range(0, 360, 10)))
diff --git a/acts_tests/tests/google/wifi/WifiRvrTest.py b/acts_tests/tests/google/wifi/WifiRvrTest.py
index befcdad..2a2dcbe 100644
--- a/acts_tests/tests/google/wifi/WifiRvrTest.py
+++ b/acts_tests/tests/google/wifi/WifiRvrTest.py
@@ -99,7 +99,7 @@
for dev in self.android_devices:
self.log.info('Turning on airplane mode.')
asserts.assert_true(utils.force_airplane_mode(dev, True),
- "Can not turn on airplane mode.")
+ 'Can not turn on airplane mode.')
wutils.wifi_toggle_state(dev, True)
def teardown_test(self):
@@ -304,9 +304,11 @@
self.testcase_metric_logger.add_metric(
'peak_tput', rvr_result['metrics']['peak_tput'])
+ test_mode = rvr_result['ap_settings'][rvr_result['testcase_params']
+ ['band']]['bandwidth']
tput_below_limit = [
- tput < self.testclass_params['tput_metric_targets'][
- rvr_result['testcase_params']['mode']]['high']
+ tput <
+ self.testclass_params['tput_metric_targets'][test_mode]['high']
for tput in rvr_result['throughput_receive']
]
rvr_result['metrics']['high_tput_range'] = -1
@@ -324,8 +326,8 @@
'high_tput_range', rvr_result['metrics']['high_tput_range'])
tput_below_limit = [
- tput < self.testclass_params['tput_metric_targets'][
- rvr_result['testcase_params']['mode']]['low']
+ tput <
+ self.testclass_params['tput_metric_targets'][test_mode]['low']
for tput in rvr_result['throughput_receive']
]
for idx in range(len(tput_below_limit)):
@@ -374,7 +376,7 @@
self.sniffer.start_capture(
network=testcase_params['test_network'],
chan=int(testcase_params['channel']),
- bw=int(testcase_params['mode'][3:]),
+ bw=testcase_params['bandwidth'],
duration=self.testclass_params['iperf_duration'] / 5)
# Start iperf session
if self.testclass_params.get('monitor_rssi', 1):
@@ -470,9 +472,7 @@
Args:
testcase_params: dict containing AP and other test params
"""
- band = self.access_point.band_lookup_by_channel(
- testcase_params['channel'])
- if '2G' in band:
+ if '2G' in testcase_params['band']:
frequency = wutils.WifiEnums.channel_2G_to_freq[
testcase_params['channel']]
else:
@@ -482,8 +482,10 @@
self.access_point.set_region(self.testbed_params['DFS_region'])
else:
self.access_point.set_region(self.testbed_params['default_region'])
- self.access_point.set_channel(band, testcase_params['channel'])
- self.access_point.set_bandwidth(band, testcase_params['mode'])
+ self.access_point.set_channel(testcase_params['band'],
+ testcase_params['channel'])
+ self.access_point.set_bandwidth(testcase_params['band'],
+ testcase_params['mode'])
self.log.info('Access Point Configuration: {}'.format(
self.access_point.ap_settings))
@@ -512,7 +514,7 @@
self.sniffer.start_capture(
network={'SSID': testcase_params['test_network']['SSID']},
chan=testcase_params['channel'],
- bw=testcase_params['mode'][3:],
+ bw=testcase_params['bandwidth'],
duration=180)
try:
wutils.wifi_connect(self.sta_dut,
@@ -571,6 +573,7 @@
]
band = self.access_point.band_lookup_by_channel(
testcase_params['channel'])
+ testcase_params['band'] = band
testcase_params['test_network'] = self.main_network[band]
if testcase_params['traffic_type'] == 'TCP':
testcase_params['iperf_socket_size'] = self.testclass_params.get(
@@ -591,7 +594,9 @@
reverse_direction=1,
traffic_type=testcase_params['traffic_type'],
socket_size=testcase_params['iperf_socket_size'],
- num_processes=testcase_params['iperf_processes'])
+ num_processes=testcase_params['iperf_processes'],
+ udp_throughput=self.testclass_params['UDP_rates'][
+ testcase_params['mode']])
testcase_params['use_client_output'] = True
else:
testcase_params['iperf_args'] = wputils.get_iperf_arg_string(
@@ -599,7 +604,9 @@
reverse_direction=0,
traffic_type=testcase_params['traffic_type'],
socket_size=testcase_params['iperf_socket_size'],
- num_processes=testcase_params['iperf_processes'])
+ num_processes=testcase_params['iperf_processes'],
+ udp_throughput=self.testclass_params['UDP_rates'][
+ testcase_params['mode']])
testcase_params['use_client_output'] = False
return testcase_params
@@ -645,6 +652,7 @@
test_params = collections.OrderedDict(
channel=channel,
mode=mode,
+ bandwidth=bandwidth,
traffic_type=traffic_type,
traffic_direction=traffic_direction)
setattr(self, test_name, partial(self._test_rvr, test_params))
@@ -652,62 +660,12 @@
return test_cases
-# Classes defining test suites
-class WifiRvr_2GHz_Test(WifiRvrTest):
- def __init__(self, controllers):
- super().__init__(controllers)
- self.tests = self.generate_test_cases(channels=[1, 6, 11],
- modes=['VHT20'],
- traffic_types=['TCP'],
- traffic_directions=['DL', 'UL'])
-
-
-class WifiRvr_UNII1_Test(WifiRvrTest):
- def __init__(self, controllers):
- super().__init__(controllers)
- self.tests = self.generate_test_cases(
- channels=[36, 40, 44, 48],
- modes=['VHT20', 'VHT40', 'VHT80'],
- traffic_types=['TCP'],
- traffic_directions=['DL', 'UL'])
-
-
-class WifiRvr_UNII3_Test(WifiRvrTest):
- def __init__(self, controllers):
- super().__init__(controllers)
- self.tests = self.generate_test_cases(
- channels=[149, 153, 157, 161],
- modes=['VHT20', 'VHT40', 'VHT80'],
- traffic_types=['TCP'],
- traffic_directions=['DL', 'UL'])
-
-
-class WifiRvr_SampleDFS_Test(WifiRvrTest):
- def __init__(self, controllers):
- super().__init__(controllers)
- self.tests = self.generate_test_cases(
- channels=[64, 100, 116, 132, 140],
- modes=['VHT20', 'VHT40', 'VHT80'],
- traffic_types=['TCP'],
- traffic_directions=['DL', 'UL'])
-
-
-class WifiRvr_SampleUDP_Test(WifiRvrTest):
- def __init__(self, controllers):
- super().__init__(controllers)
- self.tests = self.generate_test_cases(
- channels=[6, 36, 149],
- modes=['VHT20', 'VHT40', 'VHT80'],
- traffic_types=['UDP'],
- traffic_directions=['DL', 'UL'])
-
-
class WifiRvr_TCP_Test(WifiRvrTest):
def __init__(self, controllers):
super().__init__(controllers)
self.tests = self.generate_test_cases(
channels=[1, 6, 11, 36, 40, 44, 48, 149, 153, 157, 161],
- modes=['VHT20', 'VHT40', 'VHT80'],
+ modes=['bw20', 'bw40', 'bw80', 'bw160'],
traffic_types=['TCP'],
traffic_directions=['DL', 'UL'])
@@ -732,6 +690,46 @@
traffic_directions=['DL', 'UL'])
+class WifiRvr_SampleUDP_Test(WifiRvrTest):
+ def __init__(self, controllers):
+ super().__init__(controllers)
+ self.tests = self.generate_test_cases(
+ channels=[6, 36, 149],
+ modes=['bw20', 'bw40', 'bw80', 'bw160'],
+ traffic_types=['UDP'],
+ traffic_directions=['DL', 'UL'])
+
+
+class WifiRvr_VHT_SampleUDP_Test(WifiRvrTest):
+ def __init__(self, controllers):
+ super().__init__(controllers)
+ self.tests = self.generate_test_cases(
+ channels=[6, 36, 149],
+ modes=['VHT20', 'VHT40', 'VHT80', 'VHT160'],
+ traffic_types=['UDP'],
+ traffic_directions=['DL', 'UL'])
+
+
+class WifiRvr_HE_SampleUDP_Test(WifiRvrTest):
+ def __init__(self, controllers):
+ super().__init__(controllers)
+ self.tests = self.generate_test_cases(
+ channels=[6, 36, 149],
+ modes=['HE20', 'HE40', 'HE80', 'HE160'],
+ traffic_types=['UDP'],
+ traffic_directions=['DL', 'UL'])
+
+
+class WifiRvr_SampleDFS_Test(WifiRvrTest):
+ def __init__(self, controllers):
+ super().__init__(controllers)
+ self.tests = self.generate_test_cases(
+ channels=[64, 100, 116, 132, 140],
+ modes=['bw20', 'bw40', 'bw80'],
+ traffic_types=['TCP'],
+ traffic_directions=['DL', 'UL'])
+
+
# Over-the air version of RVR tests
class WifiOtaRvrTest(WifiRvrTest):
"""Class to test over-the-air RvR
@@ -816,7 +814,7 @@
self.testclass_metric_logger.add_metric(
'{}.high_tput_hit_freq'.format(metric_tag), high_tput_hit_freq)
for metric_key, metric_value in test_data['metrics'].items():
- metric_key = "{}.avg_{}".format(metric_tag, metric_key)
+ metric_key = '{}.avg_{}'.format(metric_tag, metric_key)
metric_value = numpy.mean(metric_value)
self.testclass_metric_logger.add_metric(
metric_key, metric_value)
@@ -848,21 +846,24 @@
directions):
test_cases = []
allowed_configs = {
- 'VHT20': [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 149, 153,
- 157, 161
+ 20: [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 64, 100,
+ 116, 132, 140, 149, 153, 157, 161
],
- 'VHT40': [36, 44, 149, 157],
- 'VHT80': [36, 149]
+ 40: [36, 44, 100, 149, 157],
+ 80: [36, 100, 149],
+ 160: [36]
}
for channel, mode, angle, traffic_type, direction in itertools.product(
channels, modes, angles, traffic_types, directions):
- if channel not in allowed_configs[mode]:
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
+ if channel not in allowed_configs[bandwidth]:
continue
testcase_name = 'test_rvr_{}_{}_ch{}_{}_{}deg'.format(
traffic_type, direction, channel, mode, angle)
test_params = collections.OrderedDict(channel=channel,
mode=mode,
+ bandwidth=bandwidth,
traffic_type=traffic_type,
traffic_direction=direction,
orientation=angle)
@@ -876,18 +877,17 @@
WifiOtaRvrTest.__init__(self, controllers)
self.tests = self.generate_test_cases(
[1, 6, 11, 36, 40, 44, 48, 149, 153, 157, 161],
- ['VHT20', 'VHT40', 'VHT80'], list(range(0, 360,
- 45)), ['TCP'], ['DL'])
+ ['bw20', 'bw40', 'bw80'], list(range(0, 360, 45)), ['TCP'], ['DL'])
class WifiOtaRvr_SampleChannel_Test(WifiOtaRvrTest):
def __init__(self, controllers):
WifiOtaRvrTest.__init__(self, controllers)
- self.tests = self.generate_test_cases([6], ['VHT20'],
+ self.tests = self.generate_test_cases([6], ['bw20'],
list(range(0, 360, 45)), ['TCP'],
['DL'])
self.tests.extend(
- self.generate_test_cases([36, 149], ['VHT80'],
+ self.generate_test_cases([36, 149], ['bw80'],
list(range(0, 360, 45)), ['TCP'], ['DL']))
@@ -895,5 +895,5 @@
def __init__(self, controllers):
WifiOtaRvrTest.__init__(self, controllers)
self.tests = self.generate_test_cases(
- [6, 36, 40, 44, 48, 149, 153, 157, 161],
- ['VHT20', 'VHT40', 'VHT80'], [0], ['TCP'], ['DL', 'UL'])
+ [6, 36, 40, 44, 48, 149, 153, 157, 161], ['bw20', 'bw40', 'bw80'],
+ [0], ['TCP'], ['DL', 'UL'])
diff --git a/acts_tests/tests/google/wifi/WifiSensitivityTest.py b/acts_tests/tests/google/wifi/WifiSensitivityTest.py
index 3172aaa..b876ae9 100644
--- a/acts_tests/tests/google/wifi/WifiSensitivityTest.py
+++ b/acts_tests/tests/google/wifi/WifiSensitivityTest.py
@@ -162,7 +162,7 @@
if self.testclass_params.get('airplane_mode', 1):
self.log.info('Turning on airplane mode.')
asserts.assert_true(utils.force_airplane_mode(self.dut, True),
- "Can not turn on airplane mode.")
+ 'Can not turn on airplane mode.')
wutils.wifi_toggle_state(self.dut, True)
# Configure test retries
@@ -245,7 +245,7 @@
metric_tag = 'ch{}_{}_nss{}_chain{}'.format(
metric_tag_dict['channel'], metric_tag_dict['mode'],
metric_tag_dict['num_streams'], metric_tag_dict['chain_mask'])
- metric_key = "{}.avg_sensitivity".format(metric_tag)
+ metric_key = '{}.avg_sensitivity'.format(metric_tag)
metric_value = numpy.nanmean(metric_data)
self.testclass_metric_logger.add_metric(metric_key, metric_value)
@@ -410,7 +410,7 @@
self.atten_dut_chain_map[testcase_params[
'channel']] = wputils.get_current_atten_dut_chain_map(
self.attenuators, self.dut, self.ping_server)
- self.log.info("Current Attenuator-DUT Chain Map: {}".format(
+ self.log.info('Current Attenuator-DUT Chain Map: {}'.format(
self.atten_dut_chain_map[testcase_params['channel']]))
for idx, atten in enumerate(self.attenuators):
if self.atten_dut_chain_map[testcase_params['channel']][
@@ -510,7 +510,7 @@
return testcase_params
def _test_sensitivity(self, testcase_params):
- """ Function that gets called for each test case
+ """Function that gets called for each test case
The function gets called in each rvr test case. The function customizes
the rvr test based on the test name of the test that called it
@@ -545,6 +545,7 @@
if mode in self.VALID_TEST_CONFIGS[channel]
]
for mode in requested_modes:
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
if 'VHT' in mode:
rates = self.VALID_RATES[mode]
elif 'HT' in mode:
@@ -559,6 +560,7 @@
testcase_params = collections.OrderedDict(
channel=channel,
mode=mode,
+ bandwidth=bandwidth,
rate=rate.mcs,
num_streams=rate.streams,
short_gi=1,
@@ -765,7 +767,7 @@
metric_value = numpy.nanmean(line_results['sensitivity'])
self.testclass_metric_logger.add_metric(
metric_name, metric_value)
- self.log.info(("Average Sensitivity for {}: {:.1f}").format(
+ self.log.info(('Average Sensitivity for {}: {:.1f}').format(
metric_tag, metric_value))
current_context = (
context.get_current_context().get_full_output_path())
@@ -825,6 +827,7 @@
if mode in self.VALID_TEST_CONFIGS[channel]
]
for chain, mode in itertools.product(chain_mask, requested_modes):
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
if 'VHT' in mode:
valid_rates = self.VALID_RATES[mode]
elif 'HT' in mode:
@@ -839,6 +842,7 @@
testcase_params = collections.OrderedDict(
channel=channel,
mode=mode,
+ bandwidth=bandwidth,
rate=rate.mcs,
num_streams=rate.streams,
short_gi=1,
diff --git a/acts_tests/tests/google/wifi/WifiThroughputStabilityTest.py b/acts_tests/tests/google/wifi/WifiThroughputStabilityTest.py
index 44b4686..59c8575 100644
--- a/acts_tests/tests/google/wifi/WifiThroughputStabilityTest.py
+++ b/acts_tests/tests/google/wifi/WifiThroughputStabilityTest.py
@@ -58,7 +58,7 @@
self.publish_testcase_metrics = True
# Generate test cases
self.tests = self.generate_test_cases([6, 36, 149],
- ['VHT20', 'VHT40', 'VHT80'],
+ ['bw20', 'bw40', 'bw80'],
['TCP', 'UDP'], ['DL', 'UL'],
['high', 'low'])
@@ -66,13 +66,15 @@
traffic_directions, signal_levels):
"""Function that auto-generates test cases for a test class."""
allowed_configs = {
- 'VHT20': [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 149, 153,
- 157, 161
+ 20: [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 64, 100,
+ 116, 132, 140, 149, 153, 157, 161
],
- 'VHT40': [36, 44, 149, 157],
- 'VHT80': [36, 149]
+ 40: [36, 44, 100, 149, 157],
+ 80: [36, 100, 149],
+ 160: [36]
}
+
test_cases = []
for channel, mode, signal_level, traffic_type, traffic_direction in itertools.product(
channels,
@@ -81,11 +83,13 @@
traffic_types,
traffic_directions,
):
- if channel not in allowed_configs[mode]:
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
+ if channel not in allowed_configs[bandwidth]:
continue
testcase_params = collections.OrderedDict(
channel=channel,
mode=mode,
+ bandwidth=bandwidth,
traffic_type=traffic_type,
traffic_direction=traffic_direction,
signal_level=signal_level)
@@ -123,7 +127,7 @@
if self.testclass_params.get('airplane_mode', 1):
self.log.info('Turning on airplane mode.')
asserts.assert_true(utils.force_airplane_mode(self.dut, True),
- "Can not turn on airplane mode.")
+ 'Can not turn on airplane mode.')
wutils.wifi_toggle_state(self.dut, True)
def teardown_test(self):
@@ -565,18 +569,21 @@
traffic_directions, signal_levels, chamber_mode,
positions):
allowed_configs = {
- 'VHT20': [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 149, 153,
- 157, 161
+ 20: [
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 64, 100,
+ 116, 132, 140, 149, 153, 157, 161
],
- 'VHT40': [36, 44, 149, 157],
- 'VHT80': [36, 149]
+ 40: [36, 44, 100, 149, 157],
+ 80: [36, 100, 149],
+ 160: [36]
}
+
test_cases = []
for channel, mode, position, traffic_type, signal_level, traffic_direction in itertools.product(
channels, modes, positions, traffic_types, signal_levels,
traffic_directions):
- if channel not in allowed_configs[mode]:
+ bandwidth = int(''.join([x for x in mode if x.isdigit()]))
+ if channel not in allowed_configs[bandwidth]:
continue
testcase_params = collections.OrderedDict(
channel=channel,
@@ -601,7 +608,7 @@
):
def __init__(self, controllers):
WifiOtaThroughputStabilityTest.__init__(self, controllers)
- self.tests = self.generate_test_cases([6, 36, 149], ['VHT20', 'VHT80'],
+ self.tests = self.generate_test_cases([6, 36, 149], ['bw20', 'bw80'],
['TCP'], ['DL', 'UL'],
['high', 'low'], 'orientation',
list(range(0, 360, 10)))
@@ -610,7 +617,7 @@
class WifiOtaThroughputStability_45Degree_Test(WifiOtaThroughputStabilityTest):
def __init__(self, controllers):
WifiOtaThroughputStabilityTest.__init__(self, controllers)
- self.tests = self.generate_test_cases([6, 36, 149], ['VHT20', 'VHT80'],
+ self.tests = self.generate_test_cases([6, 36, 149], ['bw20', 'bw80'],
['TCP'], ['DL', 'UL'],
['high', 'low'], 'orientation',
list(range(0, 360, 45)))
@@ -620,7 +627,7 @@
WifiOtaThroughputStabilityTest):
def __init__(self, controllers):
WifiOtaThroughputStabilityTest.__init__(self, controllers)
- self.tests = self.generate_test_cases([6, 36, 149], ['VHT20', 'VHT80'],
+ self.tests = self.generate_test_cases([6, 36, 149], ['bw20', 'bw80'],
['TCP'], ['DL', 'UL'],
['high', 'low'],
'stepped stirrers',