xref: /aosp_15_r20/external/autotest/server/site_tests/tast/control.cross-device (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright 2022 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5AUTHOR = 'ChromeOS SW Engprod Team ([email protected])'
6NAME = 'tast.cross-device'
7TIME = 'MEDIUM'
8TEST_TYPE = 'Server'
9ATTRIBUTES = 'suite:cross-device'
10MAX_RESULT_SIZE_KB = 1024 * 1024
11PY_VERSION = 3
12
13# tast.py uses binaries installed from autotest_server_package.tar.bz2.
14REQUIRE_SSP = True
15
16DOC = '''Run the Tast Cross Device test suite.'''
17
18from autotest_lib.server.cros.crossdevice import cross_device_util
19
20def run(machine):
21    # Wifi details that chromebook will connect to.
22    ssid = 'nearbysharing_1'
23    password = 'password'
24
25    # Get host objects for each device.
26    host = hosts.create_host(machine)
27    companions = hosts.create_companion_hosts(companion_hosts)
28    phone = companions[0]
29
30    # Configure devices for crossdevice tests.
31    cross_device_util.connect_to_wifi(host, ssid, password)
32    ip_address = phone.setup_for_cross_device_tests()
33
34    # Pass the phones adb-over-tcp "serial" (e.g 192.168.0.30:5555) to Tast as a global var.
35    ip_address_arg = 'crossdevice.PhoneIP=%s:5555' % ip_address
36
37    job.run_test('tast',
38                 host=host,
39                 test_exprs=['("group:cross-device")'],
40                 ignore_test_failures=True, max_run_sec=10800,
41                 command_args=args,
42                 varslist=[ip_address_arg])
43parallel_simple(run, machines)
44