summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_interfaces_wireless.py
diff options
context:
space:
mode:
authorAlain Lamar <alain_lamar@yahoo.de>2024-06-03 00:35:54 +0200
committerChristian Breunig <christian@breunig.cc>2024-06-18 16:56:39 +0200
commit578fbe0eb436697132e5a738fec5a4ac61ced8da (patch)
treebb56c22352535eff888de24d0c3048f16caed093 /smoketest/scripts/cli/test_interfaces_wireless.py
parentf75f0f9c94472f46e056808c3ac6aba809c090f0 (diff)
downloadvyos-1x-578fbe0eb436697132e5a738fec5a4ac61ced8da.tar.gz
vyos-1x-578fbe0eb436697132e5a738fec5a4ac61ced8da.zip
wireless: T6425: Add smoketests for VHT beamforming
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_wireless.py')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_wireless.py140
1 files changed, 140 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_wireless.py b/smoketest/scripts/cli/test_interfaces_wireless.py
index 2806b7201..575dd12e9 100755
--- a/smoketest/scripts/cli/test_interfaces_wireless.py
+++ b/smoketest/scripts/cli/test_interfaces_wireless.py
@@ -159,6 +159,146 @@ class WirelessInterfaceTest(BasicInterfaceTest.TestCase):
# Check for running process
self.assertTrue(process_named_running('hostapd'))
+ def test_wireless_hostapd_vht_mu_beamformer_config(self):
+ # Multi-User-Beamformer
+ interface = 'wlan1'
+ ssid = 'vht_mu-beamformer'
+ antennas = '3'
+
+ self.cli_set(self._base_path + [interface, 'ssid', ssid])
+ self.cli_set(self._base_path + [interface, 'country-code', 'se'])
+ self.cli_set(self._base_path + [interface, 'type', 'access-point'])
+ self.cli_set(self._base_path + [interface, 'channel', '36'])
+
+ ht_opt = {
+ # VyOS CLI option hostapd - ht_capab setting
+ 'channel-set-width ht20' : '[HT20]',
+ 'channel-set-width ht40-' : '[HT40-]',
+ 'channel-set-width ht40+' : '[HT40+]',
+ 'dsss-cck-40' : '[DSSS_CCK-40]',
+ 'short-gi 20' : '[SHORT-GI-20]',
+ 'short-gi 40' : '[SHORT-GI-40]',
+ 'max-amsdu 7935' : '[MAX-AMSDU-7935]',
+ }
+ for key in ht_opt:
+ self.cli_set(self._base_path + [interface, 'capabilities', 'ht'] + key.split())
+
+ vht_opt = {
+ # VyOS CLI option hostapd - ht_capab setting
+ 'max-mpdu 11454' : '[MAX-MPDU-11454]',
+ 'max-mpdu-exp 2' : '[MAX-A-MPDU-LEN-EXP-2]',
+ 'stbc tx' : '[TX-STBC-2BY1]',
+ 'stbc rx 12' : '[RX-STBC-12]',
+ 'ldpc' : '[RXLDPC]',
+ 'tx-powersave' : '[VHT-TXOP-PS]',
+ 'vht-cf' : '[HTC-VHT]',
+ 'antenna-pattern-fixed' : '[RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]',
+ 'link-adaptation both' : '[VHT-LINK-ADAPT3]',
+ 'short-gi 80' : '[SHORT-GI-80]',
+ 'short-gi 160' : '[SHORT-GI-160]',
+ 'beamform multi-user-beamformer' : '[MU-BEAMFORMER][BF-ANTENNA-3][SOUNDING-DIMENSION-3]',
+ }
+
+ self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'channel-set-width', '1'])
+ self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'center-channel-freq', 'freq-1', '42'])
+ self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'antenna-count', antennas])
+ for key in vht_opt:
+ self.cli_set(self._base_path + [interface, 'capabilities', 'vht'] + key.split())
+
+ self.cli_commit()
+
+ #
+ # Validate Config
+ #
+ tmp = get_config_value(interface, 'interface')
+ self.assertEqual(interface, tmp)
+
+ # ssid
+ tmp = get_config_value(interface, 'ssid')
+ self.assertEqual(ssid, tmp)
+
+ # channel
+ tmp = get_config_value(interface, 'channel')
+ self.assertEqual('36', tmp)
+
+ tmp = get_config_value(interface, 'ht_capab')
+ for key, value in ht_opt.items():
+ self.assertIn(value, tmp)
+
+ tmp = get_config_value(interface, 'vht_capab')
+ for key, value in vht_opt.items():
+ self.assertIn(value, tmp)
+
+ def test_wireless_hostapd_vht_su_beamformer_config(self):
+ # Single-User-Beamformer
+ interface = 'wlan1'
+ ssid = 'vht_su-beamformer'
+ antennas = '3'
+
+ self.cli_set(self._base_path + [interface, 'ssid', ssid])
+ self.cli_set(self._base_path + [interface, 'country-code', 'se'])
+ self.cli_set(self._base_path + [interface, 'type', 'access-point'])
+ self.cli_set(self._base_path + [interface, 'channel', '36'])
+
+ ht_opt = {
+ # VyOS CLI option hostapd - ht_capab setting
+ 'channel-set-width ht20' : '[HT20]',
+ 'channel-set-width ht40-' : '[HT40-]',
+ 'channel-set-width ht40+' : '[HT40+]',
+ 'dsss-cck-40' : '[DSSS_CCK-40]',
+ 'short-gi 20' : '[SHORT-GI-20]',
+ 'short-gi 40' : '[SHORT-GI-40]',
+ 'max-amsdu 7935' : '[MAX-AMSDU-7935]',
+ }
+ for key in ht_opt:
+ self.cli_set(self._base_path + [interface, 'capabilities', 'ht'] + key.split())
+
+ vht_opt = {
+ # VyOS CLI option hostapd - ht_capab setting
+ 'max-mpdu 11454' : '[MAX-MPDU-11454]',
+ 'max-mpdu-exp 2' : '[MAX-A-MPDU-LEN-EXP-2]',
+ 'stbc tx' : '[TX-STBC-2BY1]',
+ 'stbc rx 12' : '[RX-STBC-12]',
+ 'ldpc' : '[RXLDPC]',
+ 'tx-powersave' : '[VHT-TXOP-PS]',
+ 'vht-cf' : '[HTC-VHT]',
+ 'antenna-pattern-fixed' : '[RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]',
+ 'link-adaptation both' : '[VHT-LINK-ADAPT3]',
+ 'short-gi 80' : '[SHORT-GI-80]',
+ 'short-gi 160' : '[SHORT-GI-160]',
+ 'beamform single-user-beamformer' : '[SU-BEAMFORMER][BF-ANTENNA-2][SOUNDING-DIMENSION-2]',
+ }
+
+ self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'channel-set-width', '1'])
+ self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'center-channel-freq', 'freq-1', '42'])
+ self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'antenna-count', antennas])
+ for key in vht_opt:
+ self.cli_set(self._base_path + [interface, 'capabilities', 'vht'] + key.split())
+
+ self.cli_commit()
+
+ #
+ # Validate Config
+ #
+ tmp = get_config_value(interface, 'interface')
+ self.assertEqual(interface, tmp)
+
+ # ssid
+ tmp = get_config_value(interface, 'ssid')
+ self.assertEqual(ssid, tmp)
+
+ # channel
+ tmp = get_config_value(interface, 'channel')
+ self.assertEqual('36', tmp)
+
+ tmp = get_config_value(interface, 'ht_capab')
+ for key, value in ht_opt.items():
+ self.assertIn(value, tmp)
+
+ tmp = get_config_value(interface, 'vht_capab')
+ for key, value in vht_opt.items():
+ self.assertIn(value, tmp)
+
def test_wireless_hostapd_wpa_config(self):
# Only set the hostapd (access-point) options
interface = 'wlan0'