Commit graph

15 commits

Author SHA1 Message Date
Daniel J Walsh 21c9dc3c40
Add --time out for podman * rm -f commands
Add --time flag to podman container rm
Add --time flag to podman pod rm
Add --time flag to podman volume rm
Add --time flag to podman network rm

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-04 07:07:56 -04:00
Ed Santiago 86083c580b System tests: speed up. They've gotten too slow.
- logs: remove unnecessary sleeps. This saves ~25s.
   Unfortunately, journald seems to have some sort of lag,
   so we need to keep retrying until we get the 'after' string.

 - ps: add placeholder test for once buildah 3544 is fixed

 - cp: bulk-kill containers when finished, instead of one by one.
   This is a big change and only saves about 8s per run, but hey.

 - mount,pause,healthcheck: 'podman stop -t 0' before rm'ing containers.
   Easy 50s.
   Have I mentioned, lately, that 'podman rm -f' needs a '-t 0' flag?

 - play: same, and also 'podman pod stop'. Seems to shave ~20s.

 - socket-activation: UGH! Buggy and useless tests! They were
   running "sleep 90" containers for no reason whatsoever. I
   assume the intention was to run them with "-d", so that's
   what I've done here. Also fixed some language. 180 seconds!

(Unrelated: cleanup in 070-build, use $IMAGE, not alpine)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-09-27 20:06:18 -06:00
Valentin Rothberg 1eaa449590 logs -f: file: fix dead lock
Fix a dead lock in the file log driver where one goroutine would wait on
the tail to hit EOF but reading is blocked for the function to return.

Fixes: 11461
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-07 12:46:56 +02:00
cdoern 0f708efd8b Implemented --until flag for libpod's container logs
compat containers/logs was missing actual usage of until query param.
This led me to implement the until param for libpod's container logs as well. Added e2e tests.

Signed-off-by: cdoern <cdoern@redhat.com>
2021-07-22 10:56:56 -04:00
Valentin Rothberg 10569c988f journald logger: fix race condition
Fix a race in journald driver.  Following the logs implies streaming
until the container is dead.  Streaming happened in one goroutine,
waiting for the container to exit/die and signaling that event happened
in another goroutine.

The nature of having two goroutines running simultaneously is pretty
much the core of the race condition.  When the streaming goroutines
received the signal that the container has exitted, the routine may not
have read and written all of the container's logs.

Fix this race by reading both, the logs and the events, of the container
and stop streaming when the died/exited event has been read.  The died
event is guaranteed to be after all logs in the journal which guarantees
not only consistencty but also a deterministic behavior.

Note that the journald log driver now requires the journald event
backend to be set.

Fixes: #10323
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-26 14:51:58 +02:00
Valentin Rothberg d32863bbb4 podman image tree: restore previous behavior
The initial version of libimage changed the order of layers which has
now been restored to remain backwards compatible.

Further changes:

 * Fix a bug in the journald logging which requires to strip trailing
   new lines from the message.  The system tests did not pass due to
   empty new lines.  Triggered by changing the default logger to
   journald in containers/common.

 * Fix another bug in the journald logging which embedded the container
   ID inside the message rather than the specifid field.  That surfaced
   in a preceeding whitespace of each log line which broke the system
   tests.

 * Alter the system tests to make sure that the k8s-file and the
   journald logging drivers are executed.

 * A number of e2e tests have been changed to force the k8s-file driver
   to make them pass when running inside a root container.

 * Increase the timeout in a kill test which seems to take longer now.
   Reasons are unknown.  Tests passed earlier and no signal-related
   changes happend.  It may be CI VM flake since some system tests but
   other flaked.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-12 17:56:59 +02:00
Ed Santiago 4d7e05f9ba RHEL gating tests: more journald exceptions
Followup to #8284, due to my not having noticed #8096.

RHEL gating tests are failing again due to rhbz#1895105, the
one where we can't run journalctl rootless on RHEL. #8284 fixed
this for some RHEL builds of older podman, but I missed #8096
which added yet another logs test.

This brings us to three journalctl exceptions, which means
it gets complicated because I have to refactor it all.

**THIS IS NOT SUSTAINABLE**. We need some way to have a similar
setup in CI, with a permission-less rootless login, so we don't
add yet another logs test some day and discover, months later,
that it doesn't work on RHEL and then have to go into crisis
mode.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-12-14 06:40:46 -07:00
Chih-Hsuan Yen e58fb21ced
Support Unix timestamps for podman logs --since
To match what podman-logs(1) describes --since

Signed-off-by: Chih-Hsuan Yen <yan12125@gmail.com>
2020-12-04 15:14:31 +08:00
Ed Santiago c62c64856e system tests: skip journald tests on RHEL8
(actually, on any system exhibiting the symptom wherein
journalctl fails due to insufficient permissions, which
for all practical purposes means only RHEL8)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-11-09 13:44:44 -07:00
Ashley Cui c0d1954663 Fix Podman logs reading journald
A podman could not read logs written to journald properly, due to a tail config bug.
Added a system test to check this - since e2e tests don't like journald

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-10-02 10:05:19 -04:00
Ed Santiago a4fcf09b7a Reenable remote system tests
podman-remote is in better shape now. Let's see what needs
to be done to reenable remote system tests.

 - logs test: skip multilog, it doesn't work remote

 - diff test: use -l only when local, not with remote

 - many other tests: skip_if_remote, with 'FIXME: pending #xxxx'
   where xxxx is a filed issue.

Unrelated: added new helper to skip_if_remote and _if_rootless,
where we check if the source message includes "remote"/"rootless"
and insert it if missing. This is a minor usability enhancement
to make it easier to understand at-a-glance why a skip triggers.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-03 09:36:36 -06:00
Ed Santiago 78bd2eac06 bats - various small updates
- podman-remote:
  - enable log, run and build tests, they're working now
    - well, except build + rootless. Skip that one.
  - add explanation of why info test is skipped

- Giuseppe's permission test:
  - validate GraphRoot and RunRoot values
  - add verbose logging, to enable seeing full directory tree
    permissions on error

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-04-18 15:39:21 -06:00
Ed Santiago 7220c166d4 BATS tests: start supporting podman-remote
podman-remote now supports rm! That's what we needed to start
running BATS tests.

Although most tests don't actually work, some do, and maybe
the rest will start working over time. For now, disable them.

The only significant difference found is that podman-remote
strips fractional seconds from timestamps in JSON output.
Probably not something worth caring about.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-04-10 08:19:09 -06:00
Ed Santiago 58d2e589fb BATS: new tests, and improvements to existing ones
New:
 - podman exec
 - podman load (requires #2674)
 - CLI parsing (regression test for #2574)

Improved:
 - help: test "podman NoSuchCommand", and subcommands
 - help: test "podman cmd" without required args
 - pod: start with --infra=false; this allows running rootless
 - log: also run 'logs' after container is run
 - log: test -f with two containers

Also, use helpful descriptions for skip_if_rootless

Tested on f29, root and rootless. As soon as podman-remote
supports rm, I'll start testing that too.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-18 15:21:52 -06:00
Ed Santiago 589248d2f3 Implement review feedback
- document a recommended convention for fail-fast tests

- document the requirement for jq. (And, add a fail-fast
  test for its presence; remove the duplicated checks
  in subtests)

- add further sanity checks to 'help' test. Add missing
  documentation. Remove a no-longer-needed workaround for
  usage-message bug fixed in #2486

- add a documented TEMPLATE

- and, since we're at 1.1, enable 'Remote API' check in
  version test

- better diagnostics in setup/teardown; add vim filetype hint;
  better formatting of actual-vs-expect errors

- new pod-top, logs, build tests

- improve error messages

- add $IMAGE alias for ridiculous $PODMAN_TEST_IMAGE_FQN

- final cleanup, in prep for merge

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-07 14:09:00 -07:00