Skip to main content

Mobly Windows controller module for using Python code to operate Windows devices in Mobly tests

Project description

Mobly Windows Controller

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

Requirements

  • Python 3.7+
  • Mobly 1.12.2+

Installation

pip install mobly-windows

Start to Use

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

Write Mobly Device Configs

To use a Windows 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: SampleWindowsTestbed
  Controllers:
    WindowsDevice:
    - device_id: 'DEVICE_ID'
      hostname: 'IP_ADDRESS'
      username: 'USERNAME'
      password: 'PASSWORD'

NOTE: Replace DEVICE_ID, IP_ADDRESS, USERNAME, PASSWORD with your device information.

Write a Hello World Mobly Test

hello_world_test.py

"""A basic Mobly Test with Windows device."""

from mobly import base_test
from mobly import test_runner
from mobly.controllers.windows import windows_device


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

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

  def test_ssh_execute_command(self):
    # Executes console command 'SYSTEMINFO' on the Windows device and gets the result.
    result = self._wind.ssh.execute_command('SYSTEMINFO')
    self._wind.log.info('Command execution result: %s', result)


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

Execute the Test

python hello_world_test.py -c sample_config.yaml

Expect: The system information of the Windows device under test is logged in your console.

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-windows-1.0.0.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

mobly_windows-1.0.0-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file mobly-windows-1.0.0.tar.gz.

File metadata

  • Download URL: mobly-windows-1.0.0.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for mobly-windows-1.0.0.tar.gz
Algorithm Hash digest
SHA256 37bac91942efff0eecb2ca80ccd78135f3ee79cda8f570a45138ec6c74f13071
MD5 99e4f0a6735e1fbcd86944bcde5d7ebf
BLAKE2b-256 7be4e840ecbc0ed850692ebc6ee232937ee0e36f517f574f92550d5e1784b459

See more details on using hashes here.

File details

Details for the file mobly_windows-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mobly_windows-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04b60118d722649d3982d9d353d142f09d6948b287ad184aa5123600d3be2f20
MD5 ed8468aa66786bcd7c394deca929ff8f
BLAKE2b-256 9c05a880916caab5506b4155b01e81d395e51396136d5c28c7dd5db1786e264a

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