History log of /external/autotest/server/autoserv.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4e54ae7287b9601242e99dd6a8158d8b91824997 01-Mar-2017 Aviv Keshet <akeshet@chromium.org> autotest: stop using atfork

CQ-DEPEND=CL:*332048
BUG=chromium:697254
TEST=None

Change-Id: I3f3ae5d036e43248f7832059bccc70cb83a61263
Reviewed-on: https://chromium-review.googlesource.com/447864
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/server/autoserv
92bf7b67c855085727ee3e630003da8278dd50c8 14-Feb-2017 Aviv Keshet <akeshet@chromium.org> autotest: add an autoserv job.run duration metric

This adds an (experimental, for now) metric around job.run in
autoserv. This can serve as a both a duration distribution metric, and
also as an overall counter of in- and out-of-container jobs.

BUG=chromium:676696
TEST=moblab tryjob

Change-Id: Id959f7af4023927e6af5dae51e096a5ec3fa1333
Reviewed-on: https://chromium-review.googlesource.com/442088
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/server/autoserv
5e2efb71ffebead22aa4f0744ad843ee79814b43 07-Feb-2017 Dan Shi <dshi@google.com> [autotest] Use the metrics_mock object in case chromite is not set up.

BUG=chromium:688166
TEST=unittest

Change-Id: Ic0077cb2dba75a8d820f229060f3f70f507850a1
Reviewed-on: https://chromium-review.googlesource.com/438754
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/server/autoserv
27bba96fa00d54b99867476f810c381a156af94e 25-Jan-2017 Prathmesh Prabhu <pprabhu@chromium.org> autoserv: Manually flush metrics.

autoserv processes are short lived. It doesn't make sense to use a
background process to report metrics for autoserv.

This change implies that any processes forked by autoserv can no longer
report metrics.

BUG=chromium:682318
TEST=Verify that metrics from autoserv are still reported correctly.

Change-Id: Idfa11265fe522701e11720efaedd6180c35dd9b1
Reviewed-on: https://chromium-review.googlesource.com/432042
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/server/autoserv
cbebd983db4c57366e7d666b4ad1447bc7c5e1a1 11-Jan-2017 Prathmesh Prabhu <pprabhu@chromium.org> autoserv: Unconditionally convert machine names to dict.

stage_ssp was converting machine names to dict only when running inside
the lab. There is no reason to do this since
get_machine_dicts already stubs out host_afe when not in lab. By always
using a dict, we can simplify the control files' handling of the
machines list.

BUG=chromium:678430
TEST=None.

Change-Id: Ic3e39eeab74772c382e7c2b349b585ddb3c2d8b6
Reviewed-on: https://chromium-review.googlesource.com/426770
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
/external/autotest/server/autoserv
bc5cc545f0e7558f05d1537a3ecac8232b386d46 11-Jan-2017 Prathmesh Prabhu <pprabhu@chromium.org> autoserv: Also pass in host_attributes in stage_ssp.

The control file for stage_ssp is executed outside of the context of a
server_job. This CL passes in host_attributes to the machine_dict, to
bring the behaviour closer to server_job.

BUG=chromium:678430
TEST=None.

Change-Id: I1f68080c39dc1d002c02115771cbe97cf9a13808
Reviewed-on: https://chromium-review.googlesource.com/426769
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
/external/autotest/server/autoserv
5ae41397f4e633a12453faadeea4dbe1cc5e65bc 11-Jan-2017 Prathmesh Prabhu <pprabhu@chromium.org> autoserv: Use server_job.get_machine_dicts

BUG=chromium:678430
TEST=None.

Change-Id: I2573935f0ba8ec653ee68eed49ddb66b1fa4e774
Reviewed-on: https://chromium-review.googlesource.com/426768
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
/external/autotest/server/autoserv
eb7cfc124ff60c53c9e82d9ff50b5fea6b29ec1d 24-Nov-2016 Prathmesh Prabhu <pprabhu@chromium.org> autotest: Drop old feature to time individual tests.

This is an old experimental feature that we aren't actively using.
By removing this feature, we remove an unnecessary stat, and also reduce
a call from autoserv to AFE.
The feature was originally introduced for crbug.com/237811

BUG=chromium:667171
TEST=Run job on moblab.

Change-Id: Ieefffae38469327b1df664b3eec8f17f702591b1
Reviewed-on: https://chromium-review.googlesource.com/414307
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/server/autoserv
a5eecda1101db259a47c80add533927f76cc886c 24-Nov-2016 Prathmesh Prabhu <pprabhu@chromium.org> autotest: Remove autotest_stats from autoserv

BUG=chromium:667171
TEST=Run jobs on moblab.

Change-Id: I0a37d60268fec2480d5d847f512dfe9c378b3fb9
Reviewed-on: https://chromium-review.googlesource.com/414446
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
/external/autotest/server/autoserv
20cc72ac289b10e362e2865f4b662425f6ea1a6d 31-Aug-2016 Paul Hobbs <phobbs@google.com> [autotest] Setup ts_mon in autoserv.

Added code to set up ts_mon flushing process before running autoserv
jobs. Also, cleaned up run_autoserv's usage of sys.exit.

TEST=None
BUG=chromium:642402
BUG=chromium:642560

Change-Id: Ifbb9bd17871d1215d085cc82f6bd43cfc75b7f49
Reviewed-on: https://chromium-review.googlesource.com/378596
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/server/autoserv
65374e29419788071879c6083a6aeb8a267526fe 16-Sep-2016 Dan Shi <dshi@google.com> [autotest] Fix a bug in ssp exception handling

sys.exc_info() returns a tuple, thus following code will fail:
'Exception: %s' % sys.exc_info()

Also cleaned up an issue with local variable.

BUG=chromium:643767
TEST=None

Change-Id: I272a361db11d772860c088c533af3dc6b734d58b
Reviewed-on: https://chromium-review.googlesource.com/386085
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
3be35af753ba283616ff7dd2fef29415aa8f34bf 26-Aug-2016 Dan Shi <dshi@google.com> [autotest] Set container's hostname to the dut hostname

Update the hostname of the test container to be `dut_name`. Some TradeFed tests
use hostname in test results, which is used to group test results in dashboard.
The default container name is set to be the name of the folder, which is unique
(as it is composed of job id and timestamp. For better result view, the
container's hostname is set to be the dut hostname.

BUG=chromium:637467
TEST=local verify

Change-Id: I1481d88a890020af634a499fb6d469574f9e4504
Reviewed-on: https://chromium-review.googlesource.com/376221
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
14de762a33061ee078102f076e3e2b44274fc827 22-Aug-2016 Dan Shi <dshi@google.com> [autotest] Support Launch Control build starting with `P` for SSP

Also update the SSP code to log clear error message if stage_server_side_package
failed for any reason.

BUG=chromium:638039,chromium:632524
TEST=verify locally and in test push server

Change-Id: I435cf416726644d507119d6741f62322a6d1a1aa
Reviewed-on: https://chromium-review.googlesource.com/373569
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
9b6930f090dd4a14e3b30efdc4fb40052b6eb794 20-Jul-2016 Kevin Cheng <kevcheng@chromium.org> [autotest] Revert frontend_wrapper.RetryingAFE in autoserv to frontend.AFE.

Not sure if this will fix the current failing VMTests but trying it out.

BUG=None
TEST=tryjob

Change-Id: I7d73b2471895fd4f4df34480182809f5d808aaf6
Reviewed-on: https://chromium-review.googlesource.com/362021
Reviewed-by: Dan Shi <dshi@google.com>
Commit-Queue: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
/external/autotest/server/autoserv
adc99f928c3edca69af33d8f3b3309af10769be5 20-Jul-2016 Kevin Cheng <kevcheng@chromium.org> [autotest] Pass in afe_host when staging ssp.

When running stage_server_side_package, only a list of machine names is
passed through and not a list of machine dicts. This causes the
afe_utils methods to fail when grabbing the attributes/labels since they
by default depend on the afe_host in the host object. Update the
staging to grab the afe_host object when running in the lab.

BUG=chromium:629702
TEST=not yet

Change-Id: I59c7732c78215537893567376cee982b68bc1647
Reviewed-on: https://chromium-review.googlesource.com/361539
Reviewed-by: Dan Shi <dshi@google.com>
Commit-Queue: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
/external/autotest/server/autoserv
e8aeb667c71bf0484c876bb701f2492cfc8d11ea 30-Jun-2016 Dan Shi <dshi@google.com> [autotest] Allow autoserv command line to be executed manually.

autoserv used to be able to run interactively for testing purpose. The change
to use os.setsid makes that impossible as it fails with operation not
permitted error. This change checks if the process is already a process
group leader before calling os.setsid.

BUG=None
TEST=local run test and command
server/autoserv -p -r /tmp/1 -m 100.96.51.226 -u debug_user -l dummy -s \
--lab True -P 1117-debug_user/100.96.51.226 \
-n /usr/local/autotest/results/drone_tmp/attach.2

Change-Id: Id7a45b769bfe84998ab3844a09d34100da968c6d
Reviewed-on: https://chromium-review.googlesource.com/357822
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Richard Barnette <jrbarnette@google.com>
/external/autotest/server/autoserv
dcb202c46e455ea0b598917204a7b7c87f210b2a 09-May-2016 Dan Shi <dshi@google.com> [autotest] Replace setpgrp with setsid

setpgrp causes java process kicked off by autoserv to hang, as found in CL
https://chrome-internal-review.googlesource.com/#/c/257918/

setsid is similar to setpgrp, and can work with the java process.

BUG=None
TEST=unittest, verified in chromeos-autotest

Change-Id: I67ecdce45b5e579c0a7f3a106cf1cfa8efcaa4a7
Reviewed-on: https://chromium-review.googlesource.com/343403
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: David Haddock <dhaddock@chromium.org>
/external/autotest/server/autoserv
6450e148ba84c878490b4ea166218430fd393ddd 11-Mar-2016 Dan Shi <dshi@google.com> [autotest] Support run_suite with suite package and SSP for Brillo.

This change allows one to run run_suite command without using
--run_prod_code for Brillo build.
create_suite_job will use test_suites and control_files packages from
the Brillo build to create suite job and its test jobs.

Server-side packaging is also supported for newer builds that have
autotest_server_package artifact build.

BUG=chromium:584705
TEST=run in local instance, unittest, verify in moblab

Change-Id: Ia96ca4de919b178302580c23f911bb6445016285
Reviewed-on: https://chromium-review.googlesource.com/332431
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/server/autoserv
afa63872d1b63d8e6cad7de617569c215b03d26c 24-Feb-2016 Dan Shi <dshi@google.com> [autotest] Change resultdir name inside container to be the same as outside container.

The job folder (resultdir) in drone has the format of job_id-user_name.
However, if a test runs inside the container (using server-side
packaging), its folder name is job_id only. The reason was that we
don't want to pass another piece of information to container.

This causes a problem in crash collection. During log collection, test
job creates a file uncollected_log_file to store the list of files to
collect, in the format of source and target pair, where source is the
origin path of the file, e.g., path to a log file in DUT, and target is
a path to the destination to copy to, e.g.,
/usr/local/autotest/results/226/hardware_StorageQualBase.before

If the log collection was interrupted or autoserv process died before
logs can be collected, another autoserv process will be kicked off by
scheduler to run with --collect-crashinfo. The new autoserv process will
read the content of uncollected_log_file and tries to copy file based on
the source/target pair.

Due to the difference of job folder used in container, crash collection
will fail as the target directory does not exist on the drone (as the
job folder only has job_id, but not in the format of job_id-user_name.

This change passes the full job folder name to setup_test call when
setting up the container to run the test. That way, the result path will
be exactly the same inside and outside of the container.

BUG=chromium:589173
TEST=local run ssp test, unittest
manual run crash collection:
/usr/local/autotest/server/autoserv -p --use-existing-results
--collect-crashinfo 100.96.51.226 -r
'/usr/local/autotest/results/372-debug_user/100.96.51.226'

Change-Id: I4e1abb8c566ca65e8e245e68f29a9b996fe6be32
Reviewed-on: https://chromium-review.googlesource.com/329055
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
1bf60eb788365f083d0ee8045a6556f906149dec 02-Dec-2015 Simran Basi <sbasi@google.com> [autotest] autoserv add --lab & --host_attributes arguments

Added two new flags to autoserv.

--lab indicates that autoserv is running in the lab and has
the full Autotest infrastructure at its disposal.

--host_attributes allows host attribute information that is
usually in the database to be retrievable from the command
line arguments.

If --lab is pulled in, autoserv will request the host attributes
from the database at test runtime.

From here this change, then updates the concept of the "machines"
list that test control files receive to now be a list of dicts
that contain the machine hostname and host attributes. This will
enable identifing information the hosts library needs to create
host objects to be available whether or not there is a database
present.

BUG=chromium:564343
TEST=local autoserv runs. Also verified scheduler changes work
via MobLab. waiting on trybot results.
DEPLOY=scheduler

Change-Id: I6021de11317e29e2e6c084d863405910c7d1a71d
Reviewed-on: https://chromium-review.googlesource.com/315230
Commit-Ready: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
9d3454e55f8f8ce476630c2a2516b59081a603ef 08-Dec-2015 Dan Shi <dshi@google.com> [autotest] Write to status log if autoserv failed in container without logging.

If the test run inside container fails without generating any log,
write a message to status.log to help troubleshooting.

BUG=chromium:492747
TEST=local test, force autoserv run inside the container to fail at start.
Confirm status log has the message.

Change-Id: I843e8d8645bd5dcea23679f3c7f5b825ac3351b0
Reviewed-on: https://chromium-review.googlesource.com/316691
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Fang Deng <fdeng@chromium.org>
/external/autotest/server/autoserv
37befdaac0bece8b394a8d661f7abf03984b23f0 07-Dec-2015 Dan Shi <dshi@google.com> [autotest] Log container setup failure to status log.

Autoserv writes logs to ssp_logs during setting up containers for test requiring
server-side packaging. If container setup is failed, the test will fail with no
error indication in status.log. This makes debug difficult. This change logs the
setup failure to status.log.

BUG=chromium:502490
TEST=local test, force setup_test to fail, confirm status log has the error.

Change-Id: Idb71cc45300a20049b6b33c598791a6774d5afd5
Reviewed-on: https://chromium-review.googlesource.com/316455
Commit-Ready: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/server/autoserv
c2d99cf743c86fe0519f155ffbcad54df31bd742 18-Nov-2015 J. Richard Barnette <jrbarnette@chromium.org> [autotest] Remove the concept of 'protection level' from repair.

In original Autotest, hosts have a 'protection level' that is
passed to repair jobs in order to limit the specific kinds of repair
that can be done. For the CrOS lab, this concept is largely not
useful; we want a uniform repair procedure determined by the kind of
DUT being repaired, not by a database configuration.

This removes the concept of 'protection level' from the repair flow;
repair steps are now determined only by the class of Host that
handles the operation. The protection level remains in the
database, but the only meaningful value is 'Do not verify'. That
setting on a host will prevent it from running any verify, cleanup,
or repair tasks. This is done for the sake of non-DUT hosts that
exist in the CrOS lab AFE database.

BUG=None
TEST=unit tests, and run repair in a local instance

Change-Id: I1d512eb2b1fe604b70fec00b3a290f5f6b9d9beb
Reviewed-on: https://chromium-review.googlesource.com/312979
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
1cded88373b03e7f20d250e72849ba4b789cd057 24-Sep-2015 Dan Shi <dshi@chromium.org> [autotest] Add some logging to help troubleshoot servo issue in moblab.

BUG=None
TEST=None

Change-Id: I11d059f5ac582a0c137bf995022e17d170adf845
Reviewed-on: https://chromium-review.googlesource.com/302170
Commit-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: danny chan <dchan@chromium.org>
/external/autotest/server/autoserv
c1b8bdd5871c4da9dd5ad0f1f6b6f2e0122edb78 15-Sep-2015 Dan Shi <dshi@chromium.org> [autotest] Allow repair job in moblab to start servod and repair with servo

To repair dut connected to a moblab, try to create a servo object if servo was
failed to be created earlier. servo_host for the dut connected to a moblab may
be stored in host attribute. Calling servo_host.create_servo_host by
servo_args={} will force to create a servo host object if possible.

BUG=chromium:530361
TEST=local moblab run

Change-Id: I0ab58993bd0266c1fa049f92d90c80eef7d32842
Reviewed-on: https://chromium-review.googlesource.com/299558
Commit-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
a06f3e2ec1a3b0f015533ef7e50da36f1376b8b6 04-Sep-2015 Dan Shi <dshi@chromium.org> [autotest] Allow autoserv to start servod with given board and port from dut.

BUG=chrome-os-partner:40890
TEST=update the code and global config, run autoserv in moblab
/usr/local/autotest/server/autoserv -p -N -m 192.168.231.101 -u debug -l \
wolf-release/R45-7263.0.0/faft_bios/firmware_EventLog -s \
-P 206-moblab/192.168.231.101 -n /usr/local/autotest/results/drone_tmp/attach.14

Change-Id: I6bd0f1211aaafd0e5ea1331354034d2b5038e06c
Reviewed-on: https://chromium-review.googlesource.com/297546
Commit-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
32649b800cf2cb44ffb5a64190e9cb06c952e51b 30-Aug-2015 Dan Shi <dshi@chromium.org> [autotest] Log exception when trying to modify result folder's permission.

The error happened in some test. To better track the issue, log the error to
metadata db.

BUG=chromium:526340
TEST=local run

Change-Id: Idd3eea63b2d37eba01cf4cdf5b32ca3adbe26c72
Reviewed-on: https://chromium-review.googlesource.com/296310
Commit-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
/external/autotest/server/autoserv
888cfcaeeffdf302e25b066d9bef9ba535ebbc20 01-Aug-2015 Dan Shi <dshi@chromium.org> [autotest] Update autoserv parser to replace optparse with argparse to support unknown arguments

This fix should avoid lab failures like bug 515339

BUG=chromium:490456
TEST=local run suite jobs, unittest

Change-Id: I06776c080bac2ff438582637a4b93ef279a5ec8a
Reviewed-on: https://chromium-review.googlesource.com/290106
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
77b79a6ee127ecefd3d6f783f81740900356b9fc 30-Jul-2015 Dan Shi <dshi@chromium.org> [autotest] Remove --parent_job_id from the command line run inside container.

It's not needed and cause autoserv to fail if the build is old.

BUG=chromium:515339
TEST=None

Change-Id: I129d8d99feddfe823faab6ad268b438526fac8d5
Reviewed-on: https://chromium-review.googlesource.com/289663
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
e4a4f9fd2ad9984882e50e199e24a73d871cb2a1 20-Jul-2015 Dan Shi <dshi@chromium.org> [autotest] Fix file permission for aborted test running with SSP

Aborted test using SSP may contain result files with wrong file permission.
This CL makes following changes to fix the file permissions:
1. Change autoserv to destroy container before changing file permissions.
2. Try to update file permission in if gs_offloader failed with error like:
CommandException: Error opening file "file://....."

BUG=chromium:511778
TEST=local test

Change-Id: If9aa693aef309706f1fc9ee8ecdf981c7c06d799
Reviewed-on: https://chromium-review.googlesource.com/286777
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
70647cafbd061a7754ac304fd9dc067f2b6dbab4 17-Jul-2015 Dan Shi <dshi@chromium.org> [autotest] Save parent job id, build, board and suite info to tko_jobs.

parent job id is passed in through autoserv commandline. autoserv saves the
value to keyval file in results folder. The parser job then reads the parent
job id from keyval file.

build, board and suite info are parsed from job name. The label column in
tko_jobs is essentially the job name. However, that column has a size limit of
100 characters, thus the name could be truncated. This CL parse the actual job
name to get the build, board and suite info and save to tko_jobs table.

BUG=chromium:509770,chromium:509901
TEST=local test
CQ-DEPEND=CL:285026

Change-Id: I06b073b052a9d07ffd36308b1682a7bc12699898
Reviewed-on: https://chromium-review.googlesource.com/286265
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
4beca02ac922291c63cc65a96b43eed4e26f469e 16-Jun-2015 Christopher Grant <cjgrant@google.com> autotest: let after-test hooks see exceptions.

The "after iteration hooks" are the first code to run after run_once(),
in both the success and failure cases. This change gives the hooks a
chance to check for a pending exception and log extra information if
needed.

BUG=None
TEST=Verify server/client-side test exceptions are visible in hooks.

Change-Id: I2d8248d329130d515a8e0d8dfd8c6093a253eed3
Reviewed-on: https://chromium-review.googlesource.com/278025
Reviewed-by: Ilja Friedel <ihf@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Tested-by: Christopher Grant <cjgrant@chromium.org>
/external/autotest/server/autoserv
ff78f11ff85372a1e2f8ddf8eefbc8b772686148 12-Jun-2015 Dan Shi <dshi@chromium.org> [autotest] Pass current user into container for RPC usage

RPC is called using current OS user if not specified (frontend.py). This causes
an issue for autoserv running inside container, as the OS user is always root.
The root user may fail check_for_acl_violation_hosts if a host has special ACL
that does not allow `everyone`.

This CL add an SSP/user config in global config, lxc related code is updated so
that the OS user of autoserv running in host will be passed into the container
through shadow_config.ini. And frontend will use such user to make RPC.

BUG=chromium:480525,chromium:502897
TEST=local
sudo python site_utils/lxc_functional_test.py -v -s
attach to the container
update SSP/user with a user name (existing one should be root as the process
site_utils/lxc_functional_test.py is executed with sudo)
update frontend.py with code in this CL (this means only newer builds won't
be hit by this bug.)
run some RPC:
import common
from autotest_lib.server.cros.dynamic_suite import frontend_wrappers
_AFE = frontend_wrappers.RetryingAFE()
print _AFE.run('get_stable_version')

Also make sure afe in the host still works.

Change-Id: I9ba924e2652fadffa71d6298f74c5b82e8e26b4e
Reviewed-on: https://chromium-review.googlesource.com/281062
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
36cfd831af781eed114337efa5b90c103a49b502 10-Oct-2014 Dan Shi <dshi@chromium.org> [autotest] Support updating both firmware and CrOS from run_suite

Add firmware_build option for run_suite to pass in firmware build.
Save the build containing server-side test to job_keyvals.

Design doc:
https://docs.google.com/a/google.com/document/d/115aAHyZaatFDzuKWm61Sj2fImH4NDWikXqifvWKbbW0/edit#

BUG=chromium:270258
TEST=local run_suite:
make sure it works with older build:
./run_suite.py -b veyron_jerry -i trybot-veyron_jerry-paladin/R45-7086.0.0-b8 -p suites -s dummy_server

Call failed as --firmware_ro_build not supported yet.
./run_suite.py -b veyron_jerry -i trybot-veyron_jerry-paladin/R45-7122.0.0-b11 --firmware_build veyron_jerry-firmware/R41-6588.9.0 --test_source_build trybot-veyron_jerry-paladin/R45-7122.0.0-b11 --firmware_ro_build veyron_jerry-firmware/R41-6588.9.0 -p suites -s dummy_server

Call failed as the firmware build does not have test_suites package built:
./run_suite.py -b veyron_jerry -i trybot-veyron_jerry-paladin/R45-7122.0.0-b11 --firmware_build veyron_jerry-firmware/R41-6588.9.0 --test_source_build veyron_jerry-firmware/R41-6588.9.0 -p suites -s dummy_server

make sure it works with new build:
./run_suite.py -b veyron_jerry -i trybot-veyron_jerry-paladin/R45-7122.0.0-b11 --firmware_build veyron_jerry-firmware/R41-6588.9.0 --test_source_build trybot-veyron_jerry-paladin/R45-7122.0.0-b11 -p suites -s dummy_server

DEPLOY=apache,scheduler

Change-Id: I50d23a7e81e4d6224b3483111110f910eb407074
Reviewed-on: https://chromium-review.googlesource.com/272793
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
ca3be48da9dd7882ba282d9e82413b4aad2a8364 06-May-2015 Dan Shi <dshi@chromium.org> [autotest] Add sudo -n option to avoid password prompt.

Also add a utility function to check if password is needed to run sudo command.

We can add -n option to all sudo command that SSP used. However, once the
property drone.support_ssp is set to False, no SSP code will be executed.
Therefore, there is no need to add -n everywhere.

BUG=chromium:484396
TEST=local run
Start scheduler, confirm no password promt, and drone.support_ssp is False.
Run sudo true, enter password.
Run scheduler again, confirm no password promt, and drone.support_ssp is True.

Change-Id: Ifbd302973db5d443499311e435ec99e32d24cb5b
Reviewed-on: https://chromium-review.googlesource.com/269740
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
e28de551a788158329deedc2ffc7bf080a4f5b63 07-May-2015 Dan Shi <dshi@chromium.org> [autotest] Rename the folder to store SSP logs generated by autoserv running in drone.

Rename the folder from wrapper to ssp_logs for easier understanding.

BUG=None
TEST=local run test

Change-Id: I121538de08a5c5f42fef2820625cc7222ad3a038
Reviewed-on: https://chromium-review.googlesource.com/269806
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
/external/autotest/server/autoserv
5ddf6a322b1cc4aa848d84250a2a72e57d825b74 02-May-2015 Dan Shi <dshi@chromium.org> [autotest] Fix a logging issue when import client.bin in autotest

Import from client.bin will fail autoserv with error:
Traceback (most recent call last):
File "/usr/local/autotest/server/autoserv", line 49, in <module>
atfork.stdlib_fixer.fix_logging_module()
File "/usr/local/autotest/site-packages/atfork/stdlib_fixer.py", line 64, in fix_logging_module
raise Error('logging handlers already registered.')
atfork.stdlib_fixer.Error: logging handlers already registered.

the run function lives in client/common_lib/utils, so import from common_lib.

BUG=None
TEST=local test run

Change-Id: I1f4a6233c7e5fd367b32c51fd782d1fd961c503f
Reviewed-on: https://chromium-review.googlesource.com/268960
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
7836d25b375a791ebc7b3d0d255c8732c4f35be2 28-Apr-2015 Dan Shi <dshi@chromium.org> [autotest] Add a generic config deployment module to handle configs for container.

For container to run a test, it needs some config files to be able to do
something like:
resolve hostname with dns configured in host.
ssh to dut.
ssh to devserver.

Currently we hard code to copy each file to container, and modify each file for
it to work within container.
This CL provides a generic way to manage a list of deploy config, each config
specifies what file needs to be copied to where and if the existing file should
be overwritten. For container to work in developer's workstation, the special
handling of some configure files is still available. For lab servers, puppet
should be used to push out the config files and shadow deploy config (
ssp_deploy_shadow_config).

BUG=chromium:481706
TEST=local test with and without shadow ssp deploy config
sudo python site_utils/lxc_functional_test.py -v -d chromeos1-dshi1.cros -r 172.17.40.27
also verify in moblab (python package install does not work in moblab yet due
to bug 483371)

Change-Id: I8bbe33a83262b7c746fbe0112cf61cea046931ea
Reviewed-on: https://chromium-review.googlesource.com/267569
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
3f1b8a52e4b080092bbf7a8e04e8ecfdaeeff608 21-Apr-2015 Dan Shi <dshi@chromium.org> [autotest] Destroy container when test using SSP is aborted.

The logic to abort a test was changed in following CL:
https://chromium-review.googlesource.com/230323
drone utility sends a SIGKILL directly to autoserv process to kill the test job.
This prevents autoserv from run the code in SIGTERM handler, where container can
be destroyed.

This CL also make sure results folder has the right permission after the test is
finished in several code path:
1. Test completed without being aborted.
2. Test was aborted
3. scheduler queues a write_to_file call in drone to write to status.log
indicating the action to abort the test.

BUG=chromium:474011
TEST=local test
1. run a test with SSP, abort, make sure container is destroyed and status.log
has the complete information about job being aborted.
2. run a test without SSP, abort, confirm everything behaves as usual.
3. run test with/without SSP, let the job finish. Confirm there is no error.

Change-Id: If6e70dd8c72bf10f6d81a528cfd4a70541e1593e
Reviewed-on: https://chromium-review.googlesource.com/266732
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
d68d51c731ef83a45c173497b59a26b2e6870c1b 22-Apr-2015 Dan Shi <dshi@chromium.org> [autotest] Add autoserv's pid to the container's name

The PID info will be used to determine if a container is orphaned.

BUG=chromium:479383
TEST=sudo python site_utils/lxc_functional_test.py
local run a server side test

Change-Id: I4de2f7f266bcb793cfe1a97e412868aa49d53991
Reviewed-on: https://chromium-review.googlesource.com/266754
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
0b754c5347a86f06fc8644b36abb9ca819a38d73 20-Apr-2015 Dan Shi <dshi@chromium.org> [autotest] Postpone logging ssp warning until logging being set up

BUG=None
TEST=local run with ssp

Change-Id: Ia8dde5ff1e4263329fa7642c5b7836d719460cba
Reviewed-on: https://chromium-review.googlesource.com/266560
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
d1f51238c9bc8fd0ca45e71343b3e43dbeae44f0 18-Apr-2015 Dan Shi <dshi@chromium.org> [autotest] Support autoserv arg with empty space to run inside container

Argument that has empty space needs to be surrounded by single quote in the
autoserv commandline to be executed inside container.

BUG=chromium:478376
TEST=local, create a server-side test with name containing empty space.
http://dshi.mtv/afe/#tab_id=view_job&object_id=597

Change-Id: I8ebfda07f43055de6b2c0a8306dd38504a395700
Reviewed-on: https://chromium-review.googlesource.com/266373
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
37bee2292a1c385839e14adf3b2799447d8a98ac 14-Apr-2015 Dan Shi <dshi@chromium.org> [autotest] Reduce the container info to collect for better performance

Also report the container usage data to metadb.

BUG=None
TEST=local lxc_functional_test.py, local dummy_server suite, search metadb
http://172.25.61.45:9200/_plugin/elastic-hammer/
query string:
{ "query": {"bool": {"minimum_should_match": 2,
"should": [
{"term": {"_type": "container_run_test"}},
{"range": {"time_recorded":
{"gte": 1419384005.705098,
"lte": 1507282542.893756}}}
]}},
"size": 100}

Change-Id: I739187499a2ec82ffe2a08d24e7d326743380653
Reviewed-on: https://chromium-review.googlesource.com/265532
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
c68fefb789c6d6bf936ea5e4270401cca6411ac4 07-Apr-2015 Dan Shi <dshi@chromium.org> [autotest] Cleanup the logic in determine if SSP should be used.

We have 3 parameters related to ssp:
require_ssp: True if test requires SSP
warn_no_ssp: True if scheduler failed to locate a drone supporting SSP, and
wants to log a warning in autoserv log.
ssp_url: Url to SSP on devserver, either resolved from host attribute
job_repo_url or staged within autoserv process.

This change tries to merge the checks into a single use_ssp variable to stop
the logic being used in multiple places, thus reduce the chance of
introducing bugs.

BUG=chromium:453624
TEST=local run test

Change-Id: Ib731d073cc27331f72fd8bf72276c6d58dbe7804
Reviewed-on: https://chromium-review.googlesource.com/264393
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
b669cbdea7f4bfc9cbfcea48d9cf9ce62f0deff5 13-Sep-2013 Dan Shi <dshi@chromium.org> [autotest] Disable install autotest from job_repo_url for test_that

use_packing option for autotest._install method is True by default. When using
test_that to run test, DUT will try to install autotest package from
job_repo_url with server configured in global_config (cautotest). For DUT not
located in lab, there is no job_repo_url existed for such DUT in cautotest, and
therefore autotest will try to copy over the local files. However, when a user
try to use a DUT in the lab to run test_that, autotest package is downloaded
and installed from job_repo_url. That leads to a problem that developers can't
use test_that to verify autotest code.

The fix is to add a new option no_use_packaging to autoserv, and thread the
option to autotest._install. The option is set to False by default, and set
to True in test_that. Also, when this argument is set to True, any package
installation will use AutoservFetcher.

BUG=chromium:265673
TEST=run following command and confirm local autotest code is copied over to
the DUT: test_that -b lumpy 172.22.75.225 dummy_Pass

Change-Id: I365f5f7dc79c8e65cddaa0af77f1f1a1e4b0012a
Reviewed-on: https://chromium-review.googlesource.com/169343
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Mungyung Ryu <mkryu@google.com>
Tested-by: Mungyung Ryu <mkryu@google.com>
/external/autotest/server/autoserv
cf4d2032ea4bf5af680383f36308d581876bbbb0 12-Mar-2015 Dan Shi <dshi@chromium.org> [autotest] Update autoserv to support server-side packaging.

Code change is made so autoserv will honer the --require-ssp arg. When the
argument is specified, autoserv will:
1. Try to locate server-side package based on --image, host attribute
job_repo_url and host's cros-version label.
2. If no server-side package can be staged, the job will be run without ssp.
3. If package can be staged, autoserv will start a container to run the test.
a) parent autoserv process's log will be stored in [results]/wrapper folder.
b) A container will be created from base container, with proper setup.
c) The same autoserv command line (with update on result path and control
etc.), will be executed inside the container.
d) Parent autoserv process will wait for above command to finish and destroy
the container afterwards. If the test job was aborted, container should
also be destroyed.

BUG=chromium:453624
TEST=local setup and run test command:
/usr/local/autotest/server/autoserv -p -r /usr/local/autotest/results/16-debug_\
user/$result_dir -m 172.27.215.232 -u udebug_user -l dummy_PassServer -s -P \
16-debug_user/$result_dir -n /usr/local/autotest/results/drone_tmp/attach.2 \
--verify_job_repo_url --require-ssp
create job from afe:
http://dshi.mtv.corp.google.com/afe/#tab_id=view_job&object_id=19

Change-Id: Ida36374dd500cd1fd0b67a86ab8c0198ade4cc36
Reviewed-on: https://chromium-review.googlesource.com/259834
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
ec1d47d85cc83f30631518d8fbb6406036a3ac39 13-Feb-2015 Dan Shi <dshi@chromium.org> [autotest] Add support for scheduler to honor require_ssp attribute in control file

This CL adds changes to pipe require_ssp attribute in control file to autoserv
command. Following are the work flow:

1. The control file parser stores require_ssp attribute value in afe_jobs table.
2. QueueTask compiles command line list, --require-ssp option will be added to
the command line list if following conditions are met:
a. AUTOSERV/enable_ssp_container in global config is True
b. The test is a server-side test
c. require_ssp for the job entry is None or True.
3. When agent_task tries to call run method to run the command, it will check if
there is any drone supporting server-side packaging first. If no drone is found,
the agent task will will run the command in a drone without using server-side
packaging. A warning will be posted in the autoserv log.
4. If a drone without SSP supported is assigned to a test requires SSP, the test
will be run without ssp.

BUG=chromium:453624
TEST=unittest, local test:
set AUTOSERV/enable_ssp_container to True in shadow config;
Create a job for dummy_PassServer in AFE, check require SSP, confirm the job
succeeds but with a warning in the autoserv log.

Create a job for dummy_PassServer_nossp in AFE, uncheck require SSP, confirm
the job passes without warning in the autoserv log.

set AUTOSERV/enable_ssp_container to False in shadow config, restart scheduler.
Create a job for dummy_PassServer in AFE, check require SSP, confirm the job
succeeds without warning in the autoserv log.

also run test_that in local chroot to make sure test_that is not affected.

DEPLOY=apache,scheduler, db migrate must be done before push this CL to prod.

Change-Id: I02f3d137186676ae570e8380d975a1bcd9ffbb94
Reviewed-on: https://chromium-review.googlesource.com/249841
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
1e1c41b1b4a1b97c0b7086b8430856ed45e064d3 05-Feb-2015 Gabe Black <gabeblack@chromium.org> graphite: Separate out configuration from the statsd classes.

The new version of the statsd classes should be created using an instance of
the new Statsd class which sets up some defaults without having to specify
them over and over. This makes it essentially compatible with the existing
usage in autotest, but will allow chromite to configure things differently and
avoid having side effects from importing the module or global state.

BUG=chromium:446291
TEST=Ran unit tests, ran stats_es_functionaltest.py, ran the
stats_mock_unittest, ran a butterfly-paladin tryjob with --hwtest, testing by
fdeng.
DEPLOY=apache,scheduler,host-scheduler

Change-Id: I1071813db197c0e5e035b4d8db615030386f1c1c
Reviewed-on: https://chromium-review.googlesource.com/246428
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
/external/autotest/server/autoserv
22dd226625255110c079e979113dcda1f4fa5ea8 29-Nov-2014 Prashanth Balasubramanian <beeps@google.com> [autotest] Shard client resyncs conflicting jobs.

There is currently a race in the shard_client, described thus:

* scheduler marks job 1 complete
* shard heartbeat doesn't include job 1 in packet
* scheduler marks job 1 with shard_id = NULL (for upload)
* master replies with 'Hey job 1 is Queued but you say it
isn't running'
* shard serializes the fks of job1 sent by master, over
writing the NULL shard_id
=> Job1 is never synced back to the master

This cl fixes this race by:
1. The shard client continues to declare a job as incomplete till
the scheduler has update the shard_id to NULL. In the above
example, the second step won't happen.
2. If the shard_client notices any disagreement between the complete
bits of jobs in the local db and the 'new' jobs sent from the
master, it re-marks the job for upload by setting shard_id=NULL.
In the above example this would happen after the last step,
forcing the next heartbeat to pick up the job.

The cl also adds some important stats and logging to help debug
issues in production.

TEST=Ran suites via puppylab, unittests.
BUG=chromium:423225,chromium:425347
DEPLOY=scheduler

Change-Id: Ib35b193681b187e3745a4678778dbeba77fe83e5
Reviewed-on: https://chromium-review.googlesource.com/232193
Tested-by: Prashanth B <beeps@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
/external/autotest/server/autoserv
f8b83718b8d36d2712b3c4e03e930bfef1766e3d 07-Nov-2014 Prashanth Balasubramanian <beeps@google.com> [autotest] Autoserv modifications to use puppylab.

This allows us to load-test portions of our infrastructure
without requiring any physical DUTs (eg drone process counts,
scheduling jobs on DUTs, parsing results from shards to master).

What still happens:
* suites run end to end as always
* new jobs are inserted into the db via afe
* control files are staged on a devserver
* host scheduler runs as always
    * jobs are scheduled according to deps on duts
    * special tasks are created in the db
        * autoserv for tasks just exits with 0
* test is scheduled
    * Autoserv is created but simply exits after writing
      job results to the appropriate directories
* parsing inserts happy results into the db

What doesn't happen:
* jobs don't ssh into DUTs in any way. Not for reset, provision,
  test running etc, not for gathering. All the mock results for
  a test are crafted by autoserv directly on the drone.
* DUTs don't die mysteriously or take up physical space on desk.
* bvt doesn't take 2 hours.

TEST=Ran bvt.
BUG=chromium:423225,chromium:425347
CQ-DEPEND=CL:227783

Change-Id: I5560d2a053ee45abec1b51c78a26438357e6d565
Reviewed-on: https://chromium-review.googlesource.com/228350
Tested-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
/external/autotest/server/autoserv
042c1479b8df4f2d87586815d7ad0646cc39abeb 23-Oct-2014 Fang Deng <fdeng@chromium.org> [autotest] record autoserv run time in metadata db.

Measure autoserv run time and send it to metadata db.
The job id (or special task id) is extracted from the
result directory path using regular expression.

TEST=1)locally run autoserv. 2) Run run_suite.
Made sure that all the special tasks have been excercised.
3) run test_that
BUG=chromium:426105,chromium:422581

Change-Id: I16b119dbcf9b163967abed09a303d86568ea1394
Reviewed-on: https://chromium-review.googlesource.com/225236
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
/external/autotest/server/autoserv
6285f6acffd9ed3176cdc89544944a87340ac0b1 09-May-2014 Prashanth B <beeps@google.com> [autotest] Retry when staging a control files fails in run-suite.

The cl also adds some stats for reporting run_suite failures, and
sneaks in some autoserv testing changes.

TEST=Ran run_suite against a bad devserver, raised the exception.
BUG=chromium:418928, chromium:359741, chromium:371644

Change-Id: If49a3b96c053432cb26a01a02e160176be37c037
Reviewed-on: https://chromium-review.googlesource.com/220973
Reviewed-by: Prashanth B <beeps@chromium.org>
Tested-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Prashanth B <beeps@chromium.org>
/external/autotest/server/autoserv
ad78aca982907e3a21d93c1d7085840877b92e3d 03-Oct-2014 Fang Deng <fdeng@chromium.org> [autotest] Cleanup follows the same code path as other special task.

Cleanup has been treated differently from other special task.
When --cleanup is specified, autoserv follows the
code path of excuting a normal test control file (but no test
will be run since scheduler won't pass a control file to autoserv
with --cleanup)

Because of this behavior, crashdump control segment will always
be run before cleanup control segment. This is not necessary,
especially with our new crashcollect flow.

Also in the currently code path, the provision-able labels are
not passing to cleanup job, thus not working.

This CL makes cleanup follows the same code path
as other special tasks like repair, reset, verify.

BUG=None
TEST=1) run autoserv manually with --cleanup
2)run dummy_Fail, which trigger Cleanup

Change-Id: Ib5d413f29954b041344670b8a2ed5ab33f6c01b1
Reviewed-on: https://chromium-review.googlesource.com/221358
Reviewed-by: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
/external/autotest/server/autoserv
e497b55217d7eb385c6ed2940f666d38ce4eeb98 24-Sep-2014 Jakob Juelich <jakobjuelich@chromium.org> [autotest] Testing mode for autoserv.

To be able to do better load testing it's useful if autoserv has the
functionality to just simulate it would run tests on DUTs.

With this autoserv will sleep for 10 seconds and will then return
like after a successful test.

BUG=None
TEST=Ran suites.

Change-Id: I9b1527054d494ee356e8951561cf6a426e30cd14
Reviewed-on: https://chromium-review.googlesource.com/219638
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Jakob Jülich <jakobjuelich@chromium.org>
Tested-by: Jakob Jülich <jakobjuelich@chromium.org>
/external/autotest/server/autoserv
8eac5af187f7d9fdc6d833129b4f54e9e84ea7ce 17-Sep-2014 Dan Shi <dshi@chromium.org> [autotest] Ignore HTTPError and URLError when trying to get board from AFE

For tests running in a local chroot, it makes no sense to get board from lab
AFE. Any failure from RPC call should be ignored.

BUG=chrome-os-partner:31578
TEST=test_that 100.96.48.150 security_ProfilePermissions

Change-Id: Ib527ae7131876a519681987940bb6622cb83b47a
Reviewed-on: https://chromium-review.googlesource.com/218672
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
da8c60af1e1e3ee97170c700d0b72991687e35a2 03-Jun-2014 Michael Liang <michaelliang@chromium.org> [autotest] Migrate graphite directory to client/common_lib/cros

This change allows us to report stats in client tests.
1. Change import paths for all files that import modules from graphite
2. Clean up some unused modules
Related CL: https://chromium-review.googlesource.com/#/c/202467/
BUG=chromium:237255
TEST=Ran scheduler locally, scheduled reboot jobs, verified stats such as monitor_db_cleanup.user_cleanup._cleanup were reported on chromeos-stats.
DEPLOY = apache, scheduler, host_scheduler
Change-Id: Iebfe3b8acc1c363a0b70ea555744e85d1367cb67
Reviewed-on: https://chromium-review.googlesource.com/202727
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Michael Liang <michaelliang@chromium.org>
Tested-by: Michael Liang <michaelliang@chromium.org>
/external/autotest/server/autoserv
ca76bcccd6b8029bb0c3fcf72b1c4649e7fad9b1 19-Apr-2014 Alex Miller <milleral@chromium.org> [autotest] Pass --job-labels to cleanup.

Cleanup runs through a completely different flow from the rest of the
special tasks, so I missed it when threading things through the first
time...

BUG=chromium:334418
TEST=Logged job_labels from cleanup, saw labels

Change-Id: Ia7f78e6e3099f3d0ebddb777fc52e1f0cec984be
Reviewed-on: https://chromium-review.googlesource.com/195710
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
/external/autotest/server/autoserv
667b5f2b48c6096f944a34ca53e769c1031be45f 01-Mar-2014 Alex Miller <milleral@chromium.org> [autotest] Special task control segments take label-dependant actions

Autoserv accepts the labels of a job via the --job-labels argument, and
feeds them into the control segment by injecting the variable
`job_labels` into the global namespace.

cleanup/verify/repair/reset now use the same sort of loop that provision
does to look up additional tests to run that depend on the labels passed
into the control segment.

Note that some care has to be taken here, as we're moving the labels
from --provision to --job-labels, and I'd rather remove a bit of
migration code later than make for a complicated deploy.

BUG=chromium:334418
TEST=special tasks still run fine

Change-Id: I1596b49905f1500e8ce01e81d9aab2a6c7db111f
Reviewed-on: https://chromium-review.googlesource.com/188454
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
/external/autotest/server/autoserv
d6b8377f09d721933f6e1a0aae28fb2e7ff5eeff 07-Jan-2014 Simran Basi <sbasi@chromium.org> [autotest] Add faulthandler to autoserv

This change adds the faulthandler package as a new external_package.
It then imports it to autoserv and then registers SIGTERM. This will
dump the thread's current traceback on SIGTERM then execute the
previous signal handler.

BUG=chromium:302815
DEPLOY=build_externals
TEST=Executed build_externals and ensured faulthandler was downloaded
and installed and that re-executing build_externals did not reinstall
it. Then ran sleeptest with a 1 minute timeout and ensured the
faulthandler output showed up in autoserv.DEBUG when the scheduler
aborted it.

Change-Id: Id59f897bb766a821ef463c8166531db480c68041
Reviewed-on: https://chromium-review.googlesource.com/181688
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
49e21e6f66df4cca76824a9e10dec55c4e94cf0d 17-Oct-2013 Simran Basi <sbasi@chromium.org> Autoserv: Log end of sigterm handler

I verified we do reach the sigterm handler before these suites die
via sigterm. Now checking that the handler finishes before the drone
sends SIGKILL.

BUG=chromium:302815
TEST=local setup

Change-Id: Ic628cad7ae94cb11d30a0fb771ed69d9a005577f
Reviewed-on: https://chromium-review.googlesource.com/173593
Reviewed-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
9d9b7294346752a5668d4f61c95d3888a9fec33c 17-Oct-2013 Simran Basi <sbasi@chromium.org> Autoserv: Log SIGTERM Signals.

To help debug what is happening with the suites dying without writing
exit code, lets log when SIGTERM is received by autoserv. If this
message appears missing when the errors occur, the process would not
have received SIGTERM and if it does receive the signal it disproves
the theory the signal is not received.

BUG=chromium:302815
TEST=local setup

Change-Id: Ie6a72da1e1758998825d292f5a0e577eb6e90572
Reviewed-on: https://chromium-review.googlesource.com/173325
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
/external/autotest/server/autoserv
6cc20de4cde89b9613d051dc947f68e425f342f3 07-Sep-2013 Fang Deng <fdeng@chromium.org> [autotest] Set default value of --ssh_options to an empty string

This is a better solution to ensure ssh_options is not None.

TEST=Local job runs and ssh commands in the job succeed.
BUG=chromium:286498

Change-Id: I6f05972e476bd1de87623615c157c5db78b06247
Reviewed-on: https://chromium-review.googlesource.com/168492
Tested-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
/external/autotest/server/autoserv
276c5cc2042251a76c1f209aa4e39c79014f2d56 05-Sep-2013 Fang Deng <fdeng@chromium.org> [autotest] Make sure ssh_options is not None in server/autoserv

By default ssh_options will be None, resulting a bad ssh
command like '/usr/bin/ssh -a -x None -o ...'
This cl ensures ssh_options will not be 'None'.

TEST=Shedule a job, confirm it can ssh to the DUT and job completes.
BUG=None

Change-Id: I3e77135d20edc9f4681040bea35c7eb158ae737a
Reviewed-on: https://chromium-review.googlesource.com/168129
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
/external/autotest/server/autoserv
c5947faa755945f81537c6c33c322dccacac0ade 04-Sep-2013 Aviv Keshet <akeshet@chromium.org> [autotest] add a --ssh_options option to autoserv

This CL follows the template of
https://chromium-review.googlesource.com/167415

BUG=chromium:285378
TEST=Unit tests pass. Manually verified that specifying
--ssh_options="-F /dev/null -i /dev/null" caused those flags to be
threaded into ssh commands.

Change-Id: Ie0496862d05d42192d55501fc0ed1c3a6274fe79
Reviewed-on: https://chromium-review.googlesource.com/168099
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
/external/autotest/server/autoserv
d1c2b73b7a1cbc74701ddc2b6bbbb3a162ace047 20-Aug-2013 Fang Deng <fdeng@chromium.org> [autotest] Make ssh verbosity flag as an argument of SiteHost

We are appending ssh verbosity option to site_host.GLOBAL_SSH_COMMAND_OPTIONS
in autoserv. This was a hacky workaround because make_ssh_command
didn't take a host object as an argument when the code was written.

make_ssh_command has recently been refactored as a method in SiteHost. Now we
can pass ssh verbosity option as an arg to the _initialize method of
SiteHost and remove the hacky global variable.

The verbosity option is threaded through autoserv, server_job, hosts.factory
to SiteHost as what we do for passing ssh_user/ssh_pass.

BUG=chromium:276628
TEST=Run test_that with --ssh_verbosity 1, confirmed detailed debugging
info in output; Verify/Repair/Reset jobs work; Dummy tests work.

Change-Id: Ic51a65c16e061a4d5eb940da6fdfec8c40b51d98
Reviewed-on: https://chromium-review.googlesource.com/167415
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
/external/autotest/server/autoserv
5c40ec6dc042191a3925b089f5647fd212179868 20-Aug-2013 Aviv Keshet <akeshet@chromium.org> [autotest] improve logging in autoserv main()

Prior to this CL, if autoserv's call to run_autoserv threw an exception,
the stacktrace was printed to autoserv's stdout but not otherwise logged
anywhere. This CL causes these exceptions to be logged appropriately.

A debug level logging message giving autoserv's arguments has also been
added.

BUG=None
TEST=Ran autoserv directly; stracktrace shown in stdout. Started a suite
in such a way as to throw an exception from run_autoserv; stacktrace
visible in autoserv.DEBUG log file.

Change-Id: Ic2896b78185e7f96e8b4fec421858fe5aa503245
Reviewed-on: https://gerrit.chromium.org/gerrit/66405
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/server/autoserv
18ee314517d7977c03436f179c202263890938c6 13-Aug-2013 Aviv Keshet <akeshet@chromium.org> [autotest] add an --ssh_verbosity flag to autoserv

This CL adds an autoserv flag to tune the ssh logging verbosity. This is
accomplished by adding a global process-wide GLOBAL_SSH_COMMAND_OPTIONS
variable to site_host, to which autoserv tacks on a '-v' or '-vv' or
'-vvv' string if necessary. This is, admittedly, a little dirty. But the
make_ssh_command does not take a host object as an argument, so to add a
option host-wide to ssh_commands at the host object level would require
some major changes.

BUG=chromium:271621
TEST=Manually ran client/tests/dummy_Pass with various --ssh_verbosity
values, both valid and invalid. Saw that desired ssh verbosity was
realized.

Change-Id: If705c03f9d9d70de89642f42904e2e9fdc40bf61
Reviewed-on: https://gerrit.chromium.org/gerrit/65625
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
/external/autotest/server/autoserv
bbc1613edf8b345985249af399c15b9988cc2e31 10-Jul-2013 Dan Shi <dshi@chromium.org> [autotest] check if control object has name attribute before accessing it

Control file created in certain way may not have name attribute, e.g.
./run_remote_tests.sh --board=daisy_spring --remote=XXX --servo suite:faft_bios

BUG=chrome-os-partner:20773
TEST=time server/autoserv -m 172.22.75.225 -c
client/site_tests/dummy_Pass/control #change NAME to name_ in control file.
DEPLOY=none

Change-Id: Ie7f7e28da6e67ac30799148fd8d8c200884f3363
Reviewed-on: https://gerrit.chromium.org/gerrit/61354
Reviewed-by: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
8a91f23cf8a705946a71220dc0c6f06e0987b74a 09-Jul-2013 Christopher Wiley <wiley@chromium.org> autotest: Add flag to autoserv to disable sysinfo step

This saves us time when we don't care about this step.

BUG=chromium:258507
TEST=Ran autoserv directly with --disable_sysinfo and observed
appropriate messages omited/emited.

Change-Id: I57af12a2216a87ecb2c5719591eb1d2497731404
Reviewed-on: https://gerrit.chromium.org/gerrit/61299
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
/external/autotest/server/autoserv
a1ecd5c903928f359cd6cbcff5c986652e109599 06-Jun-2013 Dan Shi <dshi@chromium.org> [Autotest] Measure autoserv run time end to end with graphite

Add a whitelist in global config to store a white list of test with run time
measurement enabled. Autoserv uses the white list to filter tests need to
have run time measured.

BUG=chromium:237811
TEST=tested with autoserv in local machine
DEPLOY=none

Change-Id: I6340f5984d47143f648aa8907e4941856a89dbbd
Reviewed-on: https://gerrit.chromium.org/gerrit/57807
Tested-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
07e09aff0baf871b33e5479e337e5e3e0523b729 12-Apr-2013 Dan Shi <dshi@chromium.org> [Autotest] merge cleanup and verify

The objective of this CL is to merge cleanup and verify into a single job to
reduce run time of each test. In existing design, by default, a cleanup job is
scheduled after a test is finished, and a verify job is scheduled before a
test is started. By merging these two jobs together, we are seeing the total
run time of these two jobs is reduced from about 47s to 37s, around 10s saving.
That does not include the saving on scheduler to schedule two jobs, which may
take another 5-10s.

The design is to create a new special task, reset, which runs at the beginning
of a job by default. Verify task is changed to not to run by default before a
job starts. Cleanup job will only be run if a job is scheduled to reboot and
any test failed in that job.

BUG=chromium:220679
TEST=tested with run_suite in local machine
DEPLOY=afe,apache,scheduler,change all users' preference on reboot_after to
Never, sql: |update chromeos_autotest_db.afe_users set reboot_after=0|

Change-Id: Ia38baf6b73897b7e09fdf635eadedc752b5eba2f
Reviewed-on: https://gerrit.chromium.org/gerrit/48685
Commit-Queue: Dan Shi <dshi@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/server/autoserv
f594c5ee0a769d00b0f0e8a6ebe1c6e19cf53417 04-Jul-2013 Christopher Wiley <wiley@chromium.org> autotest: Allow crash collection to be skipped

Expose this functionality as a flag that defaults to collection crashes
as normal. This makes test runs faster for developers iterating a
test/patch.

BUG=chromium:250366
TEST=Ran a test, observed that collection was skipped.

Change-Id: I61d76ef3618a6bc7e3228fa7ee8bf32dafaec53d
Reviewed-on: https://gerrit.chromium.org/gerrit/60953
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
/external/autotest/server/autoserv
cb6f1e2209ae6ea09c78317b114db6e51f6e255b 29-Jun-2013 beeps <beeps@chromium.org> [autotest] Teach autoserv to check a hosts job_repo_url.

Autosev now understands a verify_job_repo_url flag to
mean 'execute a control segment to verify said hosts
contain a valid job_repo_url'. It does this by re-staging
autotest packages at the job_repo_url; If the devserver
embedded in the job_repo_url is unresponsive we get another
devserver, stage autotest on it, and update the job_repo_url.
If the job_repo_url is None we leave it, on the assumption
that the host will go through a re-image before it runs
any tests, which will give it a new job_repo_url.

Pros:
1. If we are unable to stage autotest packages at
job_repo_url the test will fail, soon and fast.
2. Since we perform these actions in the server_job itself
we won't see package installation exceptions later on,
which are just misleading today since we end up
rsyncing client autotest anyway.

Cons:
1. The re-image job will actually try staging the contents
of an autotest build it will surely not need. Something
along these lines is unavoidable in most clean solutions,
though.

TEST=
1. Ran smoke suite, deleted autotest packages on devserver
just before security_Minijail, made sure it passed.
Also deleted the entire build directory.
2. Ran a suite with a bad devserver in the job_repo_url
and confirmed we resolve to a good one, restage
autotest and reset the job_repo_url.
3. Ran a suite after recovery (job_repo_url=None).
4. Invoked autoserv with a list of machines.
5. Checked that cleanup, verify, repair don't get the
verify_job_repo_url flag, and hence, don't re-stage.
Cleanup still passes because it rsyncs client
autotest in the invalid job_repo_url case.
6. Server job fails before running tests if devservers
are down or we're unable to change job_repo_url.
7. BVTs pass

BUG=chromium:255114

Change-Id: I3c5f445962707a0a089f9d755aed4c4d0fdbd8f2
Reviewed-on: https://gerrit.chromium.org/gerrit/60578
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Prashanth Balasubramanian <beeps@chromium.org>
Commit-Queue: Prashanth Balasubramanian <beeps@chromium.org>
/external/autotest/server/autoserv
cb79ba7249e62ab26662362908a747fe8b153d93 29-May-2013 Alex Miller <milleral@chromium.org> [autotest] Add provisioning flag to autoserv.

autoserv now accepts a --provision flag that accepts a comma seperated
list of labels that it should provision the targeted machine(s) (via -m)
to. This list gets fed directly into the control segment, which handles
all of the processing of it and provisioning work.

It should also be loudly noted that since we run the provision control
segment as a normal test instead of directly executing the contents, one
cannot specify the -c flag, or else it will try to run the provision
control segment as a client-side test.

This is just some plumbing. It's pretty uneventful.

BUG=chromium:249437
TEST=The following:
1) Ran autoserv --provision cros-version:lumpy-release/R28-3993.0.0 and
the machine was provisioned correctly.
2) Ran autoserv -c --provision and received an error.

Change-Id: I03582a5210d182f171ef725c4e49cc83c1baf793
Reviewed-on: https://gerrit.chromium.org/gerrit/58384
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Prashanth Balasubramanian <beeps@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
/external/autotest/server/autoserv
91493c88a1506729a6728660d90cfae591cd52aa 25-Jan-2013 Scott Zawalski <scottz@google.com> Introduce a mechanism for retrying tests at the control file level.

If a test returns unsuccessfully and --retry-test > 0 is specified the test
will be rerun. Options were added to autoserv and are passed through to the
client side job by modifying the base_job.

Tests that fail and then succeed within the --retry-test limits will have a
test keyval set with the number of attempts |test_retries_before_success|.

--retry-test can be utilized immediately in run_remote_test but will need to
be piped through the RPC system and down to the scheduler to provide the proper
--retry-test value from the scheduler's perspective.

Fixed random pylint errors consisting mostly of unused imports.

TEST=unittests
created a randomly failing client and server side test and ran it on devices
BUG=chromium-os:37158

Change-Id: Ibec3935b5f6fd28fc1b6eb7be55de27a571ad777
Reviewed-on: https://gerrit.chromium.org/gerrit/42043
Commit-Queue: Scott Zawalski <scottz@chromium.org>
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Tested-by: Scott Zawalski <scottz@chromium.org>
/external/autotest/server/autoserv
de6bb19fc6dd6d613c943acbba074f9423b204de 31-Jan-2013 Aviv Keshet <akeshet@chromium.org> [autotest] Fix a tiny irritating docstring typo

BUG=None
TEST=None

Change-Id: I740cb75b5c4d75b8b87e929e8e00e04ba4e1e057
Reviewed-on: https://gerrit.chromium.org/gerrit/42353
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/server/autoserv
0528d6f43c814d7e888b2cb97085f51e1102d3de 11-Jan-2013 Alex Miller <milleral@chromium.org> [autotest] Exit on SIGALARM.

No more SIGALARM chaos, so let's not continue to hide SIGALARM issues.

TEST=pylint
BUG=None

Change-Id: I1d42375c556ecbedb4a16ad6a992eaa8077608fb
Reviewed-on: https://gerrit.chromium.org/gerrit/41136
Tested-by: Alex Miller <milleral@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
/external/autotest/server/autoserv
f1af17e4efeaf4407710bcf21b2d2e7b07f51a99 10-Jan-2013 Alex Miller <milleral@chromium.org> [autotest] Modify autoserv to log SIGALARM.

We have some code using SIGALARM. If a stray one escapes, it takes down
the entire process silently. That's kinda not cool.

If we get one, for the brief moment, let's log it and continue on. Once
our current problem goes away, let's log it and exit semi-gracefully.

TEST=Ran it
BUG=None

Change-Id: I28730488f52bbf4b3281aca173d5b1eec6c429db
Reviewed-on: https://gerrit.chromium.org/gerrit/41003
Commit-Queue: Alex Miller <milleral@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
/external/autotest/server/autoserv
861b2d54aec24228cdb3895dbc40062cb40cb2ad 04-Feb-2011 Eric Li <ericli@chromium.org> Merge remote branch 'cros/upstream' into master

Merged to upstream autotest @4749~@5215.

The entire change list description is too big to enlist here. Please refer to upstream (http://autotest.kernel.org/browser) for more details.

BUG=
TEST=emerged both x86 and arm build.
Tested emerged x86 build bvt against a chromeos device.

Review URL: http://codereview.chromium.org/6246035

Change-Id: I8455f2135c87c321c6efc232e2869dc8f675395e
/external/autotest/server/autoserv
8a60d1e1da306702d0003e452494ab9bd1637d73 01-Feb-2011 David Rochberg <rochberg@chromium.org> Ignore SIGTTOU.

SIGTTOU was causing a hang in terminals with tostop set (which seems to be the default for my local emacs configuration).

Signed-off-by: David Rochberg (rochberg@chromium.org)
BUG=chromiumos:7716
TEST=stty tostop, then run with and without this change. Without the change, tests will hang in a SIGTTOU/syscall-restarted loop.

Change-Id: Ib5317e238b68089d71e8e57418717e7553fd64d9

Review URL: http://codereview.chromium.org/6368022
/external/autotest/server/autoserv
e0cbc912c81acfb8844510267b2cefd64d9ae478 11-Mar-2010 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add support to autoserv for a --control-filename parameter, to allow users to
control where in the results directory autoserv will store the server control
file.

This also changes the archving stage in the scheduler to make use of this
argument, so that the control file from the archving stage is written to
control.archive and does not overwrite the control.srv from the job itself.

Signed-off-by: John Admanski <jadmanski@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4294 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
566d3c05ae7bb816f09b138b79f0f7e287e4d163 12-Jan-2010 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> In autoserv, be more lenient when deciding if results exist. The problem was that we were running parsing/archiving on repair failed results, but those don't include a control.srv (we simply run autoserv -R).

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4103 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
4608b005f15444d2ec4601b8274828ad52b5ea51 05-Jan-2010 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add a new Archiving stage to the scheduler, which runs after Parsing. This stage is responsible for copying results to the results server in a drone setup, a task currently performed directly by the scheduler, and allows for site-specific archiving functionality, replacing the site_parse functionality. It does this by running autoserv with a special control file (scheduler/archive_results.control.srv), which loads and runs code from the new scheduler.archive_results module. The implementation was mostly straightfoward, as the archiving stage is fully analogous to the parser stage. I did make a couple of refactorings:
* factored out the parser throttling code into a common superclass that the ArchiveResultsTask could share
* added some generic flags to Autoserv to duplicate special-case functionality we'd added for the --collect-crashinfo option -- namely, specifying a different pidfile name and specifying that autoserv should allow (and even expect) an existing results directory. in the future, i think it'd be more elegant to make crashinfo collection run using a special control file (as archiving works), rather than a hard-coded command-line option.
* moved call to server_job.init_parser() out of the constructor, since this was an easy source of exceptions that wouldn't get logged.

Note I believe some of the functional test changes slipped into my previous change there, which is why that looks smaller than you'd expect.

Signed-off-by: Steve Howard <showard@google.com>

==== (deleted) //depot/google_vendor_src_branch/autotest/tko/site_parse.py ====


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4070 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
a5f5e548abbea73b567f42011db0093195a81743 30-Dec-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Ensure USER environment variable is always set within autoserv.
Many server side tests depend on it & it doesn't hurt to be a pedant
about environment vars.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4067 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
cb8cb33f81374f9493c7c713dff4f905cbc20bdd 03-Sep-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Don't require the atfork module by default (via the config file). Test
developers and casual users of autoserv should not need to install any
external python modules in order for it to work.

Signed-off-by: Gregory Smith <gps@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3657 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
9ff89cdd8781fbaa4dd01f8c261b70009bb1a39e 03-Sep-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> atfork fixups are only needed for autoserv as it is the only thing that ever
uses threading (via paramiko). atfork won't be present on the client and
thus cannot not be imported and used in client/setup_modules.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3645 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
e7d9c605bacd7b1816987994ae18a68c63306a16 02-Jul-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Make the job executiontag available in both the server and client side job
objects as job.tag.

This is useful if your job would like to copy its data off directly to a
results repository on its own from the client machine.

Mostly small changes to pass the data down, though I did some docstring
cleanup near code that I touched which makes the diff larger.

The execution tag is taken from the autoserv -P parameter if supplied
and no explicit --execution-tag parameter is supplied. This prevents
the need to change monitor_db.py to pass yet another autoserv parameter.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3359 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
c229956e546e1398cce5ca80203363b303b8fbe7 02-Jul-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Rename the signal handler function to match its actual use.
The realuser local was never used, get rid of it.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3356 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
10d8417b8c3576e1ba80ce00b6ae2e9cea826bc0 19-Jun-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> add two logging-related options to autoserv:
--verbose sets the console to DEBUG level output (this is added to autotest client as well)
--no_console_prefix disables the logging prefix entirely on the console

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3301 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
043c62a3b9d943f0b3d3a4e6ac53b78101f5c06f 10-Jun-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Ensure all entry points get the import-time logging logic executed before other autotest imports.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3253 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
75cdfee87bfaa3cf3f9860832b228a6d32aaed2f 10-Jun-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Make autoserv and autotest client use the new logging_manager system. I'd like to split them into separate changes, but the change in common_lib.test means it all has to change at once.

this replaces the old ini-style logging configurations with code-based configurations. i know the ini files were easier to read, but we're doing a lot more fancy stuff with logging and these give us much more power and less duplication. as one example, we'll probably move very soon to having separate .DEBUG, .INFO, .WARNING, and .ERROR logs. This will allow us to make a centralized change to make that happen, rather than duplicating a whole bunch of information across .ini files, and it'll make the information much more concise.

Risk: Gravely high

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3243 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
332000a0c766fb910f64e95b515ee0bef9a9e9f2 08-Jun-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Wrap the Host object garbage collection out so that it gets run on
verify and repair tasks, as well as normal jobs.

Risk: Low
Visibility: Should avoid leaving host garbage behind after repair and
verify jobs.

Signed-off-by: John Admanski <jadmanski@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3215 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
374f3419ad5de9e9c8047928d0851732f0b7c6da 13-May-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Adds a -G to autoserv to be able to set host_group_name in the group keyvals
file that it writes. Useful only if someone has asked autoserv to run the
parser itself.

The scheduler does not need this as it will write that keyvals entry itself.

Adds a unittest for autoserv_parser and fixes a minor bug in --args support.

Signed-off-by: Gregory Smith <gps@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3137 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
d3dc199703bfb8784a2f8f072d0514532c86c0a9 22-Apr-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add support to the scheduler to run autoserv --collect_crashinfo after a job finishes or is aborted.
* added new state "Gathering" for when we're running collect_crashinfo and copying logs to the results repository
* added new GatherLogsTask to the scheduler to perform these two tasks, and made it get run either after a job finishes or after a job is aborted. this task shares a lot with FinalReparseTask, so extracted common code into a new PostJobTask.
* made changes to scheduler/drone code to support generic monitoring and recovery of processes via pidfiles, since we need to be able to recover the collect_crashinfo processes too. this will also made the scheduler recover parse processes instead of just killing them as it does now, which is nice.
* changed abort logic significantly. since we now need to put aborted jobs through the gathering and parsing stages, but then know to put them into "aborted" afterwards, we can't depend on the old path of abort -> aborting -> aborted statuses. instead, we need to add an "aborted" flag to the HQE DB table and use that. this actually makes things generally cleaner in my opinion -- for one, we can get rid of the "Abort" and "Aborting" statuses altogether. added a migration to add this flag, edited model and relevant logic appropriately, including changing how job statuses are reported for aborted entries.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3031 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
9554eb4da688d7911b0a69cdb5c58cf77d6386d6 08-Apr-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fixing a bug reported by Martin when running autoserv with the -N flag.

It turns out that sometimes we might not have a working handler at the
time we are trying to configure it. So before trying to do anything,
perform a check, and if we don't, create one.

Visibility: Users of autoserv -N that were hitting the bug will have it fixed.
Risk: Low (simple change)

Signed-off-by: Lucas Meneghel Rodrigues <lucasmr@br.ibm.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2977 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
a788dc4106627b2dc423d3c8e89fc8fd6c03c2b6 26-Mar-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> New version of the patch, I moved the logging config code right before
all the results directory checking, also made autoserv handle the flag
-N appropriately. While I was there, I found some bugs exposed by the
collect logs feature recently introduced when using autoserv with the
flag -N. So I think it's better to have everything fixed on one patch.

From: lmr



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2939 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
def0c3cccb3b77b2c7e3a90f427cf4a70292dfd9 25-Mar-2009 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Add support for running autoserv with a "--collect-crashinfo" flag
that tells autotest to run a job that includes ONLY the crashinfo
collection. This will pull back crashinfo, and if run against a
results directory from a crashed job it will also pull back any
client results that it can find on the remote host.

Risk: Low
Visibility: Adds a new mode to autoserv for just doing crashinfo
collection.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2933 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
b18134f8faa7c5b4623760bc88650a65e70b2cac 20-Mar-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> As discussed on the mailing list, we implemented logging with a single
root logger and logging configurations per entry points. The entry
points affected are:

* Autotest client
* Autoserv
* Scheduler

We are sending patches for each one of those entry points. Now we don't
need to 'grab' loggers anymore to log messages, only need to use the
utility functions:

logging.info('msg')
logging.debug('msg')
logging.warning('msg')
logging.error('msg')
logging.critical('msg')

Which reduces complexity of the log system, and makes it easier for
developers to log messages, just select the level, make sure the
standard logging module is loaded, and profit!

From: Lucas Meneghel Rodrigues <lmr@linux.vnet.ibm.com>
Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2915 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
a5cb40631a50dcf9235d124613e281f0ffc4d959 17-Feb-2009 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Cleaned up some useless imports and moved autoser_parser actual argument
parsing to be invoked by autoserv on startup instead of automatically on
import (and thus parsing/eating sys.argv from all other standalone
programs that somehow imported autoserv_parser).

Signed-off-by: Mihai Rusu <dizzy@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2801 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
ff7d61f6d8df20eb1147d80edc511fc268f0ba01 22-Dec-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix autoserv -N by making pid_file_manager conditional. Else it
fails because results is none

Signed-off-by: Martin Bligh <mbligh@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@2586 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
e0dffc33846303d4e7b0a87e28efe96db4399231 15-Dec-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> When a server job fails "normally" (i.e. after it's been properly
started) we should write the pidfile out asap and stop the
continuous parsing afterwards. This will allow the parser to properly
interpret the exit status of the job.

Risk: Medium
Visibility: The continuous parser will now be shut down after the
pidfile is properly written out.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2565 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
d5ab8c5c44a01b9a9699db574973174570e10eea 03-Dec-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Refactor the core pidfile code out of autoserv and into a common lib
module, and add a similar pidfile option to the parser.

Risk: Low
Visibility: Adds an (opt-in) .parser_execute pidfile to the parser.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2538 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
f22fea8f311c4d955b171a2e7869732d6a1067e4 26-Nov-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Add an --install-in-tmpdir option to autoserv that allows us to change
the default Autotest client install behaviour so that new clients
are installed in new temporary directories instead of the "standard"
locations. This only affects installs that don't explicitly request
a specific location.

The expected use for this is to allow the use of multiple server jobs
against the same machine without having them collide with one another.

Risk: Low
Visibility: Adds a new flag to autoserv, but the default behaviour
is unchanged.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2510 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
1ffd5dcd07851f4df5c756366ccfa50424caaf49 25-Nov-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix up bad merge

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2509 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
82648e58b0872754afa1cd7d131e43653a47b31e 20-Nov-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Revert accidental double-patching of last change

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2462 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
92c0fc2a49ec69a58afd464cd3f4191c057b36af 20-Nov-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Change autoserv to replace stdin with /dev/null.

From: John Admanski <jadmanski@google.com>
Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2461 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
80e1eba601ad04856da1c33dd60cb20035c899fb 19-Nov-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Enable autoserv to operate without a results directory

This is incredibly useful for writing small, non-invasive scripts,
using the power of autoserv

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2444 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
10717638c371e61282749359fde0c24342ae86c2 19-Nov-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Revert previous change to move results arg processing later down
Turns out the pidfile handling is not relevant

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2441 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
d6c56a9ec9b512c42cc1be30190117d86155f3d2 19-Nov-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Throw an exception if the specified results directory already exists.

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2439 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
53aaf388e48368aa0179622957912a5284b43dd1 17-Nov-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Add a hosts attribute to server jobs for accessing all the hosts in
use as part of a server job, and replace the __del__ method on hosts
with an explicit close. When the job finishes it will take care to
close out any hosts left in job.hosts.

This will allow us to implement generic code that operates on all
hosts currently in use, and also fixes the general reliabilty issues
that we've seen with the __del__ method.

Risk: Medium
Visibility: Host.__del__ calls are pushed off until the end of the
job, and all hosts in use are available via job.hosts.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2427 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
45ae819b2d2a67d0882edafaf1a8f7b95c3fb9d2 05-Nov-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add a formal cleanup phase to the scheduler flow.
-add a --cleanup or -C option to autoserv, which runs a new control segment, cleanup. this option and control segment obsolete the old -b option and reboot_segment control segment.
-change the RebootTask in the scheduler into a more generic CleanupTask, which calls autoserv --cleanup.
-change the host status "Rebooting" to "Cleaning"



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2377 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
49acee5948c70c0083af238c7b6203ec93d6e092 05-Nov-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Revert previous change to move results arg processing later down
Turns out the pidfile handling is not relevant

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2376 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
27b37eaaf57e5bc1eb1bbc06416f10afa4c8eb62 30-Oct-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Get rid of the job.aborted flag. It's not necessary, and it actually
makes it impossible to supress client job abortions (e.g. if the
server-sysinfo client job aborts, we don't abort the server job).

Risk: Low
Visibility: autoserv won't return non-zero codes on non-aborted jobs

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2362 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
adfe4315b7e0ebb29017bc761276a066269fed73 29-Oct-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Throw an exception if the specified results directory already exists.

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2359 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
0b8c32d2f78a5ae21495dd4a1363d0a9c7c32eb3 29-Oct-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> More debug module additions.
Without this we get a bunch of connected lines and no running lines in verify/repairs
Risk: Low
Visibility: Restores "running" commands in verify/repair logs and probably more I haven't seen yet

Signed-off-by: Scott Zawalski <scottz@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2354 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
7cd30fd9c5daca002046759e1bf44200803ff1e2 21-Oct-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Enforce use of a directory to put results in from autoserv

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2312 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
21baa459ea14f96e06212f1f35fcddab9442b3fc 21-Oct-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Add options to control reboots before and after a job.

-add reboot_before and reboot_after fields to Job, along with enums for each
-add options to create_job RPC for reboot_before and reboot_after
-add options to job create CLI for these fields, and made job stat -v display them
-add widgets to job create page in AFE for these fields and made job detail view display them

-add dirty field to Hosts, defaulting to True, and set to True when a host is locked
-made scheduler set this field when a job runs and clear it when a host is rebooted

-updated scheduler's PidfileRunMonitor to read a new three-line .autoserv_execute format, where the third line contains the number of tests that failed
-made scheduler Job.run() include a RebootTask before the verify task according to the reboot_before option
-made QueueTask.epilog() launch a RebootTask for each host according to the reboot_after option

-updated autoserv to write out a third line to .autoserv_execute containing the number of failed tests.

Other changes:
-added support for displaying Job.run_verify in the CLI (job stat -v) and job detail page on AFE
-updated ModelExtensions to convert BooleanField values to actual booleans. The MySQL Django backend just leaves them as ints (as they are represented in the DB), and it's stupid and annoying (Yes, bool is a subclass of int, so it's often not a problem. But yes, it can be.).
-get rid of use of Job.synch_count since we don't actually support it. I think this was meant for inclusion in a previous change and got left out.
-made the scheduler use the new setup_django_environment stuff to import and use the django models. It doesn't *really* use the models yet -- it just uses the Job.Reboot{Before,After} enum objects -- but this shows we could easily start using the models, and that's definitely the direction I want to go long term.
-refactored PidfileRunMonitor generally and made it a bit more robust by having it email errors for corrupt pidfiles and continue gracefully, instead of just crashing the scheduler
-changed the way Agent.tick() works. now, it basically runs through as much work as it can in a single call. for example, if there's a RebootTask and a VerifyTask, and the RebootTask has just finished, in a single call it will finish up the RebootTask and start the VerifyTask. this used to take two cycles and that was problematic for cases like this one -- the RebootTask would like to set host.status=Ready, but then the host could get snatched up on the next scheduling round, before the VerifyTask got started. This was sort of solved previously by keeping the HostQueueEntry active, and we could apply that approach here by making a new status for HostQueueEntries like "Rebooting". But I prefer this approach as I think it's more efficient, more powerful and easier to work with.

Risk: extremely high
Visibility: new reboot options for jobs, skip verify now displayed in AFE + CLI

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2308 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
cce191fc0d013a5e53f3fc01bfbe7c7dc32608fb 19-Sep-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Only do the split on input machines variable (from optparse) if
there are machines.

Signed-off-by: Travis Miller <raphtee@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2174 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
c69dfce4ce3e14ef32fb405df1cdcd942ce31e61 22-Aug-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Split on newlines, commas, tabs, _and_ spaces rather than just commas.

Signed-off-by: Jeremy Orlow <jorlow@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@2026 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
b2bea302ba5b469bcfbb093ac5b713153fc80413 24-Jul-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Added the aditional -s flag which specifies that a test is server side.
Will be ignored unless -c is also specified and will then throw an error.

Signed-off-by: Travis Miller <raphtee@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1898 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
fbc1f0a604bb31dade946ca37cbec1e2d92fbd8f 09-Jul-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Add support to job.repair for host protections, specified through a
--host-protection command line parameter. If no parameter is
specified, default to FILESYSTEM_ONLY.

This replaces the existing repair behaviour with the following:
1. If DO_NOT_REPAIR is specified, do nothing.
2. If FILESYTEM_ONLY is specified, use the existing repair
procedure.
3. If NO_PROTECTION is specified, first try the existing repair
process, and if that fails try host.machine_install.

Note that this doesn't yet make changes to the scheduler to pass in
the host protection values stored in the database, it just adds the
command-line support to autoserv.

Risk: Medium
Visibility: Adds a new option to autoserv for specifying host protection levels
during repair operations.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1791 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
161fe6f15154f056851e0dffe9b0c29109a09960 19-Jun-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Create the ability to add site_specific precheck code on server_job in a method called after stdout and stderr have been re-directed.

Signed-off-by: Travis Miller <raphtee@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1725 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
0afbb6369aa5aa9a75ea67dd9e95ec4b21c0c181 06-Jun-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Convert all python code to use four-space indents instead of eight-space tabs.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1658 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
a6f1308334f91fc5b9463cebe34a08d3be733f7c 06-Jun-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Changed the autoserv_parser to simple re-direct to getopts.

Signed-off-by: Travis Miller <raphtee@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1624 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
1965dfa167c65fea2c49536f1fc329ac7203828a 04-Jun-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> New options and automatic ssh key setup

Risk: Medium
Visibility: Adds three new argument options --ssh-user, --ssh-port, and --ssh-pass, which overrides the global default 'root' and '22' for all machines.

Adds the option to pass user, port and password per-machine in the format user:pass@host:port (overrides --ssh-user, --ssh-port and --ssh-pass).

Adds the pexpect.py and pxssh.py modules to autotest tree, these modules are used to interact with interactive programs.

The --ssh-pass option and pass field on machine string is used only to perform automatic ssh key setup on remote machines, which is also implemented in this patch.

Signed-off-by: Ramon de Carvalho Valle <rcvalle@br.ibm.com>
Signed-off-by: Lucas Meneghel Rodrigues <lucasmr@br.ibm.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1600 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
b7dcc7fff7439a9e5b73be2a4266ab78e4db5a21 02-Jun-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Factored parser out into a singleton that can be accessed anywhere. Also allowed the possiblity to
define additional site specific usage info and still have that info displayed via autoserv -h.
Will define site specific usage in future submissions.

Note: This is patch 1 of 2 patches that should be applied together.

Signed-off-by: Travis Miller <raphtee@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@1580 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
a6f2a48431cfdd44b6009d3158a96b7704e19816 01-May-2008 jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> Add a traceback.print_exc to autoserv to make sure caught exceptions
don't get thrown away.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1477 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
a46678d364360b329949cd94d21ed8a833fcda79 01-May-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Refactor autoserv a bit so that the pid file is written out earlier.

Note that, although this diff shows almost every line being modified,
def main() is where 99% of the code changes are, and it's a pretty
small function.

Signed-off-by: Jeremy Orlow <jorlow@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1475 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
fe0af111da175d673ba49926d1976a46fb40a657 17-Apr-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> The parser cleanup should be idempotent. Also, renamed from _cleanup
to cleanup_parser to make it clearer exactly what it's cleaning up.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1449 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
6437ff5bb28a0cc97582766826f866a39affae2a 17-Apr-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Use the new parser library directly inside of autoserv, instead of
repeatedly invoking the parser as a separate process. In order to
actually invoke this capability you need to pass in a -P option, with
the job name (tag).

In order to properly support the parsing of server-side synchronous
jobs you need to make use of job.parallel_simple, a new wrapper around
the standard parallel_simple that adds support for parsing the results
of all of the parallel jobs individually. Unfortunately, complex
server-side synch jobs that use parallel instead of parallel_simple
will be unable to take advantage of this.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1446 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
f5427bb08d4f783874e9de7fd31e259cb5207d36 09-Apr-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix up the importing in server/hosts to not be so fragile. Importing
utils from these modules was just a bad idea (it depends on the server
dir being in sys.path) and the circular references between some of the
modules are making things unnecessarily fragile.

The main changes are:
- converted all of the imports from the server directory and from
the common lib into absolute imports (i.e. from autotest_lib.*)
- moved the RemoteHost definition into a remote.py file, so that
SiteHost can subclass Host without introducing a circular
dependency between base_classes and site_host

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1417 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
c251a1f50b34b0008d966815c241f330f8e45aa5 26-Mar-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Change autoserv to replace stdin with /dev/null.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1367 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
9e61878d23ed4a8ef9d59db8dcbd4d15f68e1865 13-Mar-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add --help and -h to autoserv

Signed-off-by: Scott Zawalski <scottz@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1340 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
bb421856ea42a8c2f5895c2a643b2b1548f63600 11-Mar-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> This patch enables the scheduler to pick up jobs that were left running after it crashes, and see them to completion.

-autoserv writes .autoserv_execute file with pid + exit status
-PidfileRunMonitor class in monitor_db uses this file to track running autoserv processes, double-checks with /proc filesystem
-monitor_db default recovery changed to
-pick up running QueueEntry processes
-kill other autoserv processes
-requeue verifying queue entries
-reverify hosts that were left in verify/repair
-monitor_db optional host recovery flag verifies Repair Failed hosts, and looks for running hosts with no corresponding active queue entries

The --no-recover scheduler option has been removed. The scheduler always recovers running jobs when starting up. There is a new --recover-hosts options, which forces the scheduler to reverify all dead hosts. Shutdown mode has also been removed from the scheduler, since the scheduler may now be upgraded by simply killing and restarting it.

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1332 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
38c2d035460dccec53e52304495debd22cd2a93d 07-Mar-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Changed sighandler in autoserv to call SIGKILL on its children instead of SIGTERM.
Changed monitor_db to call SIGTERM only once. We call SIGCONT before SIGTERM in order to make the stopped process continue.

Signed-off-by: Svitlana Tumanova <stumanova@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@1312 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
f7243e1e10d8157877a8c99b718f01d3a8cc43f2 05-Mar-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Implemented proper kill for autoserv: on receival of a SIGTERM it will kill its children.

Tested by running tests, aborting jobs and observing via ps -ef that everything gets cleaned up.

Signed-off-by: Svitlana Tumanova <stumanova@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@1300 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
ed4d6ddc79993492b22aeeb36574b3cb7c8bad44 27-Feb-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> glocal_config patch

This patch contains the global_config class and the global_config.ini file (located in root dir). This patch also includes changes to tko/db.py so that rather than using tko/.database and tko/.priv_login, it reads the needed info from the global_config

travis miller





git-svn-id: http://test.kernel.org/svn/autotest/trunk@1271 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
394ff51dcddaf845dd41b16335a164d55c4f365f 21-Feb-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> If running a server job throws an uncaught exception treat that as if
the job failed.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1260 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
535a4546398fd66949c28e0eaa6a0664a38f2627 11-Feb-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Eliminate duplicates and sort the machine list so it's deterministic.

From: Jeremy Orlow <jorlow@google.com>
Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1229 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
0c3548d838c50decb2d48ed20648f6a84d5dd4c5 01-Feb-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Move check_version into the common utils and make sure we run it for any
autotest binaries which require 2.4.

Signed-off-by: Jeremy Orlow <jorlow@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1214 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
e5cd0fd3fa5d6ae6f2a634bfb4fad6f8f113941b 27-Jan-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Provide an options not to tee the output to stdout/stdderr.

This saves 2 tee processes per autoserv. We only want the autoserv
output on the console when it's run by hand

Signed-off-by: Martin J. Bligh <mbligh@google.com>




git-svn-id: http://test.kernel.org/svn/autotest/trunk@1207 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
e25fd5bfba721e315795eabb712215eeb8d2af39 22-Jan-2008 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Change verify to throw an error if it fails, and record things
correctly

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1188 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
e8b37a9b94566f7a44da5f56a84aa6f348b2db2a 19-Dec-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix up parse so it can reparse a job - allows continuous status

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1087 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
dbf3761547534eb3afc1d4e34e5ef3e2021ae303 24-Nov-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Produce proper errors when given an invalid machine list

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@971 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
faf0cd4c3c8845010909a15a3c5ff355eb26b24f 19-Nov-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Running autotest_client should give the same exit status as running
autotest directly (i.e. non-zero on ABORT, zero otherwise). Also,
running autoserv should produce a non-zero exit code if it runs a
client-side test that is aborted, although this does not actually
abort the server-side job itself.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@944 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
1d42d4ed1b9e96eedffa5b14cae18b9f1a4da95d 05-Nov-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add a simple verify and repair function to autoserv for the
scheduler to call. This does a little bit of stuff each, and will
be useful, but basically it's a starter

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@922 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
74fc0463f60ba1a597ce49c13f479eaed92468fe 05-Nov-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add email reporting to failing tests when parsing results
* added failtest for testing this (and anything else that needs a failing test
)
* Improved readability in parse script output
* Added getopt() for parse and added -m option for sending mail on failures
* pulled mail* functions in from mirror/mirror
* Get a realuser value in autoserv for run tests
* Fix jobkeyval value

From: David McMahon <djmm@google.com>
Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@910 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
842c659b7d0f9a4d7781c28fd863aeb9a645af20 05-Nov-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add -M option to autoserv to pick up list of machines from a file

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@890 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
fdbe7d9d7e3a43f8d91b862b3dbf46125f7ff640 05-Nov-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Run abspath on results dir

Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@889 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
3f4bced3bd862f2ab96f3672631d0160aa7c1e37 05-Nov-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Make sure stdout and stderr are written to autoserv.std* files.

From: John Admanski <jadmanski@google.com>
Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@883 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
40f122af3435761f0211cf3b473d45d397526396 04-Nov-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Allow site-local extensions to autoserv, and a custom site install
of the autotest client

From: Steve Howard <showard@google.com>
Signed-off-by: Martin Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@876 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
f36243d8ac8d14e9fee56b304657413c4cd1ea23 30-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Below is the shell for installer support. At the moment, this is
only useful for hooking into the Google installer, but the code
is generic - need to add a class for supporting one of the open
install tools elsewhere.

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@862 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
4ef8623bf0d40efa7fc248af43f1d5de2f19c6a0 23-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix autoserv usage args

From: Jeremy Orlow <jorlow@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@826 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
18420c23e5acc2713f4719a3b56b3823252fa497 17-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Change 'tag' to 'label' for labelling jobs with arbitrary info

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@810 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
3673e75bec8470e03ea76a99135295a0c1db4799 16-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix spacing in autoserv



git-svn-id: http://test.kernel.org/svn/autotest/trunk@802 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
f1c52841de1cad263a0ec83ee551deeff0cc0bb2 16-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Move the meat of autoserv into a separate job class, and provide logging
functionality to a server-level status file

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@801 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
e26768583542ab459581d01b6f88c2f07feed126 13-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> We need the preamble here, otherwise it autoserv doesn't know about
parallel simple.

From: jorlow@google.com
Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@798 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
cc2c3a6a0f83a881b62632d47b53a2de8a4e06e6 12-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Reboot at the end of a test by passing -b to autoserv.

From: djmm@google.com



git-svn-id: http://test.kernel.org/svn/autotest/trunk@792 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
9d1c730154ede686f5e209c30cdf2ae5edc7d095 07-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Rework much of the autoserv script. Support -c for client side control files

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@777 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
9ff1a3a9b0fb5c256049b26d5e09ccc74eae230a 06-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Make sure sys.argv[0] is an abspath from autoserv

We use this later to figure out the autotest client directory, and we may
have chdir'ed by then in parallel_simple, which will break it.

Signed-off-by: Martin J. Bligh <mbligh@google.com>

Thanks to Mandeep Singh Baines <msb@google.com> for figuring out what
was wrong with it.



git-svn-id: http://test.kernel.org/svn/autotest/trunk@759 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
5fadbfe153c3bfd8a363d23e8d70bc58ff7f834e 06-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Cleanup autoserv (spacing, etc)

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@758 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
6203ace0d24c31827037f5e7e4a8749ea7353801 04-Oct-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Split stdout and stderr for monitor_queue into separate files,
and make the log files unbuffered so we can actually see what's going on

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@750 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
95fca57b591168e3d6673bfd025c21295142e827 27-Sep-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fixed up fucked spacing

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@703 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
c99add655b54c688fc0b1eda98f74a6c208d01e7 27-Sep-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix for autoserv's param handling

From: jorlow@google.com

OptionParser (and getopt) assume that they know of all options your program
uses. Unfortunately, this means that control files that want to have their own
options are out of luck. This patch parses the machine option manually in order
to get around this. It also now passes extra args to the control file (like
what was done in a much older version).




git-svn-id: http://test.kernel.org/svn/autotest/trunk@700 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
8c1d3298ba556f660c7a85f4451e5cd856d63fc0 31-Aug-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Fix machinelist arg to autoserv

Autoserv failed when passed a machinelist due to some mis-scoping of
args variables.

Signed-off-by: Ryan Stutsman <stutsman@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@652 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
03dd07994874137a317bf0062daa60341084a9ee 28-Aug-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> add sh_escape support for control files.

From: Benjamin Poirier <poirier@google.com>

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@632 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
29aa97046766d6726a7e86e1db6ffa8da1438b7d 10-Aug-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Support -m options for passing list of commands to autoserv

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@613 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
b0fab826ea32155b9737dd4d06fd331236cdbed8 25-Jul-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add parallel support to new server

Signed-off-by: Ryan Stutsman <stutsman@google.com>

Adds support for parallel execution. Taken almost verbatim from old
autoserv code but with a few tweaks to access level on some functions.

Here is a tiny example of its usage in a server control file form:

import time

args = [str(i) for i in range(4)]

def f(a):
print "This is %s" % a
time.sleep(1)
print "This is %s; almost done" % a
time.sleep(1)

parallel_simple(f, args)



git-svn-id: http://test.kernel.org/svn/autotest/trunk@583 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
c8949b85f271afc332b404624f48d2bcbf9789da 23-Jul-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add autotest support in server side

From: poirier@google.com

This patch adds some functionality to autotest in autoserv. Credit goes
to Ryan for some of this.

Autotest support in autoserv:
* automatically hardreset the machine if it never comes back online
* autotest now uses get() interface
* remove autotest results directory if it is there before run (to avoid
mixing things up)

utils has unarchive code (to extract tar bz2 gz)
DEBKernel uses get() interface



git-svn-id: http://test.kernel.org/svn/autotest/trunk@570 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv
dcd57a85fc9233c4dc9f45da55338a2c09f5a37e 12-Jul-2007 mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> Add initial version of autoserv



git-svn-id: http://test.kernel.org/svn/autotest/trunk@557 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/server/autoserv