New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 910346 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug

Blocking:
issue 913145



Sign in to add a comment

autotest cannot pick up args from autotest UI

Reported by chasing....@gmail.com, Nov 29

Issue description

Here is the problem I am facing:
1. I use the autotest UI, and in advanced options, I can put in test args.
I put in my test args as follows:
args=test:power_Dummy

2. This gets injected to the control file, which looks like the following:
# INJECT_BEGIN - DO NOT DELETE THIS LINE
args='test:power_Dummy'
args_dict={'args': 'test:power_Dummy'}
# INJECT_END - DO NOT DELETE LINE
# INJECT_BEGIN - DO NOT DELETE THIS LINE
test='power_Dummy'
args_dict={'test': 'power_Dummy'}
# INJECT_END - DO NOT DELETE LINE
def step_init():
    step0()

def step0():
    # Copyright 2018 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.
    
    from autotest_lib.server import utils
    
    AUTHOR = "Chrome OS Team"
    NAME = "power_ServoV4ChargeWrapper"
    PURPOSE = "Use Servo v4 to control charging / discharging the DUT"
    CRITERIA = ""
    TIME = "LONG"
    TEST_CATEGORY = "Functional"
    TEST_CLASS = "power"
    TEST_TYPE = "server"
    DEPENDENCIES = "servo"
    
    DOC = """
DUT is connected to Servo v4 via USB type-C, and Servo v4 is connected to AC
power.

Sample usage:
test_that <ip address of DUT> power_ServoV4ChargeWrapper \
--args 'servo_host=localhost servo_port=9999 test=power_Dummy'

What are the parameters:
test: the client test to run in wrapper test; required.
servo_host: host of servod instance; required.
servo_port: port that the servod instance is on; required.
"""
    
    args_dict = utils.args_to_dict(args)
    servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
    
    def run(machine):
        host = hosts.create_host(machine, servo_args=servo_args)
        job.run_test("power_ServoV4ChargeWrapper", host=host, config=args_dict)
    
    parallel_simple(run, machines)

step_init()

3. I expect this to wrok, but instead, I get the following error:
Traceback (most recent call last):
  File "/usr/local/autotest/client/common_lib/test.py", line 600, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/usr/local/autotest/client/common_lib/test.py", line 800, in _call_test_function
    return func(*args, **dargs)
  File "/usr/local/autotest/client/common_lib/test.py", line 464, in execute
    postprocess_profiled_run, args, dargs)
  File "/usr/local/autotest/client/common_lib/test.py", line 371, in _call_run_once
    self.run_once(*args, **dargs)
  File "/usr/local/autotest/server/site_tests/power_ServoV4ChargeWrapper/power_ServoV4ChargeWrapper.py", line 31, in run_once
    raise error.TestNAError(msg)
TestNAError: power_ServoV4ChargeWrapper must run with args input.
 
Cc: mqg@chromium.org tbroch@chromium.org mattmallett@chromium.org
Owner: haddowk@chromium.org
Re Matt - 

I see the args in the control file. I don't think I can do this at all with Autotest UI. 

2 questions:
1. If I want to change the control file, where should I change it? I tried /autotest/server/site_tests/power_ServoV4ChargeWrapper, but the change doesn't seem to propagate to the autotest UI.

2. What's the run suite command and how do I use it? (Since I don't have the time to add another suite to moblab UI)
From our discussion,

1) the list of tests is built on boot with https://www.google.com/url?q=https://cs.corp.google.com/chromeos_public/src/third_party/autotest/files/utils/test_importer.py

2) Here is an example usage of run_suite.py (run on moblab)
run_suite.py --pool='' --board=caroline --build=caroline-release/R69-10755.0.0 --suite_name=hardware_storagequal_cq --retry=True --max_retries=42 --test_args="{'bug_id':'', 'part_id':''}"
As a follow up...
After making changes in /autotest and then reboot, then changes do get propagated to /usr/local/autotest/
Blocking: 913145
Status: Assigned (was: Untriaged)
This issue has an owner, a component and a priority, but is still listed as untriaged or unconfirmed. By definition, this bug is triaged. Changing status to "assigned". Please reach out to me if you disagree with how I've done this.

Sign in to add a comment