wifi

package
v0.0.0-...-9474aff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 54 Imported by: 0

Documentation

Overview

Package wifi contains local Tast tests that exercise the Chrome OS WiFi stack.

Package wifi ... Copyright 2021 The Chromium OS Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APBrowseInternet

func APBrowseInternet(ctx context.Context, s *testing.State)

func Caps

func Caps(ctx context.Context, s *testing.State)

func Caps80211ac

func Caps80211ac(ctx context.Context, s *testing.State)

func CheckIntelFWDump

func CheckIntelFWDump(ctx context.Context, s *testing.State)

func CheckIntelSARTable

func CheckIntelSARTable(ctx context.Context, s *testing.State)

func Driver

func Driver(ctx context.Context, s *testing.State)

func HeCaps

func HeCaps(ctx context.Context, s *testing.State)

func HostapHwsim

func HostapHwsim(fullCtx context.Context, s *testing.State)

func IWScan

func IWScan(ctx context.Context, s *testing.State)

func IwlwifiPCIRescan

func IwlwifiPCIRescan(ctx context.Context, s *testing.State)

func Regulatory

func Regulatory(ctx context.Context, s *testing.State)

func SAPCaps

func SAPCaps(ctx context.Context, s *testing.State)

func SetTXPower

func SetTXPower(ctx context.Context, s *testing.State)

func UIToggleFromWIFISettings

func UIToggleFromWIFISettings(ctx context.Context, s *testing.State)

UIToggleFromWIFISettings tests enabling/disabling WiFi from the WiFi settings UI in Chrome OS settings.

func UdevRename

func UdevRename(ctx context.Context, s *testing.State)

func WPAValidity

func WPAValidity(ctx context.Context, s *testing.State)

Types

type IwlwifiPCIRescanService

type IwlwifiPCIRescanService struct{}

IwlwifiPCIRescanService implements tast.cros.wifi.IwlwifiPCIRescan gRPC service.

func (*IwlwifiPCIRescanService) RemoveIfaceAndWaitForRecovery

func (s *IwlwifiPCIRescanService) RemoveIfaceAndWaitForRecovery(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

RemoveIfaceAndWaitForRecovery triggers iwlwifi-rescan rule by removing the WiFi device. iwlwifi-rescan will rescan PCI bus and bring the WiFi device back.

type ShillService

type ShillService struct {
	// contains filtered or unexported fields
}

ShillService implements tast.cros.wifi.Shill gRPC service.

func (*ShillService) AssureDisconnect

func (s *ShillService) AssureDisconnect(ctx context.Context, request *wifi.AssureDisconnectRequest) (*empty.Empty, error)

AssureDisconnect assures that the WiFi service has disconnected within request.Timeout. It waits for the service state to be idle. This is the implementation of wifi.ShillService/AssureDisconnect gRPC.

func (*ShillService) CheckLastWakeReason

func (s *ShillService) CheckLastWakeReason(ctx context.Context, req *wifi.CheckLastWakeReasonRequest) (*empty.Empty, error)

CheckLastWakeReason checks if the last wake reason of WiFi device is as expected.

func (*ShillService) ConfigureAndAssertAutoConnect

ConfigureAndAssertAutoConnect configures the matched shill service and then waits for the IsConnected property becomes true. Note that this function does not attempt to connect; it waits for auto connect instead.

func (*ShillService) Connect

func (s *ShillService) Connect(ctx context.Context, request *wifi.ConnectRequest) (*wifi.ConnectResponse, error)

Connect connects to a WiFi service with specific config. This is the implementation of wifi.ShillService/Connect gRPC.

func (*ShillService) DeleteEntriesForSSID

func (s *ShillService) DeleteEntriesForSSID(ctx context.Context, request *wifi.DeleteEntriesForSSIDRequest) (*empty.Empty, error)

DeleteEntriesForSSID deletes all WiFi profile entries for a given SSID.

func (*ShillService) DisableEnableTest

func (s *ShillService) DisableEnableTest(ctx context.Context, request *wifi.DisableEnableTestRequest) (*empty.Empty, error)

DisableEnableTest disables and then enables the WiFi interface. This is the main body of the DisableEnable test. It first disables the WiFi interface and waits for the idle state; then waits for the IsConnected property after enable. The reason we place most of the logic here is that, we need to spawn a shill properties watcher before disabling/enabling the WiFi interface, so we won't lose the state change events between the gRPC commands of disabling/enabling interface and checking state.

func (*ShillService) Disconnect

func (s *ShillService) Disconnect(ctx context.Context, request *wifi.DisconnectRequest) (ret *empty.Empty, retErr error)

Disconnect disconnects from a WiFi service. This is the implementation of wifi.ShillService/Disconnect gRPC.

func (*ShillService) DisconnectReason

func (s *ShillService) DisconnectReason(_ *empty.Empty, sender wifi.ShillService_DisconnectReasonServer) error

DisconnectReason is a streaming gRPC, who waits for the wpa_supplicant's DisconnectReason property change, and returns the code to the client. To notify the caller that it is ready, it sends an empty response after the signal watcher is initialized. This is the implementation of wifi.ShillService/DisconnectReason gRPC.

func (*ShillService) DiscoverBSSID

DiscoverBSSID discovers the specified BSSID by running a scan. This is the implementation of wifi.ShillService/DiscoverBSSID gRPC. Note that WiFi.ScanAllowRoam is disabled so that we ensure that the device doesn't roam while attempting to discover a BSSID.

func (*ShillService) EAPAuthSkipped

func (s *ShillService) EAPAuthSkipped(_ *empty.Empty, sender wifi.ShillService_EAPAuthSkippedServer) error

EAPAuthSkipped is a streaming gRPC, who watches wpa_supplicant's D-Bus signals until the next connection completes, and tells that the EAP authentication is skipped (i.e., PMKSA is cached and used) or not. Note that the method sends an empty response after the signal watcher is initialized.

func (*ShillService) ExpectShillProperty

ExpectShillProperty is a streaming gRPC, takes a shill service path, expects a list of property criteria in order, and takes a list of shill properties to monitor. When a property's value is expected, it responds the property's (key, value) pair. The method sends an empty response as the property watcher is set. A property matching criterion consists of a property name, a list of expected values, a list of excluded values, and a "CheckType". We say a criterion is met iff the property value is in one of the expected values and not in any of the excluded values. If the property value is one of the excluded values, the method fails immediately. The call monitors the specified shill properties and returns the monitor results as a chronological list of pairs (changed property, changed value) at the end. For CheckMethod, it has three methods: 1. CHECK_ONLY: checks if the criterion is met. 2. ON_CHANGE: waits for the property changes to the expected values. 3. CHECK_WAIT: checks if the criterion is met; if not, waits until the property's value is met. This is the implementation of wifi.ShillService/ExpectShillProperty gRPC.

func (*ShillService) ExpectWifiFrequencies

func (s *ShillService) ExpectWifiFrequencies(ctx context.Context, req *wifi.ExpectWifiFrequenciesRequest) (*empty.Empty, error)

ExpectWifiFrequencies checks if the device discovers the given SSID on the specific frequencies.

func (*ShillService) FlushBSS

func (s *ShillService) FlushBSS(ctx context.Context, req *wifi.FlushBSSRequest) (*empty.Empty, error)

FlushBSS flushes BSS entries over the specified age from wpa_supplicant's cache.

func (*ShillService) GetBgscanConfig

func (s *ShillService) GetBgscanConfig(ctx context.Context, e *empty.Empty) (*wifi.GetBgscanConfigResponse, error)

func (*ShillService) GetCurrentTime

func (s *ShillService) GetCurrentTime(ctx context.Context, _ *empty.Empty) (*wifi.GetCurrentTimeResponse, error)

GetCurrentTime returns the current local time in the given format.

func (*ShillService) GetGlobalFTProperty

func (s *ShillService) GetGlobalFTProperty(ctx context.Context, _ *empty.Empty) (*wifi.GetGlobalFTPropertyResponse, error)

GetGlobalFTProperty returns the WiFi.GlobalFTEnabled manager property value.

func (*ShillService) GetHardwareAddr

GetHardwareAddr returns the HardwareAddr for the network interface.

func (*ShillService) GetIPv4Addrs

GetIPv4Addrs returns the IPv4 addresses for the network interface.

func (*ShillService) GetInterface

func (s *ShillService) GetInterface(ctx context.Context, e *empty.Empty) (*wifi.GetInterfaceResponse, error)

GetInterface returns the WiFi device interface name (e.g., wlan0).

func (*ShillService) GetLoggingConfig

func (s *ShillService) GetLoggingConfig(ctx context.Context, e *empty.Empty) (*wifi.GetLoggingConfigResponse, error)

GetLoggingConfig returns the logging configuration the device currently uses.

func (*ShillService) GetMACRandomize

func (s *ShillService) GetMACRandomize(ctx context.Context, _ *empty.Empty) (*wifi.GetMACRandomizeResponse, error)

GetMACRandomize tells if MAC randomization is enabled for the WiFi device.

func (*ShillService) GetScanAllowRoamProperty

func (s *ShillService) GetScanAllowRoamProperty(ctx context.Context, _ *empty.Empty) (*wifi.GetScanAllowRoamPropertyResponse, error)

GetScanAllowRoamProperty returns the WiFi.ScanAllowRoam manager property value.

func (*ShillService) GetWakeOnWifi

func (s *ShillService) GetWakeOnWifi(ctx context.Context, _ *empty.Empty) (*wifi.GetWakeOnWifiResponse, error)

GetWakeOnWifi returns the wake on WiFi related properties of WiFi device.

func (*ShillService) GetWifiEnabled

func (s *ShillService) GetWifiEnabled(ctx context.Context, _ *empty.Empty) (*wifi.GetWifiEnabledResponse, error)

GetWifiEnabled checks to see if Wifi is an enabled technology on shill. This call will wait for WiFi to appear in available technologies so we can get correct enabled setting.

func (*ShillService) HealthCheck

func (s *ShillService) HealthCheck(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

HealthCheck checks if the DUT has a WiFi device. If not, we may need to reboot the DUT.

func (*ShillService) InitDUT

func (s *ShillService) InitDUT(ctx context.Context, req *wifi.InitDUTRequest) (*empty.Empty, error)

InitDUT properly initializes the DUT for WiFi tests.

func (*ShillService) MACRandomizeSupport

func (s *ShillService) MACRandomizeSupport(ctx context.Context, _ *empty.Empty) (*wifi.MACRandomizeSupportResponse, error)

MACRandomizeSupport tells if MAC randomization is supported for the WiFi device.

func (*ShillService) ProfileBasicTest

func (s *ShillService) ProfileBasicTest(ctx context.Context, req *wifi.ProfileBasicTestRequest) (_ *empty.Empty, retErr error)

ProfileBasicTest is the main body of the ProfileBasic test, which creates, pushes, and pops the profiles and asserts the connection states between those operations. This is the implementation of wifi.ShillService/ProfileBasicTest gRPC.

func (*ShillService) QueryService

QueryService queries shill service information. This is the implementation of wifi.ShillService/QueryService gRPC.

func (*ShillService) Reassociate

func (s *ShillService) Reassociate(ctx context.Context, req *wifi.ReassociateRequest) (*empty.Empty, error)

Reassociate triggers reassociation with the current AP and waits until it has reconnected or the timeout expires. This is the implementation of wifi.WiFi/Reassociate gRPC.

func (*ShillService) ReinitTestState

func (s *ShillService) ReinitTestState(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

ReinitTestState cleans and sets up the environment for a single WiFi testcase.

func (*ShillService) RequestRoam

func (s *ShillService) RequestRoam(ctx context.Context, req *wifi.RequestRoamRequest) (*empty.Empty, error)

RequestRoam requests shill to roam to another BSSID and waits until the DUT has roamed. This is the implementation of wifi.ShillService/RequestRoam gRPC.

func (*ShillService) RequestScans

func (s *ShillService) RequestScans(ctx context.Context, req *wifi.RequestScansRequest) (*empty.Empty, error)

RequestScans requests shill to trigger active scans on WiFi devices, and waits until at least req.Count scans are done.

func (*ShillService) ResetTest

func (s *ShillService) ResetTest(ctx context.Context, req *wifi.ResetTestRequest) (*empty.Empty, error)

ResetTest is the main body of the Reset test, which resets/suspends and verifies the connection for several times.

func (*ShillService) SelectedService

func (s *ShillService) SelectedService(ctx context.Context, _ *empty.Empty) (*wifi.SelectedServiceResponse, error)

SelectedService returns the object path of selected service of WiFi service.

func (*ShillService) SetBgscanConfig

func (s *ShillService) SetBgscanConfig(ctx context.Context, req *wifi.SetBgscanConfigRequest) (*empty.Empty, error)

func (*ShillService) SetDHCPProperties

func (s *ShillService) SetDHCPProperties(ctx context.Context, req *wifi.SetDHCPPropertiesRequest) (ret *wifi.SetDHCPPropertiesResponse, retErr error)

SetDHCPProperties sets DHCP properties in shill and returns the original values.

func (*ShillService) SetGlobalFTProperty

func (s *ShillService) SetGlobalFTProperty(ctx context.Context, req *wifi.SetGlobalFTPropertyRequest) (*empty.Empty, error)

SetGlobalFTProperty set the WiFi.GlobalFTEnabled manager property value.

func (*ShillService) SetLoggingConfig

func (s *ShillService) SetLoggingConfig(ctx context.Context, req *wifi.SetLoggingConfigRequest) (*empty.Empty, error)

SetLoggingConfig sets the device logging configuration.

func (*ShillService) SetMACRandomize

SetMACRandomize sets the MAC randomization setting on the WiFi device. The original setting is returned for ease of restoring.

func (*ShillService) SetScanAllowRoamProperty

func (s *ShillService) SetScanAllowRoamProperty(ctx context.Context, req *wifi.SetScanAllowRoamPropertyRequest) (*empty.Empty, error)

SetScanAllowRoamProperty set the WiFi.ScanAllowRoam manager property value.

func (*ShillService) SetWakeOnWifi

func (s *ShillService) SetWakeOnWifi(ctx context.Context, req *wifi.SetWakeOnWifiRequest) (*empty.Empty, error)

SetWakeOnWifi sets wake on WiFi related property of WiFi device.

func (*ShillService) SetWifiEnabled

func (s *ShillService) SetWifiEnabled(ctx context.Context, request *wifi.SetWifiEnabledRequest) (*empty.Empty, error)

SetWifiEnabled persistently enables/disables Wifi via shill.

func (*ShillService) Suspend

Suspend suspends the DUT.

func (*ShillService) SuspendAssertConnect

SuspendAssertConnect suspends the DUT and waits for connection after resuming.

func (*ShillService) TearDown

func (s *ShillService) TearDown(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

TearDown reverts the settings made by InitDUT and InitTestState.

func (*ShillService) WaitForBSSID

func (s *ShillService) WaitForBSSID(ctx context.Context, request *wifi.WaitForBSSIDRequest) (*empty.Empty, error)

WaitForBSSID waits for a specific BSSID to be found.

func (*ShillService) WaitScanIdle

func (s *ShillService) WaitScanIdle(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

WaitScanIdle waits for not scanning state. If there's a running scan, it waits for the scan to be done with timeout 10 seconds. This is useful when the test sets some parameters regarding scans and wants to avoid noises due to in-progress scans.

func (*ShillService) WatchDarkResume

func (s *ShillService) WatchDarkResume(_ *empty.Empty, sender wifi.ShillService_WatchDarkResumeServer) error

WatchDarkResume is a streaming gRPC which watchers power manager's D-Bus signals until next resume (SuspendDone), and returns the count of dark resumes. Note that it sends back an empty response first to notify the caller that the D-Bus watcher is ready.

Directories

Path Synopsis
Package intelfwextractor extracts the fw dump and validate its contents.
Package intelfwextractor extracts the fw dump and validate its contents.
Package iwlwifirescan provides functions used for both local/remote IwlwifiPCIRescan tests.
Package iwlwifirescan provides functions used for both local/remote IwlwifiPCIRescan tests.
Package regdb supports parsing the regulatory database used by the Linux kernel's WiFi framework.
Package regdb supports parsing the regulatory database used by the Linux kernel's WiFi framework.
Package stringset defines basic operation of set of strings.
Package stringset defines basic operation of set of strings.
Package wlan provides the information of the wlan device.
Package wlan provides the information of the wlan device.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL