blob: 2938f95432b0131f933f3402e3ef683fa2939410 [file] [log] [blame]
#!/usr/bin/env python3
#
# Copyright 2022 The Fuchsia Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import itertools
from typing import List, Tuple
import base_test
from base_test import BandType, DeviceType, IpVersionType, RebootType, TestParams
from mobly import test_runner
from antlion.controllers.ap_lib.hostapd_security import SecurityMode
class WlanRebootDutTest(base_test.WlanRebootBaseTest):
"""Tests wlan reconnects when rebooting the DUT in different scenarios.
Testbed Requirement:
* One ACTS compatible device (dut)
* One Whirlwind Access Point (will also serve as iperf server)
* One PduDevice
"""
def pre_run(self):
self.generate_tests(
test_logic=self.run_reboot_test,
name_func=self.generate_test_name,
arg_sets=self._generate_reboot_dut_test_params(),
)
def _generate_reboot_dut_test_params(self) -> List[Tuple[TestParams]]:
test_params: List[Tuple[TestParams]] = []
for (
reboot_type,
band,
security_mode,
ip_version,
) in itertools.product(
RebootType.all(),
BandType.all(),
SecurityMode.all(),
IpVersionType.all(),
):
settings = TestParams(
DeviceType.DUT,
reboot_type,
band,
security_mode,
ip_version,
)
test_params.append((settings,))
return test_params
if __name__ == "__main__":
test_runner.main()