Home | History | Annotate | Download | only in sonic_AppTest
      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 error
      6 from autotest_lib.client.common_lib import utils
      7 
      8 AUTHOR = "Chrome OS Team"
      9 NAME = "sonic_AppTest_netflix"
     10 PURPOSE = "Demonstrate the ability to start a sonic app."
     11 CRITERIA = "This test will fail if the app fails to start."
     12 TIME = "SHORT"
     13 TEST_CATEGORY = "General"
     14 TEST_CLASS = "sonic"
     15 TEST_TYPE = "server"
     16 
     17 DOC = """
     18 This is a sonic test that will load the Netflix sonic app.
     19 
     20 Usage: test_that <ip of Cros DUT> --board=<boardname of DUT>
     21            --args="sonic_hostname=<ip of sonichost>"
     22 """
     23 
     24 args_dict = utils.args_to_dict(args)
     25 
     26 def 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 
     39 parallel_simple(run, machines)
     40