1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-05 18:45:01 +01:00
Commit Graph

27 Commits

Author SHA1 Message Date
Brent Baude
d67849a602 Use fully-qualified image name in info() and verify()
We now use the fully qualified image name (if not provided)
when dealing with atomic info and verify.  This is because
skopeo requires a fq image name to do remote inspection. As
an upside, it also makes atomic a little more user friendly
as well.

tests/integration/test_info.sh

Temporarly disabled a test due to an issue with skopeo
2016-03-21 09:05:28 -05:00
Dan Walsh
768c2fabe8 Add new test to make sure printenv passed into container correctly 2016-03-10 16:46:24 -05:00
Brent Baude
266deac814 test_verify.sh: Actually add the file
I forgot to add the actual test script in my
previous commit. Apologies.
2016-02-18 08:18:33 -06:00
Shishir Mahajan
d1a2eb287e disable test_migrate.sh for atomic migrate command
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-02-16 14:12:12 -05:00
Daniel J Walsh
c893521978 Merge pull request #288 from baude/atomic_harden_shell
atomic: harden shell invocations (1248038)
2016-01-29 14:43:57 -05:00
Brent Baude
d81e7e651e atomic: harden shell invocations (1248038)
This addresses one of the two issues raised by bugzilla
1248038 where atomic is using shell=True on its subprocess
calls which exposes a security concern.

Two new functions were added to accomplish this.  The
first is a util.chk_call which is similar to util.subp
but it uses the python function check call instead of
Popen.

The second function is atomic.sub_env_strings.  Previously,
there was env variable substitution occuring with cmd_env and
the subprocess call.  That was one upside of the shell=True
usage.  Now, prior to calling util.chk_call, we pass the
intended command to sub_env_strings and use cmd_env to
perform the variable substitution.

We will address part 2 of the security concerns, which
is the handling of LABELS as strings, in a different
PR.
2016-01-29 13:32:22 -06:00
Jonathan Lebon
8b85e0181b test_migrate.sh: validate and don't use overlayfs
This patch does two things:
    1. Add a validation step after migration to make sure that the
       containers and images were indeed migrated.
    2. Don't actually change the docker configuration to use overlayfs,
       which currently causes issues on e.g. Fedora kernels. This has
       been the source of the instability of the PR tester. It can be
       reproduced locally by running:

         # while true; do dd if=/dev/vda of=/dev/null; done &
         # make test TEST_INTEGRATION=migrate

       We can uncomment out that block once the workaround for it has
       made it to the stable kernels. See the comment block for more
       details.
2016-01-19 16:43:21 -05:00
Brent Baude
c71664ef97 Atomic/run.py: Add security implications messages based on RUN label
Laymen users who are told to run a image may not understand
the docker run switches that have security implications.  We
now look for the following switches:

* --privileged
* --cap-add
* --security-opt label:disable
* --net=host
* --pid=host
* --ipc=host

and output an appropriate security message.

Also, moved def run() from Atomic/atomic.py to Atomic/run.py
to reduce the size and the number of definitions in
Atomic/atomic.py.
2016-01-18 09:29:37 -06:00
Daniel J Walsh
0917a40cce Merge pull request #273 from baude/atomic_help
Atomic/help.py: Display man-like help for an image
2016-01-15 15:48:42 -05:00
Brent Baude
70427a5159 Atomic/help.py: Display man-like help for an image
Images or containers can now have an associated
man-like help page to help users understand more
about the image.  Typical information included
are things like a longer description, if the image
needs to be installed, security implications, steps
to upgrade, etc.

The default behavior is for atomic to display
a file called help.1 (in man format) located in
the / of the docker object.  This default
can be overriden with the HELP LABEL.  The
HELP LABEL needs to be a fully qualified
command to work correctly.
2016-01-15 10:02:58 -06:00
Shishir Mahajan
4a5f0c1280 Fix atomic migrate test
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-01-14 10:35:17 -05:00
Brent Baude
f7a38d4e44 Add tests for Atomic diff and top
Basic tests for atomic diff and top which should catch
basic code regressions.

In top.py, added -n for number of iterations.  And added
tty detection so that tests can pass in a jenkins environment
where there is no tty.
2015-12-17 11:01:37 -06:00
Jonathan Lebon
c179489d41 test_migrate.sh: cleanups
Make the cleanup() function more wary of failures. Otherwise, because we
have `set -e` turned on, on the first failure, it will jump ship and not
finish cleanup.

Also make the test use a local directory instead of
/var/lib/atomic/migrate).
2015-11-26 09:50:41 -05:00
Jonathan Lebon
43370ce877 test_display.sh: tweak for images with no INSTALL label
Now that PR #217 is merged, running `atomic install` on images without
INSTALL labels become noops. Test 5 of test_display.sh reflects this new
behaviour.
2015-11-25 11:20:32 -05:00
Dan Walsh
944df5b157 Not needed setup for test_display.sh 2015-11-16 17:23:23 -05:00
Dan Walsh
c0e04d019c test_display.sh should ignore whitespace.
This patch will get the tool to pass the tests which were
breaking because of random whitespace
2015-11-16 16:08:00 -05:00
Shishir Mahajan
5490e26820 Atomic migrate command: Fix review comments
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-11-13 10:10:12 -05:00
Shishir Mahajan
466219bc45 Atomic migrate command: Added tests
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-11-12 11:58:10 -05:00
Jonathan Lebon
6118e7373d Make test_display.sh pass again
This patch makes test_display.sh pass. They are mostly tweaks to account
for the following:
- Account for commit 7858957, which removes {CONF,LOG,DATA}DIR from the
  target environment.
- Account for commit ae931d0, which removes those default bind mounts.
- Fix a few mismatches between the labels in the Dockerfile vs the
  expected output in the test script.

And with that, all tests (should) pass!
2015-09-24 16:38:20 -04:00
Brent Baude
45864728a4 FIX test failures
Fix test failures that have crept into the atomic master.

tests/integration/test_display.sh
    Fix failure related to defined UID/GID's in the test itself.  I now
    use sed to remove the --user UID:GID to make the comparison equal
    and remove potential for dynamic failures.

    I also had to add a conditional if the labels (in python) are of
    type None to prevent a traceback.

tests/integration/test_info.sh
    There seemed to be two related failures in the test case that relate to
    running 'atomic info --remote'.  If that command is run with a docker
    daemon that is not capable of --remote, the test will failure.  I added
    a variable based on the return of that command and put it under the
    set +e section.

    I then added a conditional for that test (based on the return of above),
    to only run the test if the docker daemon is capable of the --remote
    function.
2015-08-31 14:25:28 -05:00
Sally O'Malley
b7bb5fe94a testfix pull109
Signed-off-by: Sally O'Malley <somalley@redhat.com>
2015-08-07 09:52:48 -04:00
William Temple
7e610b5dc6 Bugfix atomic mount command not detecting correct docker thin-pool prefix.
Signed-off-by: William Temple <wtemple@redhat.com>
2015-07-29 12:23:35 -04:00
Sally O'Malley
c13019c43e WIP: Add --display to run|install
Use --display to view run or install commands without
executing the commands.  This is useful when working with custom images
with LABEL methods defined.

Signed-off-by: Sally O'Malley <somalley@redhat.com>
2015-07-27 16:51:23 -04:00
William Temple
6bf94dd979 Allow arbitrary files in test images.
Signed-off-by: William Temple <wtemple@redhat.com>
2015-07-21 16:38:04 -04:00
William Temple
bb3ae02178 Integrate remote inspection with Atomic info.
Signed-off-by: William Temple <wtemple@redhat.com>
2015-07-20 16:16:12 -04:00
William Temple
534966f7cb DockerMount OverlayFS backend.
Signed-off-by: William Temple <willmtemple@gmail.com>
2015-07-10 14:54:01 -04:00
William Temple
844cc4512d New test framework.
Signed-off-by: William Temple <wtemple@redhat.com>
2015-07-10 14:09:37 -04:00