Commit graph

171 commits

Author SHA1 Message Date
baude 62b59df053 Allow the use of -i/-a on any container
We used to not allow the use of -a/-i on containers that were not
started with -i or a tty.  Given the improvements in our terminal
handling, this should work now.

This also fixes a systemic problem with the autotests.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #617
Approved by: baude
2018-04-14 13:48:35 +00:00
umohnani8 9aafc25a3d Fix secrets patch
The secrets code was just tarring and copying the contents of the secrets directory on host as is.
This meant it was not accounting for any symlinks inside the directory, leading up to the contents
not being copied over.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #611
Approved by: mheon
2018-04-13 21:25:15 +00:00
Matthew Heon 8265294d78 Fix podman run --attach tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #608
Approved by: baude
2018-04-13 18:43:44 +00:00
Matthew Heon 5eb9ebcf59 Add tests for podman attach
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #608
Approved by: baude
2018-04-13 18:43:44 +00:00
Matthew Heon b8394600d8 HACK temporary fix for test suite
We leak open files when creating new c/storage stores (locks do
not close themselves, so the open FDs in the test suite increase
every time we use c/storage to load cached images for the tests).
Fix this temporarily by increasing rlimits on open files until we
can create a permanent fix next release.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #615
Approved by: baude
2018-04-13 17:51:27 +00:00
Matthew Heon ec90d6f4cc Fix leaking files in Ginkgo
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #612
Approved by: rhatdan
2018-04-13 04:24:28 +00:00
umohnani8 998fd2ece0 Functionality changes to the following flags
--group-add
	--blkio-weight-device
	--device-read-bps
	--device-write-bps
	--device-read-iops
	--device-write-iops

--group-add now supports group names as well as the gid associated with them.
All the --device flags work now with moderate changes to the code to support both
bps and iops.
Added tests for all the flags.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #590
Approved by: mheon
2018-04-06 00:09:46 +00:00
Daniel J Walsh fdcf633a33 Add hooks support to podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #155
Approved by: mheon
2018-04-05 14:13:49 +00:00
baude 35a10c9ba5 Only allocate tty when -t
In our ezrly development, we always allocated a tty when not -d.  Now we should only allocated when the user asks for it.

Resolves: #573

Signed-off-by: baude <bbaude@redhat.com>

Closes: #574
Approved by: rhatdan
2018-04-03 22:23:23 +00:00
TomSweeneyRedHat 2eb38a0271 Sleep for 5 seconds before pushing to registry in tests
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #576
Approved by: rhatdan
2018-04-02 17:57:28 +00:00
baude 03ec980dcf Eliminate raceyness of sig-proxy test
Use a socket to coordinate between the test suite and the container and its
script.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #567
Approved by: rhatdan
2018-03-30 09:17:27 +00:00
baude 1e59053cc5 Allow sha256: prefix for input
We should allow users to pass in image ids with the sha256: prefix
for local images.

Resolves: #493

Signed-off-by: baude <bbaude@redhat.com>

Closes: #560
Approved by: baude
2018-03-29 16:31:43 +00:00
umohnani8 8a96b4acbc Add secrets patch to podman
Adds support for mounting secrets especially on RHEL where the container
can use the host subsription to run yum

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #544
Approved by: rhatdan
2018-03-29 14:15:27 +00:00
Matthew Heon 196c3ab3a5 Disable --sig-proxy tests due to race conditions
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #564
Approved by: rhatdan
2018-03-28 23:29:45 +00:00
Daniel J Walsh a3156da21c podman exec should handle options --env foo
If the user does not specify foo=bar, then the exec code should
look for the foo environment variable in its environment and pass it
in.  This is the way podman run works.

Also added tests to make sure this all works.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #552
Approved by: mheon
2018-03-26 23:27:00 +00:00
baude d364d41e1b Removing tagged images change in behavior
An image name is really just a tag.  When an image has multiple tags, we should be
able to "delete" the one of its tags without harm. In this case, the "delete' is
really a form of Untag (removing the tag from the image).

If an image has multiple tags and the user tries to delete by ID without force, this
should be denied because when you delete by ID there is no distinguishing it like
image tags.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #528
Approved by: mheon
2018-03-22 19:06:51 +00:00
baude 38a1b2f16d Image library stage 4 - create and commit
Migrate the podman create and commit subcommandis to leverage the images library.  I also had
to migrate the cmd/ portions of run and rmi.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #498
Approved by: mheon
2018-03-20 16:20:12 +00:00
Matthew Heon c80bfe1be1 Fix Travis tests for sig-proxy
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #511
Approved by: rhatdan
2018-03-16 18:03:25 +00:00
Daniel J Walsh d7acfb478e
Merge pull request #447 from mheon/sig_proxy
Add signal proxying to podman run and attach
2018-03-16 10:34:32 -04:00
Matthew Heon 2f533888a5 Fix E2E tests
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #503
Approved by: rhatdan
2018-03-16 13:55:49 +00:00
Matthew Heon 358f84ad39 Fix E2E tests
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #503
Approved by: rhatdan
2018-03-16 13:55:49 +00:00
Matthew Heon 05fb5a0aa7 Fix nit in restart E2E tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #503
Approved by: rhatdan
2018-03-16 13:55:49 +00:00
Matthew Heon 540a441234 Add tests for restart
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #503
Approved by: rhatdan
2018-03-16 13:55:49 +00:00
Yiqiao Pu eb33cc2193 Add a test case for remove the latest container
Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #508
Approved by: baude
2018-03-16 13:35:10 +00:00
Yiqiao Pu d560ddd102 Correct the test case name
Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #508
Approved by: baude
2018-03-16 13:35:10 +00:00
Matthew Heon cd73a6904d Add signal proxying to podman run, start, and attach
Also removes sig-proxy from 'podman create', where is does not
make sense.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-03-15 16:00:20 -04:00
Matthew Heon 99b959560a Fix test build
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
Matthew Heon 525d023c89 Fix gofmt
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
Matthew Heon 8d7dc94a27 Add extra E2E test for restarting containers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
Matthew Heon d176e9f781 Fix broken 'podman start' test
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
Matthew Heon 4739fc2d98 Add test. Move attach code in start back
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #482
Approved by: baude
2018-03-15 17:45:11 +00:00
baude ff091cf731 sleep does not catch SIGTERM
As Matt pointed out, when running sleep in a container, the clean up was taking a
full ten seconds to stop container because sleep does not catch SIGTERM which is
the default podman stop signal and it had to wait for SIGKILL.  Changing sleep to
top should result in better test times.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #492
Approved by: rhatdan
2018-03-14 20:38:08 +00:00
Matthew Heon 911e36dd0f Modify E2E tests to use alternate Conmon path if present
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #474
Approved by: rhatdan
2018-03-14 14:54:43 +00:00
Valentin Rothberg 62b93d1723 test/e2e/images_test.go: test with multiple tags
As podman-images(1) had some issues correctly reporting all RepoTags of
an image (in the default format), extend the e2e tests to avoid running
into similar in the future.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #477
Approved by: rhatdan
2018-03-14 14:01:53 +00:00
umohnani8 713c08630b Podman load can pull in compressed files
Podman load can now load in docker-archive files that are compressed.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #468
Approved by: baude
2018-03-08 21:23:53 +00:00
baude 6cb1c31d3f Restrict top output to container's pids only
Due to the way ps arguments work, it was possible to display pids
that dont below to the container in top output. We now filter pids
that dont belong to the container out of the output.  This also means
the pid column must be present in the output or we throw an error.

This resolves issue #391
Signed-off-by: baude <bbaude@redhat.com>

Closes: #400
Approved by: rhatdan
2018-02-26 23:41:47 +00:00
baude b351b12e27 Tagging an image alias by shortname
When trying to tag an alias (tag) of an image using only the shortname
and no tag, we were unable to find the image in storage.  This corrects
that issue and adds an integration test to protect against regression. I
also updated the man page per the filed issue.

While writing the integration test, I discovered that inspect could also
not find a tagged image without its :tag.

Resolves Issue #385
Resolves Issue #384

Signed-off-by: baude <bbaude@redhat.com>

Closes: #398
Approved by: mheon
2018-02-26 18:28:54 +00:00
baude 5e7979f016 Address review comments
Review comments to delete WithNoNew function and its append.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #369
Approved by: rhatdan
2018-02-24 09:15:47 +00:00
Daniel J Walsh 831dc48883 Add support for --no-new-privs
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #369
Approved by: rhatdan
2018-02-24 09:15:47 +00:00
baude fd79671d05 CreateContainerStorage by image id
When creating container storage by name, if that name is a tagged image then the storage
could not be found.  We now use the image id which seems more reliable. Also added an
integration test to protect against regression.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #393
Approved by: mheon
2018-02-23 17:44:28 +00:00
Jhon Honce b8d1ce03a1 Add tests and cleanup
- Added run_cgroup_parent_test.go
- Cleaned up calls to logrus

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #370
Approved by: rhatdan
2018-02-22 12:39:08 +00:00
baude f1f0f37dc1 Correct exit code 126 and 127
The exit codes for 126 and 127 were reversed.  For the record, the exit
codes used are as follows:

* 125 if ‘chroot’ itself fails
* 126 if COMMAND is found but cannot be invoked
* 127 if COMMAND cannot be found

This resolves issue #367

Signed-off-by: baude <bbaude@redhat.com>

Closes: #378
Approved by: baude
2018-02-21 16:49:00 +00:00
baude 6ce70a33c5 Inspect output should be in array form
Inspect should be able to inspect one or more containers depending
on the user input.  Therefore, inspect output should be in array
format so the consumer could potentially iterate it.  This PR allows
users to specify one more or containers|images|or a mix for
inspection.  The output, as stated, is therefore in array form.  This
holds true even for a singular image.

In the case that the user enters an invalid container|image "name", we
handle that gracefully.  Podman will output json for the valid names
until it reaches the invalid one.  For example:

In this case, podman will out the json for alpine and then print an
error about 123 being invalid.  It will not continute onto busybox.
This behavior imatates docker.

This addresses issue #360

Signed-off-by: baude <bbaude@redhat.com>

Closes: #371
Approved by: baude
2018-02-21 14:22:36 +00:00
baude 4929e37507 Performance enhancement for podman images
Previous code was using slow routines to collect some of the information
needed to output images.  Specifically size was being calculated instead
of using the cached, already known size already available.  Also, straight-
lined several of the code paths.  Overall assessment is that these
improvements cut the time for images in half.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #365
Approved by: mheon
2018-02-20 21:54:32 +00:00
baude 586bb86a2a Run podman inside a podman container
We should be able to run nested podman containers in particular
for our testing environment. i.e. eat our own dog food.

Some privileges had to be corrected in order for this to work
correctly.

Added a third papr target that runs podman tests inside podman.  I
marked the test as not required right now as we get more confident
in the results

Signed-off-by: baude <bbaude@redhat.com>

Closes: #340
Approved by: rhatdan
2018-02-16 18:35:54 +00:00
baude 409ed259c6 Return imageid from podman pull
When using podman to pull an image, print the image id after
the image is pulled.

Resolves issue #329

Signed-off-by: baude <bbaude@redhat.com>

Closes: #342
Approved by: rhatdan
2018-02-15 17:18:08 +00:00
baude e814936915 No entrpoint, cmd, or command
When an image does not have an ENTRYPOINT nor a CMD and the
user does not provide a command in the CLI, we should fail
gracefully.

This resolves issue #328

Signed-off-by: baude <bbaude@redhat.com>

Closes: #333
Approved by: mheon
2018-02-15 00:48:13 +00:00
baude be9ed1cfac Privileged containers should inherit host devices
When running a privileged container, it should inherit the same
devices the host has.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #330
Approved by: mheon
2018-02-15 00:20:47 +00:00
Daniel J Walsh 2e96acf300 Change json to match docker inspect
Changing these fields caused the output of podman inspect to more
closely match docker inspect.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #306
Approved by: mheon
2018-02-11 11:50:34 +00:00
baude d26266659d Honor ENTRYPOINT in image
When an image has an ENTRYPOINT defined, we should be honoring it. The
problem is described in issue #321.

Also, added buildah binary to test runtimes for testing entrypoint and
will also allow us to test podman build as well.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #322
Approved by: rhatdan
2018-02-11 10:21:46 +00:00
baude a8092a105b Rework port code
Rework port code for generalized clean up and to address
issue #269 where additional portbindings between host
and containers we being introduced by error.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #308
Approved by: mheon
2018-02-09 16:13:20 +00:00
baude fa9658cbfa podman logs: fix tailing
Fix issues with tailing of container logs as described
in issue #16.  Also add in the ability to use a duration or
known time stamp formats for the --since flag.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #317
Approved by: mheon
2018-02-09 15:27:52 +00:00
TomSweeneyRedHat bf981fc873 Update pause tests per QE suggestions and move to gingko
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #285
Approved by: mheon
2018-02-08 22:14:36 +00:00
baude c089cb9c92 Final ginkgo migration
Completion of the migration from bats to ginkgo.  This includes:

* load
* mount
* pause
* port
* run_networking
* search

Note: build will be done within a different PR

Signed-off-by: baude <bbaude@redhat.com>
2018-02-08 12:37:07 -06:00
Daniel J Walsh dd9ecc7a23
Merge pull request #290 from umohnani8/templates
Fix when the --format flag prints a new line at the end
2018-02-07 16:50:23 -05:00
Daniel J Walsh c40888cf9f
Merge pull request #300 from baude/ginkgo_version
More ginkgo migration
2018-02-07 16:49:56 -05:00
baude d26023e4a8 More ginkgo migration
* attach
* run_exit
* save
* tag
* version
* run_privileged -> privileged

Signed-off-by: baude <bbaude@redhat.com>
2018-02-07 14:55:20 -06:00
umohnani8 363cfcb0ce Fix when the --format flag prints a new line at the end
If the output is to a terminal, return a new line at the end of the
output so that the output is visually appealing. If the output is being
piped, or saved to a file, basically not being outputted to a terminal, do
not print a new line at the end of the output. This ensures any further data
manipulation with the results happens smoothly without requiring to remember
the '/n' at the end of the output.

Signed-off-by: umohnani8 <umohnani@redhat.com>
2018-02-07 10:43:16 -05:00
umohnani8 367213a394 Match podman inspect output to docker inspect
Made a change to make sure that the output paths of podman inspect
matches that of docker inspect. For example to get the stop signal
you should be able to do podman inspect ctr --format {{.Config.StopSignal}}
and the same thing in docker will give the same results.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #292
Approved by: rhatdan
2018-02-06 19:31:55 +00:00
baude 1c4bcf3bc7 Migrate more tests to ginkgo
Migrate the following to the ginkgo integration tests:

* images
* import
* inspect
* logs
* run_dns

Signed-off-by: baude <bbaude@redhat.com>

Closes: #295
Approved by: mheon
2018-02-06 15:55:50 +00:00
baude bf00c976dd sysfs should be mounted rw for privileged
sysfs should be mounted rw for a privileged container.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #279
Approved by: rhatdan
2018-02-06 01:17:54 +00:00
baude 3609b82fe6 Migrate diff, exec, export, and history to ginkgo
Migrate the diff, exec, export, and history bats tests to
the ginkgo test suite.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #287
Approved by: baude
2018-02-05 20:17:37 +00:00
baude 910baf433f Deprecate --format for podman top
Issue #169 describes a common failure when running podman top where
if the commands inside the container container a space in them, podman
will panic.  This was occuring because we take the output from ps and
attempt to format it nicely for output and things like JSON.  Given that
this cannot be predicted or dealt with programatically, the decision was
made to deprecate the format switch and simply output what ps provides
us.

Migrated top integration tests to ginkgo.

Resolves Issue: https://github.com/projectatomic/libpod/issues/169

Signed-off-by: baude <bbaude@redhat.com>

Closes: #291
Approved by: rhatdan
2018-02-05 15:41:06 +00:00
Daniel J Walsh 989f5e3062 Pass NOTIFY_SOCKET and LISTEN_FDS env to OCI RUntime if set
In order to have sd_notify from systemd to work in containers
we need to pass down the NOTIFY_SOCKET environment variable to
the container.

LISTEN_FDS, tells the application inside of the container to use
socket activation and grab the FDS that are leaked into the container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #271
Approved by: umohnani8
2018-02-05 15:39:40 +00:00
Daniel J Walsh 095aaaa639 Allow users to specify logpath
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #135
Approved by: mheon
2018-02-03 19:49:14 +00:00
baude 6ba6ecf59b Migrate Create|Commit to ginkgo
Migrate create and commit bats tests to the ginkgo
test suite.  In doing so, some structures had to be
moved to pkg/podmanstructs/podmanstructs.go so we
could do better verification of test results.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #286
Approved by: rhatdan
2018-02-02 22:44:40 +00:00
baude 0387f69d39 Migrate kill tests to ginkgo
Migrate kill tests to the ginkgo suite and remove the
podman_kill bats.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #281
Approved by: baude
2018-02-01 19:04:00 +00:00
baude 2dfd048545 Implment network == none
When network == none, the container should only have a
loopback interface and that's it.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #176
Approved by: baude
2018-01-31 21:47:07 +00:00
baude 3c044f9267 Ginkgo Tests: ps, pull, push and rm
Migrate ps, pull, push, and rm from bats to ginkgo.

Also, fixed a conditional issue with adding ports
when an image defines the port and the user wants
to override it.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #277
Approved by: baude
2018-01-31 20:23:31 +00:00
baude 4cb33035ce Migrate start, stats, stop to Ginkgo
Migrate the start, stats, and stop integration tests to the
Ginkgo style.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #274
Approved by: mheon
2018-01-30 10:40:00 +00:00
baude dd133a1ad2 Initial gingko work
This implements the ginkgo integration test framework for
podman.  As tests are migrated from bats to ginkgo, we will
still run both integration suites.  When a test is migrated,
we remove the tests from bats at that time.  All new tests
should be just for the ginkgo framework.

One exception is that we only run the ginkgo suit in the
travis/ubuntu environment.  The CentOS and Fedora PAPR nodes
will more than cover those.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #261
Approved by: baude
2018-01-29 19:12:20 +00:00