• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 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 (chromeos-sw-engprod@google.com)'
6NAME = 'tast.nearby-share'
7TIME = 'MEDIUM'
8TEST_TYPE = 'Server'
9ATTRIBUTES = 'suite:nearby-share'
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 Nearby Share 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(adb_persist_reboot=True)
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:nearby-share")'],
40                 ignore_test_failures=True, max_run_sec=10800,
41                 command_args=args,
42                 varslist=[ip_address_arg])
43parallel_simple(run, machines)
44