1 # Copyright (c) 2013 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 5 from autotest_lib.client.common_lib import utils 6 7 AUTHOR = "Chromium OS" 8 NAME = "autoupdate_CatchBadSignatures" 9 TIME = "MEDIUM" 10 TEST_CATEGORY = "Functional" 11 TEST_CLASS = "platform" 12 TEST_TYPE = "server" 13 JOB_RETRIES = 2 14 # TODO(jorgelo): move this to bvt-cq after crbug.com/427384 is fixed. 15 ATTRIBUTES = "suite:bvt-perbuild" 16 SUITE = "bvt-perbuild" 17 BUG_TEMPLATE = { 18 'cc': ['chromeos-installer-alerts (a] google.com'], 19 'labels': ['Cr-Internals-Installer'], 20 } 21 22 DOC = """ 23 This is a test to verify that update_engine correctly checks 24 signatures in the metadata hash and the update payload itself. This is 25 achieved by feeding updates to update_engine where the private key 26 used to make the signature, intentionally does not match with the 27 public key used for verification. 28 29 To run locally, you must set up the file 30 31 src/third_party/autotest/files/shadow_config.ini 32 33 with the following content 34 35 [CROS] 36 devserver_dir = <full repo path>/src/platform/dev 37 dev_server = http://<hostname>:8080 38 39 and then start devserver.py outside the chroot: 40 41 $ src/platform/dev/devserver.py 42 43 With this in place, you can now run the test: 44 45 $ test_that --fast -b ${BOARD} <DUT_IP> \ 46 autoupdate_CatchBadSignatures 47 48 """ 49 50 def run_test(machine): 51 """Execute a test configuration on a given machine.""" 52 host = hosts.create_host(machine) 53 job.run_test("autoupdate_CatchBadSignatures", host=host) 54 55 # Invoke parallel tests. 56 parallel_simple(run_test, machines) 57