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.
Release files for mobly-windows 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mobly-windows-1.0.0.tar.gz | 34.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mobly_windows-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.0 kB
Release files / mobly-windows-1.0.0.tar.gz
| Download URL | mobly-windows-1.0.0.tar.gz |
|---|---|
| Size | 34.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37bac91942efff0eecb2ca80ccd78135f3ee79cda8f570a45138ec6c74f13071
|
|
BLAKE2b-256 checksum How to use checksums |
7be4e840ecbc0ed850692ebc6ee232937ee0e36f517f574f92550d5e1784b459
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.7
|
Release files / mobly_windows-1.0.0-py3-none-any.whl
| Download URL | mobly_windows-1.0.0-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04b60118d722649d3982d9d353d142f09d6948b287ad184aa5123600d3be2f20
|
|
BLAKE2b-256 checksum How to use checksums |
9c05a880916caab5506b4155b01e81d395e51396136d5c28c7dd5db1786e264a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.7
|