blob: 864d5770750ff939f80102b96b14988ae7410bd4 [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.
from mobly import test_runner
from antlion.test_utils.abstract_devices.wlan_device import (
AssociationMode,
create_wlan_device,
)
from antlion.test_utils.wifi import base_test
class WlanInterfaceTest(base_test.WifiBaseTest):
def setup_class(self):
super().setup_class()
device_type = self.user_params.get("dut", "fuchsia_devices")
if device_type == "fuchsia_devices":
self.dut = create_wlan_device(
self.fuchsia_devices[0], AssociationMode.POLICY
)
elif device_type == "android_devices":
self.dut = create_wlan_device(
self.android_devices[0], AssociationMode.POLICY
)
else:
raise ValueError(
f'Invalid "dut" type specified in config: "{device_type}".'
'Expected "fuchsia_devices" or "android_devices".'
)
def test_destroy_iface(self):
"""Test that we don't error out when destroying the WLAN interface.
Steps:
1. Find a wlan interface
2. Destroy it
Expected Result:
Verify there are no errors in destroying the wlan interface.
Returns:
signals.TestPass if no errors
signals.TestFailure if there are any errors during the test.
TAGS: WLAN
Priority: 1
"""
wlan_interfaces = self.dut.get_wlan_interface_id_list()
self.dut.destroy_wlan_interface(wlan_interfaces[0])
if __name__ == "__main__":
test_runner.main()