History log of /external/autotest/site_utils/lxc/lxc_functional_test.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f960853ef610ce11111f40bb06eab03da3f59155 20-Dec-2017 Ben Kwa <kenobi@google.com> [autotest] Fix container_bucket_unittest.py

Don't use a hard-coded static container ID for testing - it makes the
test non-hermetic.

BUG=chromium:796686
TEST=container_bucket_unittest.py
TEST=service_unittest.py
TEST=container_unittest.py
TEST=lxc_functional_test.py

Change-Id: I45ae6378d990c561a80dff941908053210eaa6ab
/external/autotest/site_utils/lxc/lxc_functional_test.py
c2846d5cc1630da2fdf2bde8965b043b395fddb5 17-Nov-2017 Ben Kwa <kenobi@google.com> [autotest] Make lxc_functional_test.py runnable.

It never had a shebang line, so it always needed to be run as 'python
lxc_functional_test.py'. Add a shebang line for convenience.

BUG=chromium:786179
TEST=lxc_functional_test.py

Change-Id: If30dd6a25a373562778a8d73a6eb5c4130492ee0
Reviewed-on: https://chromium-review.googlesource.com/775883
Reviewed-by: Dan Shi <dshi@google.com>
Tested-by: Ben Kwa <kenobi@chromium.org>
/external/autotest/site_utils/lxc/lxc_functional_test.py
b0f14169490c1d63d9246d8d7f6ad100be7a1551 05-Sep-2017 Ben Kwa <kenobi@google.com> [autotest] Fix host-dir permissions.

Change the permissions on the shared host dir and the individual host
dirs so they aren't owned by root, and are writable by regular
processes (e.g. the autoserv process). This is necessary in order to
enable autoserv to configure the zygotes.

- Set mode 777 on the shared host dir.
- Don't use sudo to create host dirs and install SSPs.
- Don't use sudo (where possible) in unittest code.
- Put a new check in unittests to ensure they're not run as root.
Running unit tests as root will obscure some of these permissions
issues.
- Factor unittest setup code so it's all in one place.

BUG=chromium:762112
TEST=base_image_unittest.py -v
TEST=container_bucket_unittest.py -v
TEST=container_unittest.py -v
TEST=lxc_config_unittest.py -v
TEST=lxc_functional_test.py -v
TEST=shared_host_dir_unittest.py -v
TEST=zygote_unittest.py -v

Change-Id: Idfde131edca57ab563e0bb1923103196728045ec
Reviewed-on: https://chromium-review.googlesource.com/651086
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/lxc/lxc_functional_test.py
6b1bf747a68d91ac6a3835c3a71d8b779ce4c1f0 30-Aug-2017 Ben Kwa <kenobi@google.com> [autotest] Fix container cloning on moblab.

The code for properly setting snapshot settings was in the
ContainerBucket, so container cloning only worked properly everywhere if
it was invoked via the ContainerBucket.create_from_base function. In
particular, this causes unit tests to fail on moblab.

Fix the code so that Container.clone works everywhere.

Also, disable some newly-added tests that are guaranteed to fail on
moblab.

BUG=chromium:760735
TEST=sudo python base_image_unittest.py
TEST=sudo python container_unittest.py
TEST=sudo python lxc_functional_test.py

Change-Id: I75e3ffa9a3d6ccf3cf2ad1b720a81d4bf814ec89
Reviewed-on: https://chromium-review.googlesource.com/644322
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Ben Kwa <kenobi@chromium.org>
/external/autotest/site_utils/lxc/lxc_functional_test.py
bedacad91dfda8c59f3c8b319aa7adc2a4d4c3e6 28-Aug-2017 Ben Kwa <kenobi@google.com> [autotest] Add Container IDs.

Containers have identifying information that links them to their test
job. This information is currently encoded in the container name. With
the move to zygotes, this scheme no longer works because the identifying
information is not yet available when the zygotes are created, and
running containers cannot be renamed or moved.

Introduce a new ContainerId class that is persistable and enables this
information to be set and stored with the container after it has been
started.

BUG=chromium:720219
TEST=sudo python container_unittest.py
TEST=sudo python container_bucket_unittest.py
TEST=sudo python lxc_functional_test.py

Change-Id: I0a1b427f5fe33f44acc7b37679155b7e879e93cc
Reviewed-on: https://chromium-review.googlesource.com/639730
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/lxc/lxc_functional_test.py
88f31851bc46657abae2e12dcb8db339dba3579a 25-Aug-2017 Ben Kwa <kenobi@google.com> [autotest] Refactor ContainerBucket (host-dir).

Remove shared host directory management from ContainerBucket. This
simplifies the ContainerBucket, and allows for proper separation of
concerns (shared host dir has nothing to do with managing test
containers).

Said management code is moved into a separate class with its own unit
tests.

Container and Zygote unit tests now no longer require a full-fledged
ContainerBucket to function, and have been pared down accordingly.

The FastContainerBucket used for unit tests is no longer needed, and is
removed.

BUG=chromium:720219

TEST=sudo python base_image_unittest.py
TEST=sudo python container_bucket_unittest.py
TEST=sudo python container_unittest.py
TEST=sudo python host_path_manager_unittest.py
TEST=sudo python lxc_config_unittest.py
TEST=sudo python lxc_functional_test.py
TEST=sudo python zygote_unittest.py

Change-Id: Ibdc14795e3e59ef73ccf884c068c5a8e813d5f94
Reviewed-on: https://chromium-review.googlesource.com/636034
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Ben Kwa <kenobi@chromium.org>
/external/autotest/site_utils/lxc/lxc_functional_test.py
d48cbcbccb81962ce39819e372acd4af852fc7da 25-Aug-2017 Ben Kwa <kenobi@google.com> [autotest] Refactor ContainerBucket.

Remove base container management code from ContainerBucket. This change:

- simplifies the ContainerBucket,

- makes it clearer that the base image setup is something that is
performed separately from normal ContainerBucket operation,

- starts the process of decoupling container creation from the
ContainerBucket, which will be necesary to move to a container pool.

BUG=chromium:720219

TEST=sudo python base_image_unittest.py
TEST=sudo python container_bucket_unittest.py
TEST=sudo python container_unittest.py
TEST=sudo python lxc_config_unittest.py
TEST=sudo python lxc_functional_test.py
TEST=sudo python zygote_unittest.py

Change-Id: I719f7b113729c7387ddacaec77c4c63154d52ea0
Reviewed-on: https://chromium-review.googlesource.com/636033
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Ben Kwa <kenobi@chromium.org>
/external/autotest/site_utils/lxc/lxc_functional_test.py
9758b092631ced3a292930e3577c501da39a2c4c 21-Aug-2017 Ben Kwa <kenobi@google.com> [autotest] Improve host dir cleanup.

If the shared host dir already exists when ContainerBucket.setup_base is
called, don't always attempt to clean it up - only do so if the
force_cleanup flag was set, or if the existing directory isn't correctly
set up (e.g. if it's not a shared bind-mount).

This makes running unit tests easier, and also makes it so that the
soon-to-be-implemented container pool service doesn't have to deal with
extraneous exceptions.

BUG=chromium:720219
TEST=sudo python lxc_functional_test.py -v
TEST=sudo python container_bucket_unittest.py -v
TEST=sudo python container_unittest.py -v
TEST=sudo python zygote_unittest.py -v

Change-Id: I926a8e6f36c443b6679edbab622c2bb16c8da14d
Reviewed-on: https://chromium-review.googlesource.com/624699
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Ben Kwa <kenobi@chromium.org>
/external/autotest/site_utils/lxc/lxc_functional_test.py
c0ce5456d710eb5f9410e183fe768c216509e4b1 11-Jul-2017 Ben Kwa <kenobi@google.com> autotest: reland recent lxc changes

This reverts commit 1b617599f43e88a40eabbd2570e90649c0ede990, which effectively
relands the following commits:

d8542a8d5 Address container differences on moblab vs shard.
d3498cc07 Create Zygote, a configurable container.
966db080d Create a new module for lxc code.

i.e.
https://chromium-review.googlesource.com/c/558015/
https://chromium-review.googlesource.com/c/557061/
https://chromium-review.googlesource.com/c/538127/

It also fixes the problem introduced by those CLs, and adds new unittests (see
new container_unittest.py) for those conditions.

BUG=chromium:741139, chromium:738598, chromium:720219
TEST=sudo python site_utils/lxc/container_unittest.py -v
TEST=sudo python site_utils/lxc/lxc_functional_test.py -v
TEST=sudo python site_utils/lxc/zygote_unittest.py -v
TEST=sudo python site_utils/lxc/container_bucket_unittest.py -v

Change-Id: I6c1c23426a4baf4e12135c4ef8b25fdefabbf46b
Reviewed-on: https://chromium-review.googlesource.com/566741
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/lxc/lxc_functional_test.py
1b617599f43e88a40eabbd2570e90649c0ede990 12-Jul-2017 Aviv Keshet <akeshet@chromium.org> autotest: revert recent lxc changes

This CL reverts d8542a8d5620deb087af921d08a03e70baa446e7 and
966db080d632ab2b7c6534e717762173dad3938b.

which correspond to
https://chromium-review.googlesource.com/c/558015/ and
https://chromium-review.googlesource.com/c/538127/

BUG=chromium:741139, chromium:738598, chromium:720219
TEST=None

Change-Id: I478804455eca0775b04ede5152d8345408ee9468
Reviewed-on: https://chromium-review.googlesource.com/567057
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/lxc/lxc_functional_test.py
d3498cc07201dd7c8ee215ab3825a9d8e7f8d339 29-Jun-2017 Ben Kwa <kenobi@google.com> Create Zygote, a configurable container.

Create a new subclass of Container called Zygote. Zygote adds support
for a host directory, which is a shared bind-mount that enables the host
system to bind/copy additional files/directories into a Container after
it has been started.

BUG=chromium:720219

TEST=sudo python lxc_functional_test.py -v
2017-06-29 15:07:03,348 All tests passed.

TEST=sudo python zygote_unittest.py -v
Ran 8 tests in 153.343s
OK (skipped=1)

Change-Id: I5fbcd31edd1e6fc34b6531640cbf58a2f34b9c18
Reviewed-on: https://chromium-review.googlesource.com/557061
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
/external/autotest/site_utils/lxc/lxc_functional_test.py
966db080d632ab2b7c6534e717762173dad3938b 05-Jun-2017 Ben Kwa <kenobi@google.com> Create a new module for lxc code.

Create a new python module for lxc code. Move lxc.py and related code into that
module. Script-style functionality in site_utils/lxc.py and lxc_cleanup.py was
left as-is.

BUG=chromium:720219
TEST=sudo python site_utils/lxc_functional_test.py -v
2017-06-15 15:29:52,700 All tests passed.
TEST=Install autotest-server code onto moblab, run a test.
Test runs successfully.

Change-Id: I7b8400db64594f4d1268a62838ac379e713738c1
Reviewed-on: https://chromium-review.googlesource.com/538127
Commit-Ready: Ben Kwa <kenobi@chromium.org>
Tested-by: Ben Kwa <kenobi@chromium.org>
Reviewed-by: Ben Kwa <kenobi@chromium.org>
/external/autotest/site_utils/lxc/lxc_functional_test.py