Commit graph

30 commits

Author SHA1 Message Date
Daniel J Walsh 15345ce4c3
podman create doesn't support creating detached containers
Detached containers and detach keys are only created with the podman run, i
exec, and start commands.  We do not store the detach key sequence or the
detach flags in the database, nor does Docker. The current code was ignoreing
these fields but documenting that they can be used.

Fix podman create man page and --help output to no longer indicate that
--detach and --detach-keys works.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 21:00:50 -04:00
Ed Santiago b7147afde9 e2e tests: SkipIfRemote(): add a reason
Now that Dan has added helpful comments to each SkipIfRemote,
let's take the next step and include those messages in the
Skip() output so someone viewing test results can easily
see if a remote test is skipped for a real reason or for
a FIXME.

This commit is the result of a simple:

   perl -pi -e 's;(SkipIfRemote)\(\)(\s+//\s+(.*))?;$1("$3");' *.go

in the test/e2e directory, with a few minor (manual) changes
in wording.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-23 08:09:31 -06:00
Daniel J Walsh a277b7eb0b
Examine all SkipIfRemote functions
Remove ones that are not needed.
Document those that should be there.
Document those that should be fixed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-22 16:55:37 -04:00
Daniel J Walsh 1b610e93d2
Fix handling of podman-remote stop --ignore
This patch simplifies the hanlding of rhe --ignore flag, for podman stop, rm

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-19 06:21:18 -04:00
Daniel J Walsh a5e37ad280
Switch all references to github.com/containers/libpod -> podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 08:23:45 -04:00
Daniel J Walsh a10d5b42ab
Change buildtag for remoteclient to remote for testing
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-06 15:22:24 -04:00
Valentin Rothberg 8489dc4345 move go module to v2
With the advent of Podman 2.0.0 we crossed the magical barrier of go
modules.  While we were able to continue importing all packages inside
of the project, the project could not be vendored anymore from the
outside.

Move the go module to new major version and change all imports to
`github.com/containers/libpod/v2`.  The renaming of the imports
was done via `gomove` [1].

[1] https://github.com/KSubedi/gomove

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-06 15:50:12 +02:00
Qi Wang e77db144ab turn on remote stop_test
turn on stop_test  --cidfile

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-03 12:55:58 -04:00
Daniel J Walsh b0b153ddcd
Fix podman-remote stop --all to handle not running containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-21 15:17:28 -04:00
Brent Baude 2624c043d1 Test fixes for remote integration
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-20 12:56:38 -05:00
Brent Baude 8ec08a426e v2 enable remote integration tests
enable remote integration tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-19 14:26:19 -05:00
Daniel J Walsh 94b62dac74
Fix handling of --cidfile on create/run
Currently create and run are ignoring the cidfile flag.

Enable stop_test.go to make sure this works.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-22 09:52:33 -04:00
Brent Baude 5c968b7693 Force integration tests to pass
Failing tests are now skipped and we should work from this.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-21 13:48:50 -05:00
Valentin Rothberg a3d13fb286 podman {pod,} rm/stop: add --ignore flag
Add an --ignore flag to podman rm and stop. When specified, Podman will
ignore "no such {container,pod}" errors that occur when a specified
container/pod is not present in the store (anymore).  The motivation
behind adding this flag is to write more robust systemd services using
Podman.  A user might have manually decided to remove a container/pod
which would lead to a failure during the `ExecStop` directive of a
systemd service referencing that container/pod.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-11-25 09:48:13 +01:00
Valentin Rothberg 061bf77588 podman rm/stop --cidfile
Add a --cidfile flag to podman rm/stop to pass a container ID via a
file.  Podman run already provides the functionaly to store the ID
in a specified file which we now complete with rm/stop.  This allows
for a better life-cycle management in systemd services.  Note that
--cdifile can be specified multiple times to rm/stop.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-11-18 14:44:08 +01:00
baude f610a485c1 use imagecaches for local tests
when doing localized tests (not varlink), we can use secondary image
stores as read-only image caches.  this cuts down on test time
significantly because each test does not need to restore the images from
a tarball anymore.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-29 15:12:05 -05:00
baude bc7b1ca03d enable integration tests for remote-client
first pass at enabling a swath of integration tests for the
remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-07 14:06:02 -05:00
Matthew Heon 90873b465b Fix test compile
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-24 12:51:41 -04:00
Matthew Heon c3c2ba079d Trim whitespace from ps -q before comparing
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-24 12:51:41 -04:00
Matthew Heon 597b2ebfea Enhance tests for stop to check results
None of the stop tests actually verified that containers were in
a stopped state after they finished. We shouldn't take a 0 exit
code to indicate that things worked - verify that ps shows no
running containers.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-24 12:51:41 -04:00
Matthew Heon 5405b4f279 Add extra CI tests for stopping all containers
We weren't testing cases where not all containers were running
when stop --all ran.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-24 12:51:41 -04:00
baude d5546008ab ginkgo status improvements
a series of improvements to our ginkgo test framework so we can
get better ideas of whats going on when run in CI

Signed-off-by: baude <bbaude@redhat.com>
2019-03-08 13:28:33 -06:00
Jhon Honce ae47a7c47e Fix #2521
* Bad merge against podman stop, restored overwritten code

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-04 12:20:37 -07:00
Daniel J Walsh 4c618875f6
Add tests to make sure podman container and podman image commands work
We have little to no testing to make sure we don't break podman image and
podman container commands that wrap traditional commands.

This PR adds tests for each of the commands.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-02 07:15:26 -05:00
baude b30a56c156 Run integrations test with remote-client
Add the ability to run the integration (ginkgo) suite using
the remote client.

Only the images_test.go file is run right now; all the rest are
isolated with a // +build !remotelinux.  As more content is
developed for the remote client, we can unblock the files and
just block single tests as needed.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-14 14:51:32 -06:00
Matthew Heon 841f47d728 Add test to ensure stopping a stopped container works
We regressed on this at some point. Adding a new test should help
ensure that doesn't happen again.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-11-28 09:35:30 -05:00
Yiqiao Pu 74bcfc2f96 Separate common used test functions and structs to test/utils
Put common used test functions and structs to a separated package.
So we can use them for more testsuites.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-16 10:49:00 +08:00
baude 433cbd5254 Show duration for each ginkgo test and test speed improvements
Because our tests are getting so long, we want to be able to audit which tests are taking
the longest to complete.  This may indicate a bad test, bad CI, bad code, etc and therefore
should be auditable.

Also, make speed improvements to tests by making sure we only unpack caches images that
actually get used.

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

Closes: #1178
Approved by: mheon
2018-07-28 22:51:08 +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
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