network

package
v0.0.0-...-683b059 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ARCVPNConnect

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

ARCVPNConnect differs from VPNConnect in that ARCVPNConnect focuses on testing the VPN that's started in ARC to mirror the host VPN. See b/147256449 for more details. Much of the testing around host VPN setup is left to VPNConnect to verify.

func ARCVPNCrash

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

func ARCVPNDisabled

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

func BasicProfileProperties

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

func CellularPolicyConnection

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

func CellularPolicyInstall

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

func CertSettingsPage

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

func ConfigureServiceForProfile

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

func ConfigureServiceForUserProfile

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

func ConnectivityDiagnosticsApp

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

ConnectivityDiagnosticsApp ensures that the connectivity diagnostics application launches and displays the HTML.

func DNSProxy

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

DNSProxy tests DNS functionality with DNS proxy active. There are 2 parts to this test: 1. Ensuring that DNS queries are successful. 2. Ensuring that DNS queries are using proper mode (Off, Automatic, Always On) by blocking the expected ports, expecting the queries to fail.

func DNSProxyCaptivePortal

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

func DNSProxyCaptivePortalRelog

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

func DNSProxyOverVPN

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

DNSProxyOverVPN tests DNS functionality with DNS proxy active. There are 3 parts to this test: 1. Ensuring that DNS queries over VPN are successful. 2. Ensuring that DNS queries (except from system) are routed properly through VPN by blocking VPN DNS ports, expecting the queries to fail. 3. Ensuring that DNS queries (except from system) are not using DNS-over-HTTPS when a VPN is on.

func DefaultProfile

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

func DefaultProfileServices

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

func DiagFailDNSResolution

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

DiagFailDNSResolution tests that when the domain name server (DNS) cannot resolve requests the network diagnostic routine can detect this condition.

func DiagFailDNSResolverPresent

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

DiagFailDNSResolverPresent tests that when the domain name server (DNS) are misconfigured that the network routine reports the correct errors.

func DiagFailFirewall

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

DiagFailFirewall tests that when network traffic is blocked on port 80 and 443 the network diagnostic routine can detect this condition.

func DiagFailLANConnectivity

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

DiagFailLANConnectivity tests that when the ethernet technology is disabled, the LANConnectivity network diagnostic routine fails.

func DiagPassing

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

DiagPassing is a parameterized test that ensures that network diagnostic routines will pass with a normal network connection.

func Ethernet8021X

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

Ethernet8021X tests 802.1X over Ethernet, using a virtual Ethernet pair. For the authentication server, use the EAP server built into hostapd.

Test outline:

  • Start up hostapd on one end of the link
  • Ensure client link (managed by Shill) transitions to "EAP detected"
  • Configure client EAP parameters in Shill
  • Ensure client transitions to "EAP connected", hostapd transitions to "authorized"
  • Perform client logout
  • Ensure client transitions to "EAP not connected", hostapd transitions to "logoff"
  • Re-login client
  • Ensure client transitions back to "EAP connected", hostapd transitions to "authorized"

Note that we only test that authentication completes successfully; we don't, e.g., start up a DHCP server, so the client never actually gets an IP address. Real 802.1X-enabled switches would typically have additional infrastructure to bridge the client over to the "main" network after authentication; hostapd doesn't implement this feature, and we consider that beyond the scope of an "authentication" test.

func EthernetStaticIP

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

func ProxyResolutionService

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

func ResolveLocalHostname

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

func ResolveLocalHostnameInvalidAddress

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

func ShillEthernetReady

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

func ShillInitLoginGuestScript

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

func ShillInitLoginScript

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

func ShillInitLogoutScript

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

func ShillInitScriptsLoginMultiProfile

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

func ShillInitScriptsLoginProfileExists

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

func ShillInitScriptsLoginStartShill

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

func ShillInitScriptsStartLoggedin

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

func ShillNoErrorsInLog

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

func ShillStability

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

func StorkProfile

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

func SupportedProtocols

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

func SystemProxyForArc

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

func SystemProxyForSystemServices

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

func TestProxyServer

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

TestProxyServer verifies that proxy.Server with authentication is working as expected.

func TwoShills

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

func VPNConnect

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

func VPNMojoConf

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

func VPNPolicy

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

Types

type AllowlistService

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

AllowlistService implements the tast.cros.network.AllowlistService gRPC service.

func (*AllowlistService) CheckArcAppInstalled

func (a *AllowlistService) CheckArcAppInstalled(ctx context.Context, req *network.CheckArcAppInstalledRequest) (*empty.Empty, error)

CheckArcAppInstalled verifies that ARC provisioning and installing ARC apps by checking that force installed apps are successfully installed.

func (*AllowlistService) CheckExtensionInstalled

func (a *AllowlistService) CheckExtensionInstalled(ctx context.Context, req *network.CheckExtensionInstalledRequest) (*empty.Empty, error)

CheckExtensionInstalled verifies that specified extension is installed by performing a full-text search on the chrome://extensions page.

func (*AllowlistService) GaiaLogin

func (*AllowlistService) SetupFirewall

func (a *AllowlistService) SetupFirewall(ctx context.Context, req *network.SetupFirewallRequest) (*empty.Empty, error)

type BluetoothService

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

BluetoothService implements tast.cros.network.BluetoothService gRPC service.

func (*BluetoothService) GetBluetoothBootPref

GetBluetoothBootPref gets the Bluetooth boot preference.

func (*BluetoothService) GetBluetoothPoweredFast

func (s *BluetoothService) GetBluetoothPoweredFast(ctx context.Context, _ *empty.Empty) (*network.GetBluetoothPoweredFastResponse, error)

GetBluetoothPoweredFast checks whether the Bluetooth adapter is enabled.

func (*BluetoothService) SetBluetoothPowered

func (s *BluetoothService) SetBluetoothPowered(ctx context.Context, req *network.SetBluetoothPoweredRequest) (*empty.Empty, error)

SetBluetoothPowered sets the Bluetooth adapter power status via settingsPrivate. This setting persists across reboots.

func (*BluetoothService) SetBluetoothPoweredFast

func (s *BluetoothService) SetBluetoothPoweredFast(ctx context.Context, req *network.SetBluetoothPoweredFastRequest) (*empty.Empty, error)

SetBluetoothPoweredFast sets the Bluetooth adapter power status via D-Bus. This setting does not persist across boots.

func (*BluetoothService) ValidateBluetoothFunctional

func (s *BluetoothService) ValidateBluetoothFunctional(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

ValidateBluetoothFunctional checks to see whether the Bluetooth device is usable.

type ProxyService

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

ProxyService implements the tast.cros.network.ProxyService gRPC service.

func (*ProxyService) StartServer

StartServer starts a new proxy server instance with a specific configuration. This is the implementation of network.ProxyService/Start gRPC.

func (*ProxyService) StopServer

func (s *ProxyService) StopServer(ctx context.Context, request *empty.Empty) (*empty.Empty, error)

StopServer stops a previously started server instance. Returns an error if no proxy server instance was started on the DUT. This is the implementation of network.ProxyService/Stop gRPC.

Directories

Path Synopsis
Package arcvpn interacts with the ARC-side fake VPN.
Package arcvpn interacts with the ARC-side fake VPN.
Package chroot implements a chroot environment that runs in a separate network namespace from the caller.
Package chroot implements a chroot environment that runs in a separate network namespace from the caller.
Package diag is a library of functionality to utilize the built-in Chrome network diagnostic routines.
Package diag is a library of functionality to utilize the built-in Chrome network diagnostic routines.
Package dns provides utilities for DNS tests.
Package dns provides utilities for DNS tests.
Package firewall is a library with utilities for creating an on device firewall
Package firewall is a library with utilities for creating an on device firewall
Package pre contains preconsitions for network tests.
Package pre contains preconsitions for network tests.
Package proxy allows running an http proxy server on the DUT for tests.
Package proxy allows running an http proxy server on the DUT for tests.
Package shill contains library code for interacting with shill that is specific to the network testing package.
Package shill contains library code for interacting with shill that is specific to the network testing package.
Package shillscript has helper functions and the dbus monitor implementation for the shill init scripts tests.
Package shillscript has helper functions and the dbus monitor implementation for the shill init scripts tests.
Package veth contains utility functions for establishing virtual Ethernet pairs.
Package veth contains utility functions for establishing virtual Ethernet pairs.
Package vpn provides utilities for setting up VPN clients and/or servers on DUT.
Package vpn provides utilities for setting up VPN clients and/or servers on DUT.
Package wiredhostapd contains utilities for establishing a hostapd server for use with 'driver=wired' (i.e., Ethernet or similar).
Package wiredhostapd contains utilities for establishing a hostapd server for use with 'driver=wired' (i.e., Ethernet or similar).

Jump to

Keyboard shortcuts

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