Skip to main content

Mobly WiFi controller module for using Python code to operate network devices in Mobly tests.

Project description

Mobly WiFi Controller

Mobly WiFi controller module for using Python code to operate network devices in Mobly tests.

Requirements

  • Python 3.11+
  • Mobly 1.12.2+

Installation

pip install mobly-wifi

Start to Use

Mobly WiFi controller is an add-on module to control OpenWrt AP devices in Mobly. To learn more about Mobly, visit Getting started with Mobly.

Write Mobly Device Configs

To use a OpenWrt AP device in Mobly tests, first you need to write a config to specify the information of the device under test. For example:

sample_config.yaml

TestBeds:
- Name: SampleOpenWrtTestbed
  Controllers:
    OpenWrtDevice:
    -  hostname: 'IP_ADDRESS'

NOTE: Replace IP_ADDRESS with your device information.

Write a Hello World Mobly Test

hello_world_test.py

"""A basic Mobly Test with OpenWrt AP device."""

from mobly import base_test
from mobly import test_runner
from mobly.controllers.wifi import openwrt_device


class HelloWorldTest(base_test.BaseTestClass):
  """A sample test demonstrating using Mobly Windows controller."""

  def setup_class(self):
    super().setup_class()
    # Registers openwrt_device controller module. By default, we expect at
    # least one OpenWrt device.
    self.device = self.register_controller(openwrt_device)[0]

  def test_start_wifi(self):
    wifi_config = wifi_configs.WiFiConfig()
    # Start a WiFi network, you should be able to connect to this WiFi after this method finished.
    self.openwrt.start_wifi(wifi_config)


if __name__ == '__main__':
  test_runner.main()

Execute the Test

python hello_world_test.py -c sample_config.yaml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mobly-wifi-1.0.2.3.tar.gz (55.7 kB view details)

Uploaded Source

File details

Details for the file mobly-wifi-1.0.2.3.tar.gz.

File metadata

  • Download URL: mobly-wifi-1.0.2.3.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.1

File hashes

Hashes for mobly-wifi-1.0.2.3.tar.gz
Algorithm Hash digest
SHA256 77cc5b78b8c4c663d23f49a8890a7ae6df876337cb91ff33358dddf6d8c1f69f
MD5 33f80f2d799b7da2f75cc419c8c17485
BLAKE2b-256 6779f89f99667c18c2d8cfd0e6bb5ac67b60588035d5cbc387aeea6ca0888b83

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page