Commit graph

171 commits

Author SHA1 Message Date
Daniel J Walsh 7fc1a329bd Add podman container cleanup to CLI
When we run containers in detach mode, nothing cleans up the network stack or
the mount points.  This patch will tell conmon to execute the cleanup code when
the container exits.

It can also be called to attempt to cleanup previously running containers.

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

Closes: #942
Approved by: mheon
2018-06-29 15:25:21 +00:00
TomSweeneyRedHat 41bd607c12 Allow multiple containers and all for umount
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #1012
Approved by: rhatdan
2018-06-29 15:01:21 +00:00
umohnani8 3b9046a170 Remove the --registry flag from podman search
Instead of setting the --registry flag to search a single registry,
prefix the registry before the image name in the input, an example is
`podman search registry.fedoraproject.org/fedora` and this will search for
the fedora image in only registry.fedoraproject.org.

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

Closes: #1011
Approved by: rhatdan
2018-06-28 16:55:29 +00:00
Giuseppe Scrivano ea06dccba2 test: add env variables to the debug output
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #936
Approved by: rhatdan
2018-06-27 14:07:17 +00:00
Matthew Heon 55dd266ec1 Add tests for podman refresh
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
Daniel J Walsh 2c81a756e3 Update the version of conmon used in test
Also start using podmin in /usr/libexec/podman rather then crio.

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

Closes: #979
Approved by: baude
2018-06-22 13:19:08 +00:00
haircommander 4ab054073d Added --sort to ps
Also podman ps now allows user to only output size of root FS, changed language of images and ps --sort to be by "created" as opposed to "time", and refactored the way templates are created (converted from psJSONParams type).

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #948
Approved by: rhatdan
2018-06-19 14:45:29 +00:00
haircommander d8f2cb8622 TLS verify is skipped per registry.
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #952
Approved by: rhatdan
2018-06-18 18:46:55 +00:00
umohnani8 db094f6e15 Add --all,-a flag to podman images
podman images will not show intermediate images by default.
To view all images, including intermediate images created during
a build, use the --all flag.

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

Closes: #947
Approved by: rhatdan
2018-06-18 14:41:51 +00:00
Valentin Rothberg b1e709806d top: make output tabular
Make the output of top tabular to be compatible with Docker.  Please
note, that any user-input for `GetContainerPidInformation(...)` will be
ignored until we have found a way to generically and reliably parse ps-1
output or until there is a go-lib to extract all the data from /proc in
a ps-1 compatible fashion.

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

Closes: #939
Approved by: rhatdan
2018-06-18 12:56:44 +00:00
haircommander b43677c9fd Added --tls-verify functionality to podman search, with tests
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #932
Approved by: baude
2018-06-15 17:09:33 +00:00
Giuseppe Scrivano 33eb31e031 test: add test for running a rootless container
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #871
Approved by: mheon
2018-06-15 14:53:19 +00:00
Matthew Heon c1ef1151ac Temporarily turn of ps --last test until fixed
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #944
Approved by: rhatdan
2018-06-14 19:03:52 +00:00
haircommander b868470238 Added --sort flag to podman image
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #937
Approved by: rhatdan
2018-06-14 10:26:21 +00:00
Daniel J Walsh 1cbce851fa Test to make sure we are getting proper exit codes on podman run
podman run command screws up we should get 125
podman run command succeeds but command in container fails to exec 126
podman run command succeeds but command exits with non 0 exit code

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

Closes: #921
Approved by: TomSweeneyRedHat
2018-06-07 21:32:39 +00:00
haircommander d7f9781bd6 Propegate exit code on Exec calls and integrated test
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #904
Approved by: rhatdan
2018-06-07 18:20:19 +00:00
Yiqiao Pu 28d1cec9f6 Add some test for podman run flag security-opt
Add following test cases for security-opt:
  - Check default selinux value
  - Disable security options in container
  - Setup selinux type in security-opt
  - Disable seccomp protection
  - Configure custom seccomp.json

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #837
Approved by: rhatdan
2018-06-04 18:14:33 +00:00
Yiqiao Pu c69f80c86c Add a function for e2e test to write json file
This function is used to write json format configure files.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #837
Approved by: rhatdan
2018-06-04 18:14:33 +00:00
Yiqiao Pu 37751ea5b5 Use go-selinux for selinux check
Use function in opencontainers/selinux/go-selinux to check the
selinux status in our test.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #837
Approved by: rhatdan
2018-06-04 18:14:33 +00:00
Matthew Heon 6d52ebdd13 Add flag to add annotations to a container
Also add annotations from the image the container was created
from.

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

Closes: #886
Approved by: rhatdan
2018-06-04 17:52:28 +00:00
Daniel J Walsh bae80a0b66 Clear all caps, except the bounding set, when --user is specified.
Currently we are giving all caps to users when running with podman run --user,
They should get none by default.  If the command line includes --cap-add, then
we need to run with those capabilties.  Similarly we need to drop caps from
bounding set, if user specifies --cap-drop

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

Closes: #851
Approved by: mheon
2018-05-31 13:46:08 +00:00
umohnani8 c8b72e57a7 save and load should support multi-tag for docker-archive
The docker-archive tar files can have multiple tags for the same
image stored in it. Load pulls all the tags found in the archive
when loading a tar file. Save can oush multiple tags of the same
image to a tar archive.

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

Closes: #819
Approved by: rhatdan
2018-05-25 15:15:47 +00:00
Jhon Honce 684b544e9c Spell check strings and comments
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #831
Approved by: rhatdan
2018-05-25 08:45:15 +00:00
Nalin Dahyabhai e686269da3 chrootuser: default to GID 0 when given a numeric --user
When we're given a numeric --user value, default to GID 0 if the numeric
ID doesn't correspond to a user entry in /etc/passwd that can provide us
with the user's primary group ID.

Make sure that GetAdditionalGroupsForUser() returns wrapped errors.

Also test various user:group forms.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #728
Approved by: mheon
2018-05-17 17:05:44 +00:00
umohnani8 7dced311d1 Allow push/save without image reference
If the user uses the image ID when saving to either docker-archive
or oci-archive, then do not save a reference in the manifest/index.json.
If the user chooses to push without an image reference, i.e <transport>:<path>
it should be valid and succeed.

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

Closes: #782
Approved by: rhatdan
2018-05-16 18:06:52 +00:00
Matthew Heon fee9ec1858 Skip systemd-style CGroups test
Until we get Systemd cgroup manager working, this will
cause a validation error.

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

Closes: #507
Approved by: baude
2018-05-11 14:43:57 +00:00
Giuseppe Scrivano 769f8f2d72 test/e2e/run_userns_test.go: new file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #690
Approved by: mheon
2018-05-04 17:15:55 +00:00
baude 970eaf0033 podman should assign a host port to -p when omitted
If the user does not provide a host port when adding -p to create/run, podman should inject an available random port.

podman run -p 80 .... podman should assign a random port to the host and expose the container port 80 to it

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

Closes: #703
Approved by: rhatdan
2018-05-01 21:47:34 +00:00
baude 9924956dc8 do not commit default volumes from container
when performing a container commit, we should not add the default list of volumes
for a container to the resulting image.  it will cause the resulting image to crash
when run subsequently.

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

Closes: #699
Approved by: mheon
2018-04-30 21:07:59 +00:00
umohnani8 d5d6e68592 Make ':' a restricted character for file names
file names for podman load, save, export, and import cannot
contain ":" in them. It is a reserved character for parsing
filenames.

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

Closes: #694
Approved by: rhatdan
2018-04-30 19:58:22 +00:00
baude a824186ac9 Use buildah commit and bud in podman
Vendor in buildah and use as much of commit and bug as possible for podman
build and commit.

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

Closes: #681
Approved by: mheon
2018-04-27 20:51:07 +00:00
umohnani8 6ac8a24db4 Add --default-mounts-file hidden flag
The hidden flag is used to override the path of the default mounts file
for testing purposes.
Also modified the secrets pkg to allow for this override to happen.

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

Closes: #678
Approved by: mheon
2018-04-26 16:33:25 +00:00
umohnani8 cf41dc70b3 Modify --user flag for podman create and run
If an integer is passed into the --user flag, i.e --user=1234
don't look up the user in /etc/passwd, just assign the integer as the uid.

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

Closes: #652
Approved by: mheon
2018-04-24 14:28:33 +00:00
Yiqiao Pu e76caee338 Add some podman search test with filter
Add search test with filter stars, is-automated and is-official.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #662
Approved by: rhatdan
2018-04-24 13:42:37 +00:00
Yiqiao Pu 863196f303 Fix podman search no-trunc test
Add --no-trunc to the command line and add output check for the
lines not include "..." with this flag.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #662
Approved by: rhatdan
2018-04-24 13:42:37 +00:00
Daniel J Walsh 10f9dc0d88
Merge pull request #647 from umohnani8/secrets
Add FIPS mode secret
2018-04-23 20:25:31 -04:00
umohnani8 57afb7514d Add FIPS mode secret
If the host is in FIPS mode and /etc/system-fips exists
/run/secrets/system-fips is created in the container so that
the container can run in FIPS mode as well.

Signed-off-by: umohnani8 <umohnani@redhat.com>
2018-04-23 13:17:12 -04:00
Yiqiao Pu 04b58bc80c Add restart test with timeout
Test the --timeout flag with a container which can not be stopped with
SIGSTOP. This means the container should can not be stopped and will be
killed then restart with timeout value. Test steps:
  Start a container with STOPSIGNAL=SIGKILL
  Restart it with --timeout set to 2s
  Check the restart command will finished more than 2s and less than
  10s(the default timeout)

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-23 17:34:26 +08:00
Yiqiao Pu 18c98375a0 Improve restart latest container test
Remove the --latest from the restart running container test, and
add a separated case with following steps:
  start two container in order: test1, test2
  restart container with --latest
  check the start time for test1 and test2

And the results should be test1 is not restarted and test2 is restarted.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-23 17:34:21 +08:00
Yiqiao Pu 3a220be5bb Add start time check for restart test
Check the start time changed after restart the container.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-23 17:14:22 +08:00
baude 69669cf394 enable no test cache
been meaning to do this for a while.  add an environment variable that
disables the caching and restoring of images before integration tests
are run.  this is useful for developers only ... when testing specific
integration tests where caching and restoring the images is not worth
the benefit.

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

Closes: #650
Approved by: rhatdan
2018-04-21 10:54:18 +00:00
Matthew Heon 228732decc Fix tests for podman run --attach
When STDOUT and STDERR are not attached, we now print a container
ID. Make the tests aware of this.

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

Closes: #638
Approved by: rhatdan
2018-04-19 16:56:29 +00:00
Yiqiao Pu f2658ecda2 Add one test case for check diff in container and committed image
The test steps are:
1. Start a container and touch a file under /tmp
2. Use diff to check the container
3. commit the change into a new image
4. Use diff to check the image

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #643
Approved by: mheon
2018-04-19 14:19:04 +00:00
umohnani8 27107fdac1 Vendor in latest containers/image and contaners/storage
Made necessary changes to functions to include contex.Context wherever needed

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

Closes: #640
Approved by: baude
2018-04-19 14:08:47 +00:00
Yiqiao Pu 6a9dbf3305 Fix a typo
Update LineInOuputContains to LineInOutputContains.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

Closes: #642
Approved by: rhatdan
2018-04-19 09:28:08 +00:00
Nathan Williams 982927468c ip validation game too strong
Signed-off-by: Nathan Williams <nath.e.will@gmail.com>

Closes: #635
Approved by: rhatdan
2018-04-18 10:58:24 +00:00
Nathan Williams 94f20cdd00 - reverse host field order (ip goes first)
- fix host string split to permit IPv6

Signed-off-by: Nathan Williams <nath.e.will@gmail.com>

Closes: #635
Approved by: rhatdan
2018-04-18 10:58:24 +00:00
Yiqiao Pu f1a4867bcd Add a function for check if command exist
Use this function to check if command exist before execute it
in our test.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-16 10:55:29 +08:00
Yiqiao Pu d6d7edb841 Add WaitContainerReady for wait for docker registry ready
Sometime podman push local registry still failed caused by the
docker registry is not start yet after sleep 5s in the test.
So add this function to check the container status by its output
and skip the test when the docker registry can not start normally
instead of failed the case.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-16 10:55:21 +08:00
Yiqiao Pu 0fe0c79dc9 Add several podman push tests
Add five tests for podman push tests:
- push to docker with authorization
- push to docker-archive
- push to docker-daemon
- push to oci-archive
- push to ostree

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-04-16 10:55:11 +08:00
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