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 5from autotest_lib.client.common_lib import error 6from autotest_lib.client.common_lib import utils 7 8AUTHOR = "Chrome OS Team" 9NAME = "sonic_AppTest_netflix" 10PURPOSE = "Demonstrate the ability to start a sonic app." 11CRITERIA = "This test will fail if the app fails to start." 12TIME = "SHORT" 13TEST_CATEGORY = "General" 14TEST_CLASS = "sonic" 15TEST_TYPE = "server" 16 17DOC = """ 18This is a sonic test that will load the Netflix sonic app. 19 20Usage: test_that <ip of Cros DUT> --board=<boardname of DUT> 21 --args="sonic_hostname=<ip of sonichost>" 22""" 23 24args_dict = utils.args_to_dict(args) 25 26def run(machine): 27 sonic_hostname = args_dict.get('sonic_hostname') 28 if not sonic_hostname: 29 raise error.TestError('Cannot run sonic_AppTest without a sonic host. ' 30 'please specify --args="sonic_hostname=<ip>" with ' 31 'test_that.') 32 33 cros_host = hosts.create_host(machine) 34 sonic_host = hosts.create_host(sonic_hostname) 35 job.run_test('sonic_AppTest', cros_host=cros_host, sonic_host=sonic_host, 36 app='Netflix', payload='http://www.netflix.com', 37 disable_sysinfo=True, tag='netflix') 38 39parallel_simple(run, machines) 40