Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: oneliner to run make check in a container #3228

merged 14 commits into from Dec 21, 2014


Copy link

commented Dec 20, 2014

test/ will

  • create an ubuntu:14.04 docker container
  • clone the current ceph repository or git reset --hard an existing one
  • in the container, using the clone

The uses cases are:

  • a developer who wants to run make check and keep working while it does
  • a CI that needs to isolate from side the side effects of a failed make check run

The test/ script does the same and can run in parallel.

@ghost ghost added cleanup core feature and removed cleanup labels Dec 20, 2014

@ghost ghost changed the title tests: docker images must use tests: oneliner to run make check in a container Dec 21, 2014

@ghost ghost assigned liewegas Dec 21, 2014


This comment has been minimized.

Copy link

commented Dec 21, 2014

@liewegas this series will make the bot immune to make check leftovers. It stands to reason that a failed make check leaves an arbitrary number of stale process / directories behind.

ldachary added 14 commits Dec 20, 2014
tests: docker images must use
The dockerfiles must run instead of duplicating the
package list that is found in and debian/control.

A directory is created for each os_type and provided as a context for
docker build to use. The former $os_type.dockerfile is moved into
$os_type/ (the .in as a reminder that it will be variable
substituted). Fixes: #10401

Signed-off-by: Loic Dachary <> do not require sudo when root
If the user is root, do not use sudo. The sudo package is not installed
by default on centos by default and when building from script it may be
that root is running on a freshly install distribution.

Signed-off-by: Loic Dachary <>
tests: install jq
jq is useful to parse json from the command line. It is however not
packaged for all supported distributions (precise has it in the backport
repository which is usually not active) and cannot be conveniently added
to debian/control because it targets all distributions and has no

Signed-off-by: Loic Dachary <>
tests: or debian/control rebuild docker images
If any of the files in test/$os_type is newer than the creation date of
a docker image, the image is removed and rebuilt from scratch. For
instance, when a package is added to debian/control, the debian based
images are rebuilt.

Signed-off-by: Loic Dachary <>
tests: enable password-less sudo in containers
If compilation is run with ./configuire --enable-root-make-check, sudo
is expected to work without human interaction.

Signed-off-by: Loic Dachary <>
tests: deprecate --compile option
It is redundant with the script and imposes additional

Signed-off-by: Loic Dachary <>
tests: commands are relative to git root
Instead of being in the src directory. Forcing the working directory to
src is convenient to run unittests individually without the need to
change directory, but it is confusing to the user.

Signed-off-by: Loic Dachary <>
tests: replace --enable-docker with --enable-root-make-check
The --enable-docker logic was that each test that needs privileges to
run uses a container to do so. The problem with this approach and
make -j8 check is that such tests compete for a single container.

The --enable-root-make-check activates tests that require privileges and
assume it is ok to use sudo to acquire privileges. The decision to run
in a container is then taken by the caller who will run something like: ./configure --enable-root-make-check make -j8 check

Signed-off-by: Loic Dachary <>
tests: arguments are passed to configure
All arguments are transparently given to the configure
command. For instance: --enable-root-make-check


    ./configure --enable-root-make-check

Signed-off-by: Loic Dachary <>
tests: helpers to run make check in containers
Add scripts that run make check in a container for a given operating
system version. They are a little more than oneliners and serve two

  * help new developers who do not have to figure out which options
    should be used

  * run make check in containers in parallel with make -j2

Signed-off-by: Loic Dachary <>
tests: add xmlstarlet in containers
It can be removed once #3228 is merged
and xmlstarlet is found in and debian/control.

Signed-off-by: Loic Dachary <>
tests: avoid bash == --shell confusion in
Do not force interactive mode when the bash script is specified by the
user because it should be usable to run a small script instead of
starting an interactive shell session.

Signed-off-by: Loic Dachary <>
tests: add --ref giant|firefly etc.
Add the --ref option to chose the git ref to which the working tree must
be reset instead of HEAD.

   test/ --ref giant make

is equivalent to

   test/ bash -c 'git reset --hard giant ; make'

Signed-off-by: Loic Dachary <>
tests: reduce centos docker intermediate steps
Collapse multiple RUN statements related to systemd into a single line
to reduce the number of steps that are preserved by docker.

Signed-off-by: Loic Dachary <>

This comment has been minimized.

Copy link

commented Dec 21, 2014

SUCCESS: the output of on 05d3f5b is

:octocat: Sent from GH.

liewegas added a commit that referenced this pull request Dec 21, 2014
Merge pull request #3228 from dachary/wip-10401-docker-install-deps
tests: oneliner to run make check in a container

Reviewed-by: Sage Weil <>

@liewegas liewegas merged commit 3e6195b into ceph:master Dec 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.