History log of /external/autotest/site_utils/lxc_functional_test.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d9094d46b18e76d0951c8f1883b3553525c4ac9e 10-Jul-2015 Dan Shi <dshi@chromium.org> [autotest] Add a function to install multiple packages

Each package install needs to run apt-get update, which takes extra time to run.
The new function takes in a list of packages and python packages, so `apt-get
update` only needs to run once.

BUG=chromium:508314
TEST=sudo python site_utils/lxc_functional_test.py -v

Change-Id: Ibfcfa24696f6e217820679f5405da67529ef2c45
Reviewed-on: https://chromium-review.googlesource.com/284597
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/site_utils/lxc_functional_test.py
585b7b68efb37226bc2b6cf25e90ea88c208e3c1 01-Jun-2015 Dan Shi <dshi@chromium.org> [autotest] swap python import order to support pip in moblab

In Moblab, the host's python modules located in
/usr/lib64/python2.7/site-packages is mounted to following folder inside
container: /usr/local/lib/python2.7/dist-packages/. The modules include
an old version of requests module, which is used in autotest
site-packages. For test, the module is only used in
dev_server/symbolicate_dump for requests.call and requests.codes.OK.
When pip is installed inside the container, it installs requests module
with version of 2.2.1 in /usr/lib/python2.7/dist-packages/. The version
is newer than the one used in autotest site-packages, but not the latest
either.
According to /usr/lib/python2.7/site.py, modules in /usr/local/lib are
imported before the ones in /usr/lib. That leads to pip to use the older
version of requests (0.11.2), and it will fail. On the other hand,
requests module 2.2.1 can't be installed in CrOS (refer to CL:265759),
and higher version of requests module can't work with pip.
The only fix to resolve this is to switch the import order, so modules
in /usr/lib can be imported before /usr/local/lib.

BUG=chromium:483371
TEST=local moblab run
sudo python site_utils/lxc_functional_test.py -v

Change-Id: I59ab724ac6bd974da648209248b9f6df3380ae0f
Reviewed-on: https://chromium-review.googlesource.com/274411
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
/external/autotest/site_utils/lxc_functional_test.py
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/site_utils/lxc_functional_test.py
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/site_utils/lxc_functional_test.py
507fdc40ef300535886bc1ef71d18c1fa697b895 30-Apr-2015 Dan Shi <dshi@chromium.org> [autotest] Add two helper functions to install packages.

Server-side test should call these two functions to install required packages.
Ideally, tests will not need to deploy packages to site-packages for test to
run.

BUG=chromium:453614
TEST=site_utils/lxc_functional_test.py

Change-Id: I9ade9e1a804897a32cebac36836367feda13a24b
Reviewed-on: https://chromium-review.googlesource.com/268437
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/site_utils/lxc_functional_test.py
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/site_utils/lxc_functional_test.py
767dced065c8918b5ff74c1347371a0f0f8d9c69 01-Feb-2015 Dan Shi <dshi@chromium.org> [autotest] Add a utility module to interact with LXC binaries.

Add a module (lxc.py) to interact with LXC binaries.

lxc_functional_test.py is a test script to test the module. It will
1. Set up base container in a tmp directory.
2. Create a test container from the base container.
3. Test site-packages and results directory can be mounted and shared between
host and test container.
4. Run autoserv in test mode.

Also add a utility function in client/common_lib/site_utils.py to get the value
of the given argument for the function. It's used in decorator to check function
parameters.

BUG=chromium:453621
CQ-DEPEND=CL:251140

TEST=unittest,
sudo python site_utils/lxc_functional_test.py
sudo python site_utils/lxc.py -s -p /tmp/container_123
sudo python site_utils/lxc.py -s -p /tmp/container_123 -f
sudo python site_utils/lxc.py -p /tmp/container_123 -f

Change-Id: Id7b259c4bc03977974af44d6d88420b220706589
Reviewed-on: https://chromium-review.googlesource.com/247271
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/site_utils/lxc_functional_test.py