blob: 7e2b5e85364a245f40a4204f45113a591d4c7579 [file] [log] [blame]
# Copyright 2013 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
import uuid
from autotest_lib.client.common_lib import error
from autotest_lib.server import hosts
AUTHOR = "chromeos-installer@google.com"
NAME = "p2p_EndToEndTest"
METADATA = {
"contacts": [
"chromeos-core-services@google.com",
"chromeos-sw-engprod@google.com"
],
"bug_component": "b:908319",
"criteria": "Tests peer-to-peer (p2p) file sharing."
}
TIME = "MEDIUM"
TEST_TYPE = "server"
ATTRIBUTES = "suite:au-p2p"
JOB_RETRIES = 2
PY_VERSION = 3
DOC = """
End-to-end test of the peer-to-peer (p2p) file sharing system.
The test runs with a main DUT and a companion DUT. The main DUT generates a
random file and shares it via p2p. The companion DUT searches for and
downloads the file.
To simulate a progressive download of the shared file, the
file becomes available in two parts. The first part of the file is available
at the beginning of the test, while the second part appears later.
"""
def run(machine):
host = hosts.create_host(machine)
companions = hosts.create_companion_hosts(companion_hosts)
# The file ID shared among all test machines.
file_id = "%s-%s" % (time.strftime("%Y%m%d-%H%M"), uuid.uuid4())
job.run_test('p2p_EndToEndTest',
dut=host,
file_id=file_id,
companions=companions)
job.parallel_simple(run, machines)