blob: 6f2bc3d1079eb50e4a94b2f4bc4302e52f21ec3d [file] [log] [blame]
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
AUTHOR = "beeps@chromium.org"
NAME = "desktopui_SonicExtension"
PURPOSE = "Verify that we can load the sonic extension and cast a tab."
CRITERIA = """
This test will fail if we are unable to load the extension, if we don't
find the expected test utilities page, or we can't cast a tab to the sonic
device.
"""
SUITE="cast"
TIME = "LONG"
TEST_CATEGORY = "General"
TEST_CLASS = "desktopui"
TEST_TYPE = "client"
DOC = """
This test loads an extension through chromedriver and navigates to a test
utility page used to configure the extension. It requires the ip address
of a sonic host, and that the sonic host is on the same subnet as the
Device Under Test.
Usage: test_that <ip address of DUT> --board=<boardname of DUT>
--args="sonic_hostname=<ip or name of sonichost>
extension_dir=name of extension directory in test dir"
The extension_dir is optional, if none is specified the default ToT
extension will get used. If one is specified, it must reside in the
test's root directory (i.e autotest_checkout/client/site_tests/\
desktopui_SonicExtension/<some_name>), and
you only need to specify <some_name> as the extension_dir argument.
Example usage:
test_that <dut ip> desktopui_SonicExtension
--board=lumpy --args="sonic_hostname=<sonic hostname>"
test_that <dut ip> desktopui_SonicExtension
--board=lumpy
--args="test_config=<test_config>,sonic_hostname=<sonic hostname>,
extension_dir=<dirname>"
"""
args_dict = utils.args_to_dict(args)
test_config = args_dict.get('test_config')
sonic_hostname = args_dict.get('sonic_hostname')
sonic_build = args_dict.get('sonic_build')
extension_dir = args_dict.get('extension_dir')
if not sonic_hostname:
raise error.TestError('Cannot run sonic_AppTest without a sonic host.'
'please specify --args="sonic_hostname=<ip>" with '
'test_that.')
if not test_config:
raise error.TestError('Cannot run sonic_AppTest without a test_config.'
'please specify --args="test_config=<config file>" '
'with test_that.')
job.run_test('desktopui_SonicExtension',
test_config=test_config,
extension_dir=extension_dir,
sonic_hostname=sonic_hostname,
sonic_build=sonic_build)