Simplify FuchsiaDevice config

Generate SSH configs for Fuchsia devices and remove `ssh_config` from
the FuchsiaDevice config. Provides a reproducible connection method.

Provide sensible defaults for `ssh_priv_key`, `authorized_file_loc`, and
`ffx_binary_path` by expanding the home directory and environmental
variables.

Test: python unit_tests/test_suite.py
Change-Id: Ibd1f6b2f06923da3bc8bd5aa310d1a45346f85e3
Reviewed-on: https://fuchsia-review.googlesource.com/c/antlion/+/769894
Reviewed-by: Marc Khouri <mnck@google.com>
Fuchsia-Auto-Submit: Sam Balana <sbalana@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
5 files changed
tree: 12f01026fe7ae0535cff90c972b597b71900166b
  1. src/
  2. tests/
  3. unit_tests/
  4. .gitignore
  5. CHANGELOG.md
  6. LICENSE
  7. MANIFEST.in
  8. OWNERS
  9. pyproject.toml
  10. README.md
  11. setup.py
README.md

antlion

Collection of host-driven, hardware-agnostic Fuchsia connectivity tests. Mainly targeting WLAN and Netstack testing.

Docs | Report Bug | Request Feature

Getting Started

Requires Python 3.8+

  1. Clone the repo

    git clone https://fuchsia.googlesource.com/antlion
    
  2. Install dependencies using venv

    cd antlion
    python3 -m venv .venv  # creates a "virtual environment" in the `.venv` directory
    source .venv/bin/activate  # activates the virtual environment. Run `deactivate` to exit it later
    pip install --editable ".[dev,test]"
    
  3. Write the sample config and update the Fuchsia controller to match your development environment

    mkdir -p config
    cat <<EOF > config/simple.json
    {
       "testbed": [{
          "name": "simple_testbed",
          "FuchsiaDevice": [{
             "ip": "fuchsia-00e0-4c01-04df"
          }]
       }],
       "logpath": "logs",
       "testpaths": [ "tests" ]
    }
    EOF
    
  4. Run the sanity test

    antlion -c config/simple.json -tc Sl4fSanityTest
    

See antlion -h for more full usage.

Contributing

Contributions are what make open source 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 pull request.

  1. Create a feature branch (git checkout -b feature/amazing-feature)
  2. Commit changes (git commit -m 'Add some amazing feature')
  3. Upload CL (git push origin HEAD:refs/for/main)

A public bug tracker is not (yet) available.

Recommended git aliases

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 comments
  • git 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

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Acknowledgments

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.

Migrating CLs from ACTS

antlion and ACTS share the same git history, so migrating existing changes is straightforward:

  1. Checkout to latest main

    git checkout main
    git pull --rebase origin main
    
  2. 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
    
  3. Resolve any merge conflicts, if any

    git add [...]
    git rebase --continue
    
  4. Upload CL

    git push origin HEAD:refs/for/main # or "git uc" if using the alias