deployment: Collect all logs from the DUT in one directory am: 1d89bd494d am: ff5a9ce289 am: 402cde8b81
am: 7c6aa0aa5e
Change-Id: Ie8c21166efa26ae4e4f448a817530eac87d93820
diff --git a/site_utils/deployment/prepare/dut.py b/site_utils/deployment/prepare/dut.py
index 041790a..37dec6b 100644
--- a/site_utils/deployment/prepare/dut.py
+++ b/site_utils/deployment/prepare/dut.py
@@ -29,7 +29,7 @@
@contextlib.contextmanager
def create_host(hostname, board, model, servo_hostname, servo_port,
- servo_serial=None, uart_logs_dir=None):
+ servo_serial=None, logs_dir=None):
"""Yield a server.hosts.CrosHost object to use for DUT preparation.
This object contains just enough inventory data to be able to prepare the
@@ -43,7 +43,8 @@
@param servo_hostname: FQDN of the servo host controlling the DUT.
@param servo_port: Servo host port used for the controlling servo.
@param servo_serial: (Optional) Serial number of the controlling servo.
- @param uart_logs_dir: (Optional) Directory to save UART logs.
+ @param logs_dir: (Optional) Directory to save logs obtained from the
+ host.
@yield a server.hosts.Host object.
"""
@@ -72,7 +73,7 @@
**servo_host.get_servo_args_for_host(host))
_prepare_servo(servohost)
host.set_servo_host(servohost)
- host.servo.uart_logs_dir = uart_logs_dir
+ host.servo.uart_logs_dir = logs_dir
try:
yield host
finally:
diff --git a/site_utils/deployment/prepare/main.py b/site_utils/deployment/prepare/main.py
index 07e5e3a..fda3cc5 100644
--- a/site_utils/deployment/prepare/main.py
+++ b/site_utils/deployment/prepare/main.py
@@ -47,7 +47,7 @@
_LOG_FILE = 'prepare_dut.log'
-_UART_LOGS_DIR = 'uart'
+_DUT_LOGS_DIR = 'dut_logs'
def _parse_args():
@@ -160,9 +160,9 @@
if 'servo_port' not in info.attributes:
raise DutPreparationError('No servo_port in DUT attributes')
- uart_logs_dir = os.path.join(results_dir, _UART_LOGS_DIR)
+ dut_logs_dir = os.path.join(results_dir, _DUT_LOGS_DIR)
try:
- os.makedirs(uart_logs_dir)
+ os.makedirs(dut_logs_dir)
except OSError as e:
if e.errno != errno.EEXIST:
raise
@@ -174,7 +174,7 @@
info.attributes['servo_host'],
info.attributes['servo_port'],
info.attributes.get('servo_serial', ''),
- uart_logs_dir,
+ dut_logs_dir,
)