|
1 | 1 | #!/usr/bin/env python3
|
2 | 2 | #
|
3 |
| -# Copyright (C) 2020-2023 VyOS maintainers and contributors |
| 3 | +# Copyright (C) 2020-2024 VyOS maintainers and contributors |
4 | 4 | #
|
5 | 5 | # This program is free software; you can redistribute it and/or modify
|
6 | 6 | # it under the terms of the GNU General Public License version 2 or later as
|
@@ -146,6 +146,144 @@ def test_wireless_hostapd_config(self):
|
146 | 146 | # Check for running process
|
147 | 147 | self.assertTrue(process_named_running('hostapd'))
|
148 | 148 |
|
| 149 | + def test_wireless_hostapd_vht_mu_beamformer_config(self): |
| 150 | + # Multi-User-Beamformer |
| 151 | + interface = 'wlan1' |
| 152 | + ssid = 'vht_mu-beamformer' |
| 153 | + antennas = '3' |
| 154 | + |
| 155 | + self.cli_set(self._base_path + [interface, 'ssid', ssid]) |
| 156 | + self.cli_set(self._base_path + [interface, 'type', 'access-point']) |
| 157 | + self.cli_set(self._base_path + [interface, 'channel', '36']) |
| 158 | + |
| 159 | + ht_opt = { |
| 160 | + # VyOS CLI option hostapd - ht_capab setting |
| 161 | + 'channel-set-width ht20' : '[HT20]', |
| 162 | + 'channel-set-width ht40-' : '[HT40-]', |
| 163 | + 'channel-set-width ht40+' : '[HT40+]', |
| 164 | + 'dsss-cck-40' : '[DSSS_CCK-40]', |
| 165 | + 'short-gi 20' : '[SHORT-GI-20]', |
| 166 | + 'short-gi 40' : '[SHORT-GI-40]', |
| 167 | + 'max-amsdu 7935' : '[MAX-AMSDU-7935]', |
| 168 | + } |
| 169 | + for key in ht_opt: |
| 170 | + self.cli_set(self._base_path + [interface, 'capabilities', 'ht'] + key.split()) |
| 171 | + |
| 172 | + vht_opt = { |
| 173 | + # VyOS CLI option hostapd - ht_capab setting |
| 174 | + 'max-mpdu 11454' : '[MAX-MPDU-11454]', |
| 175 | + 'max-mpdu-exp 2' : '[MAX-A-MPDU-LEN-EXP-2]', |
| 176 | + 'stbc tx' : '[TX-STBC-2BY1]', |
| 177 | + 'stbc rx 12' : '[RX-STBC-12]', |
| 178 | + 'ldpc' : '[RXLDPC]', |
| 179 | + 'tx-powersave' : '[VHT-TXOP-PS]', |
| 180 | + 'vht-cf' : '[HTC-VHT]', |
| 181 | + 'antenna-pattern-fixed' : '[RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]', |
| 182 | + 'link-adaptation both' : '[VHT-LINK-ADAPT3]', |
| 183 | + 'short-gi 80' : '[SHORT-GI-80]', |
| 184 | + 'short-gi 160' : '[SHORT-GI-160]', |
| 185 | + 'beamform multi-user-beamformer' : '[MU-BEAMFORMER][BF-ANTENNA-3][SOUNDING-DIMENSION-3]', |
| 186 | + } |
| 187 | + |
| 188 | + self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'channel-set-width', '1']) |
| 189 | + self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'center-channel-freq', 'freq-1', '42']) |
| 190 | + self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'antenna-count', antennas]) |
| 191 | + for key in vht_opt: |
| 192 | + self.cli_set(self._base_path + [interface, 'capabilities', 'vht'] + key.split()) |
| 193 | + |
| 194 | + self.cli_commit() |
| 195 | + |
| 196 | + # |
| 197 | + # Validate Config |
| 198 | + # |
| 199 | + tmp = get_config_value(interface, 'interface') |
| 200 | + self.assertEqual(interface, tmp) |
| 201 | + |
| 202 | + # ssid |
| 203 | + tmp = get_config_value(interface, 'ssid') |
| 204 | + self.assertEqual(ssid, tmp) |
| 205 | + |
| 206 | + # channel |
| 207 | + tmp = get_config_value(interface, 'channel') |
| 208 | + self.assertEqual('36', tmp) |
| 209 | + |
| 210 | + tmp = get_config_value(interface, 'ht_capab') |
| 211 | + for key, value in ht_opt.items(): |
| 212 | + self.assertIn(value, tmp) |
| 213 | + |
| 214 | + tmp = get_config_value(interface, 'vht_capab') |
| 215 | + for key, value in vht_opt.items(): |
| 216 | + self.assertIn(value, tmp) |
| 217 | + |
| 218 | + def test_wireless_hostapd_vht_su_beamformer_config(self): |
| 219 | + # Single-User-Beamformer |
| 220 | + interface = 'wlan1' |
| 221 | + ssid = 'vht_su-beamformer' |
| 222 | + antennas = '3' |
| 223 | + |
| 224 | + self.cli_set(self._base_path + [interface, 'ssid', ssid]) |
| 225 | + self.cli_set(self._base_path + [interface, 'type', 'access-point']) |
| 226 | + self.cli_set(self._base_path + [interface, 'channel', '36']) |
| 227 | + |
| 228 | + ht_opt = { |
| 229 | + # VyOS CLI option hostapd - ht_capab setting |
| 230 | + 'channel-set-width ht20' : '[HT20]', |
| 231 | + 'channel-set-width ht40-' : '[HT40-]', |
| 232 | + 'channel-set-width ht40+' : '[HT40+]', |
| 233 | + 'dsss-cck-40' : '[DSSS_CCK-40]', |
| 234 | + 'short-gi 20' : '[SHORT-GI-20]', |
| 235 | + 'short-gi 40' : '[SHORT-GI-40]', |
| 236 | + 'max-amsdu 7935' : '[MAX-AMSDU-7935]', |
| 237 | + } |
| 238 | + for key in ht_opt: |
| 239 | + self.cli_set(self._base_path + [interface, 'capabilities', 'ht'] + key.split()) |
| 240 | + |
| 241 | + vht_opt = { |
| 242 | + # VyOS CLI option hostapd - ht_capab setting |
| 243 | + 'max-mpdu 11454' : '[MAX-MPDU-11454]', |
| 244 | + 'max-mpdu-exp 2' : '[MAX-A-MPDU-LEN-EXP-2]', |
| 245 | + 'stbc tx' : '[TX-STBC-2BY1]', |
| 246 | + 'stbc rx 12' : '[RX-STBC-12]', |
| 247 | + 'ldpc' : '[RXLDPC]', |
| 248 | + 'tx-powersave' : '[VHT-TXOP-PS]', |
| 249 | + 'vht-cf' : '[HTC-VHT]', |
| 250 | + 'antenna-pattern-fixed' : '[RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]', |
| 251 | + 'link-adaptation both' : '[VHT-LINK-ADAPT3]', |
| 252 | + 'short-gi 80' : '[SHORT-GI-80]', |
| 253 | + 'short-gi 160' : '[SHORT-GI-160]', |
| 254 | + 'beamform single-user-beamformer' : '[SU-BEAMFORMER][BF-ANTENNA-2][SOUNDING-DIMENSION-2]', |
| 255 | + } |
| 256 | + |
| 257 | + self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'channel-set-width', '1']) |
| 258 | + self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'center-channel-freq', 'freq-1', '42']) |
| 259 | + self.cli_set(self._base_path + [interface, 'capabilities', 'vht', 'antenna-count', antennas]) |
| 260 | + for key in vht_opt: |
| 261 | + self.cli_set(self._base_path + [interface, 'capabilities', 'vht'] + key.split()) |
| 262 | + |
| 263 | + self.cli_commit() |
| 264 | + |
| 265 | + # |
| 266 | + # Validate Config |
| 267 | + # |
| 268 | + tmp = get_config_value(interface, 'interface') |
| 269 | + self.assertEqual(interface, tmp) |
| 270 | + |
| 271 | + # ssid |
| 272 | + tmp = get_config_value(interface, 'ssid') |
| 273 | + self.assertEqual(ssid, tmp) |
| 274 | + |
| 275 | + # channel |
| 276 | + tmp = get_config_value(interface, 'channel') |
| 277 | + self.assertEqual('36', tmp) |
| 278 | + |
| 279 | + tmp = get_config_value(interface, 'ht_capab') |
| 280 | + for key, value in ht_opt.items(): |
| 281 | + self.assertIn(value, tmp) |
| 282 | + |
| 283 | + tmp = get_config_value(interface, 'vht_capab') |
| 284 | + for key, value in vht_opt.items(): |
| 285 | + self.assertIn(value, tmp) |
| 286 | + |
149 | 287 | def test_wireless_hostapd_wpa_config(self):
|
150 | 288 | # Only set the hostapd (access-point) options
|
151 | 289 | interface = 'wlan0'
|
|
0 commit comments