History log of /external/autotest/client/common_lib/time_utils_unittest.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c9b79339b9792de002e9524e5303c475857c7192 22-Sep-2014 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Add a new dut_status command.

This adds a new dut_status command that can report on whether a DUT
was working or broken at a given time. Status is determined by
looking backwards in time for a job result (e.g. a failed Repair
job) that indicates the DUT's working or broken status.

BUG=None
TEST=Run against various DUTs with a known status, run new unit tests

Change-Id: I54558fec39d6be2988c2802e969f05a9fdf04642
Reviewed-on: https://chromium-review.googlesource.com/219349
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/client/common_lib/time_utils_unittest.py
36f024f623d60a084f883f514457e1df4e7b0b1b 26-Sep-2014 Dan Shi <dshi@chromium.org> [autotest] Fix time_utils_unittest to work in machine using none PST timezone

The unittest assumes time is in PST, thus it fails if the machine is not using
PST as its timezone. Add a helper function to change timezone to PST for test
temporarily.

BUG=chromium:418066
TEST=change local timezone to none PST, run the unittest, make sure it passes.

Change-Id: I52a5de627afc9b2a134a0aafc7a61c4550869936
Reviewed-on: https://chromium-review.googlesource.com/220143
Commit-Queue: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Timothy Jennison <tjennison@google.com>
/external/autotest/client/common_lib/time_utils_unittest.py
dfea368e5c830b1d7950ced5ee7b191e3b141ca3 11-Aug-2014 Dan Shi <dshi@chromium.org> [autotest] Add RPC get_host_history to get host history.

The RPC takes in arguments like board, pool or a list of hosts, and return the
history of specified hosts. The history is a dictionary of each host and its
history of status. For example:
{'172.22.33.51': [{'status': 'Resetting'
'start_time': '2014-08-07 10:02:16',
'end_time': '2014-08-07 10:03:16',
'log_url': 'http://autotest/reset-546546/debug',
'task_id': 19441991},
{'status': 'Running'
'start_time': '2014-08-07 10:03:18',
'end_time': '2014-08-07 10:13:00',
'log_url': 'http://autotest/reset-546546/debug',
'job_id': 14995562}
]
}

Add a client util module time_utils to handle common task to do time string
and epoch time conversion.

BUG=chromium:394451
TEST=local setup
from autotest_lib.client.common_lib import global_config
from autotest_lib.server.cros.dynamic_suite import frontend_wrappers
instance_server = global_config.global_config.get_config_value(
'SERVER', 'hostname', type=str)
afe = frontend_wrappers.RetryingAFE(
server=instance_server, timeout_min=60, delay_sec=0)
result = afe.run('get_host_history', board='lumpy', pool='bvt',
start_time='2014-08-05 14:00:00',
end_time='2014-08-06 14:00:00')
import pprint
pprint.pprint(result)
rebuild local afe, test run_suite and create job from afe.

Change-Id: I66ecc5bb69a4a1fdb33437520288ed08e562ed00
Reviewed-on: https://chromium-review.googlesource.com/211772
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/client/common_lib/time_utils_unittest.py