Include index in preconfigured virtual device serial

The format of preconfigured virtual device serials is changed to
gce-device-<IP address>-<index>-<user>
where -<user> is optional. This format allows multiple devices sharing
an account on a host.

For example, the preconfigured-virtual-device-pool:

192.168.1.2
192.168.1.2:vsoc-01
192.168.1.3:vsoc-01

They are converted to the serials:

gce-device-192.168.1.2-0
gce-device-192.168.1.2-1-vsoc-01
gce-device-192.168.1.3-0-vsoc-01

Test: TF_GLOBAL_CONFIG=test.xml tradefed.sh list devices all
Bug: 229812494
Change-Id: I89fcf632ecae28f578b5623a7d716d1d6e5f3771
3 files changed
tree: 6142ee4795d4cbfad7cd2899d756e68996371765
  1. aoa_helper/
  2. atest_proto/
  3. clearcut_client/
  4. common_util/
  5. device_build_interfaces/
  6. external_dependencies/
  7. global_configuration/
  8. invocation_interfaces/
  9. isolation/
  10. javatests/
  11. lite/
  12. proto/
  13. reference_tests/
  14. remote/
  15. res/
  16. src/
  17. test_framework/
  18. test_observatory/
  19. test_result_interfaces/
  20. util_apps/
  21. .classpath
  22. .gitignore
  23. .project
  24. Android.bp
  25. Android.mk
  26. aosp_sha.sh
  27. atest_tradefed.sh
  28. CleanSpec.mk
  29. error_prone_rules.mk
  30. MANIFEST.mf
  31. OWNERS
  32. PREUPLOAD.cfg
  33. pylintrc
  34. README.md
  35. run_tf_cmd.sh
  36. script_help.sh
  37. TEST_MAPPING
  38. tradefed.sh
  39. tradefed_win.bat
README.md

Trade Federation (TF / Tradefed)

TF is a test harness used to drive Android automated testing. It runs on test hosts and monitors the connected devices, handling test scheduling & execution and device management.

Other test harnesses like Compatibility Test Suite (CTS) and Vendor Test Suite (VTS) use TF as a basis and extend it for their particular needs.

Building TF:

  • source build/envsetup.sh
  • tapas tradefed-all
  • make -j8

Getting Code Reviewed

1. Create your change in Gerrit
2. Add the reviewer named "Tradefed Codereview" (email: tradefed-codereview@tradefederation.google.com.iam.gserviceaccount.com)
3. Review the code review guidance at go/tf-guidelines and go/tradefed-code-reviews
4. GWSQ should add a couple of people from the team to review your code and give feedback.

More information

More information at: https://source.android.com/devices/tech/test_infra/tradefed/

See more details about Tradefed Architecture at: https://source.android.com/devices/tech/test_infra/tradefed/architecture

If you are a tests writer you should start looking in the test_framework/ component which contains everything needed to write a tests in Tradefed.