commit | 5b62c5f38e698bb6645bf09e7e884f26353af31b | [log] [tgz] |
---|---|---|
author | Sam Balana <sbalana@google.com> | Mon Jun 12 22:19:34 2023 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Jun 12 22:19:34 2023 +0000 |
tree | 7d1769d9084bbeb25ffdd5d2ab1e2053c4ba76e6 | |
parent | ab4b7a1c3c2ac5f6f929da9f88d05e720ab30665 [diff] |
Replace WlanDevice with SuportsWLAN protocol Fix typing issues from using a class-inheritance based structure for abstract WLAN devices. Replaces the abstract base class with a protocol for more flexibility and better typing errors. Remove the "self.dut.device" backdoor; this allowed to call the underlying Fuchsia device directly, covering up API gaps between Fuchsia and Android that was needed to support WLAN tests. Change-Id: Ibc48bb3b77101ebf6145f4175fc9ed611fd144fe Reviewed-on: https://fuchsia-review.googlesource.com/c/antlion/+/863897 Fuchsia-Auto-Submit: Sam Balana <sbalana@google.com> Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com> Reviewed-by: Patrick Lu <patricklu@google.com>
Collection of host-driven, hardware-agnostic Fuchsia connectivity tests. Mainly targeting WLAN and Netstack testing.
Docs | Report Bug | Request Feature
The quickest way to run antlion is by using the Fuchsia QEMU emulator. This enables antlion tests that do not require hardware-specific capabilities like WLAN. This is especially useful to verify if antlion builds and runs without syntax errors. If you require WLAN capabilities, see below.
Configure and build Fuchsia to run antlion tests virtually on QEMU
fx set core.qemu-x64 \ --with //src/testing/sl4f \ --with //src/sys/bin/start_sl4f \ --args 'core_realm_shards += [ "//src/testing/sl4f:sl4f_core_shard" ]' \ --with-host //third_party/antlion:e2e_tests_quick fx build
In a separate terminal, run the emulator with networking enabled
ffx emu stop && ffx emu start -H --net tap && ffx log
In a separate terminal, run a package server
fx serve
Run an antlion test
fx test --e2e --output //third_party/antlion/tests/examples:sl4f_sanity_test
A physical device is required for most antlion tests, which rely on physical I/O such as WLAN and Bluetooth. Antlion is designed to make testing physical devices as easy, reliable, and reproducible as possible. The device will be discovered using mDNS, so make sure your host machine has a network connection to the device.
Configure and build Fuchsia for your target with the following extra arguments:
fx set core.my-super-cool-product \ --with //src/testing/sl4f \ --with //src/sys/bin/start_sl4f \ --args='core_realm_shards += [ "//src/testing/sl4f:sl4f_core_shard" ]' \ --with-host //third_party/antlion:e2e_tests fx build
Flash your device with the new build
In a separate terminal, run a package server
fx serve
Run an antlion test
fx test --e2e --output //third_party/antlion/tests/functional:ping_stress_test
Local auxiliary devices are not yet support by
antlion-runner
, which is responsible for generating Mobly configs. In the meantime, see the section below for manually crafting Mobly configs to support auxiliary devices.
Requires Python 3.8+
Clone the repo
git clone https://fuchsia.googlesource.com/antlion
Install dependencies using venv
cd antlion python3 -m venv .venv # Create a virtual environment in the `.venv` directory source .venv/bin/activate # Activate the virtual environment pip install --editable ".[mdns]" # Run `deactivate` later to exit the virtual environment
Write the sample config and update the Fuchsia controller to match your development environment
cat <<EOF > simple-config.yaml TestBeds: - Name: antlion-runner Controllers: FuchsiaDevice: - ip: fuchsia-00e0-4c01-04df MoblyParams: LogPath: logs EOF
Replace fuchsia-00e0-4c01-04df
with your device's nodename, or fuchsia-emulator
if using an emulator. The nodename can be found by looking for a log similar to the one below.
[0.524][klog][klog][I] netsvc: nodename='fuchsia-emulator'
Run the sanity test
python tests/examples/Sl4fSanityTest.py -c simple-config.yaml
Contributions are what make open source projects a great place to learn, inspire, and create. Any contributions you make are greatly appreciated. If you have a suggestion that would make this better, please create a CL.
Before contributing, additional setup is necessary:
Install developer Python packages for formatting and linting
pip install --editable ".[dev]"
Install an EditorConfig plugin for consistent whitespace
Complete the steps in ‘Contribute source changes’ to gain authorization to upload CLs to Fuchsia's Gerrit.
To create a CL:
Create a branch (git checkout -b feature/amazing-feature
)
Make changes
Document the changes in CHANGELOG.md
Auto-format changes (./format.sh
)
Note: antlion follows the Black code style (rather than the Google Python Style Guide)
Commit changes (git add . && git commit -m 'Add some amazing feature'
)
Upload CL (git push origin HEAD:refs/for/main
)
A public bug tracker is not (yet) available.
There are a handful of git commands that will be commonly used throughout the process of contributing. Here are a few aliases to add to your git config (~/.gitconfig
) for a smoother workflow:
git amend
to modify your CL in response to code review commentsgit uc
to upload your CL, run pre-submit tests, enable auto-submit, and add a reviewer[alias] amend = commit --amend --no-edit uc = push origin HEAD:refs/for/main%l=Commit-Queue+1,l=Fuchsia-Auto-Submit+1,publish-comments,r=sbalana
You may also want to add a section to ignore the project's large formatting changes:
[blame] ignoreRevsFile = .git-blame-ignore-revs
Distributed under the Apache 2.0 License. See LICENSE
for more information.
This is a fork of ACTS, the connectivity testing framework used by Android. The folks over there did a great job at cultivating amazing tools, much of which are being used or have been extended with additional features.
antlion
and ACTS share the same git history, so migrating existing changes is straightforward:
Checkout to latest main
git checkout main git pull --rebase origin main
Cherry-pick the ACTS change
git fetch acts refs/changes/16/12345/6 && git checkout -b change-12345 FETCH_HEAD git fetch https://android.googlesource.com/platform/tools/test/connectivity refs/changes/30/2320530/1 && git cherry-pick FETCH_HEAD
Resolve any merge conflicts, if any
git add [...] git rebase --continue
Upload CL
git push origin HEAD:refs/for/main # or "git uc" if using the alias