1399 Commits

Author SHA1 Message Date
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
cbca625328 V2 Add support for ssh authentication methods
* podman --remote ssh://<user>:<password>@<host>:<port><path>
* podman --remote ssh://<user>:<password>@<host>:<port><path> \
  --identity <path> --passphrase <phrase>
* ssh-add <key>
  podman --remote ssh://<user>@<host><path>
* Fix `podman help` to run even if podman missing components
* Prompt for passphrase on stdin IFF key is protected and passphrase
  not given via any other configuration

* cobra flags do not support optional value flags therefore refactored
  --remote to be a boolean and --url will now contain the URI to Podman
  service

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-03 09:54:39 -07:00
8153f299ad Add more Remote tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-03 06:35:45 -04:00
382342a0b0 test.apiv2: add test cases for committing an image from a container
Testing query parameters: container, repo, tag, comment, author, changes
and pause.

Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
2020-06-03 05:33:56 +00:00
10ebb74d6f Consistent Yaml convention througout play kube tests
Signed-off-by: Aditya Kamath <theunrealgeek@gmail.com>
2020-06-02 20:49:12 -07:00
5330ce9876 Fix podman generate tests that relied on play kube
Signed-off-by: Aditya Kamath <theunrealgeek@gmail.com>
2020-06-02 20:33:16 -07:00
c739b58ad5 Add tests for Deployment Kind and minor fix for play kube output
Signed-off-by: Aditya Kamath <theunrealgeek@gmail.com>
2020-06-02 20:33:16 -07:00
103c9225a9 Fix existing tests
Signed-off-by: Aditya Kamath <theunrealgeek@gmail.com>
2020-06-02 20:33:16 -07:00
5473ba95d7 Turn on remote rm_test --cidfile
Turn on remote rm_test --cidfile

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-02 19:12:31 -04:00
42505f64d2 Properly follow linked namespace container for stats
Podman containers can specify that they get their network
namespace from another container. This is automatic in pods, but
any container can do it.

The problem is that these containers are not guaranteed to have a
network namespace of their own; it is perfectly valid to join the
network namespace of a --net=host container, and both containers
will end up in the host namespace. The code for obtaining network
stats did not account for this, and could cause segfaults as a
result. Fortunately, the fix is simple - the function we use to
get said stats already performs appropriate checks, so we just
need to recursively call it.

Fixes #5652

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-02 17:58:52 -04:00
4b37d4d5af Fix a segfault in podman inspect -l w/ no containers
We also need to rework container/image inspect to be separate,
but that can happen in another PR.

Fixes #6472

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-02 17:22:00 -04:00
e0d9404634 Enable detached exec for remote
The biggest obstacle here was cleanup - we needed a way to remove
detached exec sessions after they exited, but there's no way to
tell if an exec session will be attached or detached when it's
created, and that's when we must add the exit command that would
do the removal. The solution was adding a delay to the exit
command (5 minutes), which gives sufficient time for attached
exec sessions to retrieve the exit code of the session after it
exits, but still guarantees that they will be removed, even for
detached sessions. This requires Conmon 2.0.17, which has the new
`--exit-delay` flag.

As part of the exit command rework, we can drop the hack we were
using to clean up exec sessions (remove them as part of inspect).
This is a lot cleaner, and I'm a lot happier about it.

Otherwise, this is just plumbing - we need a bindings call for
detached exec, and that needed to be added to the tunnel mode
backend for entities.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-02 15:30:42 -04:00
94f2241831 Merge pull request #6411 from mheon/exec_bindings
Add bindings for exec and enable attached remote exec
2020-06-02 06:08:21 -04:00
45a7e7266e Add bindings for exec and enable attached remote
This adds bindings for starting exec sessions, and then uses them
to wire up detached exec. Code is heavily based on Attach code
for containers, slightly modified to handle exec sessions.

Bindings are presently attached-only, detached is pending on a
Conmon update landing in CI. I'll probably get to that next.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-01 17:24:00 -04:00
d6bf6b92c8 Merge pull request #6456 from edsantiago/bats
system tests : more tests
2020-06-01 21:11:41 +02:00
7c41cb7802 Merge pull request #6454 from rhatdan/remote
Remove skipifremote checks in images_test.go
2020-06-01 20:41:41 +02:00
03d32d05ac system tests : more tests
- exec: add test for #5046, in which conmon swallowed chars
  on a large byte transfer

- pod: add 'pod exists' tests, both positive and negative;
  consolidate tests; add '--label', and check in 'pod inspect'
  add 'pod ps' tests

- networking: add test for #5466, in which detached run
  with --userns=keep-id would not forward a port

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-06-01 12:00:47 -06:00
990514ea92 Add support for format {{.Label}}
the pod ps man page says .Label is valid go template format. i dont think the function was actually ever implemented.

Fixes #6448

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-01 11:54:15 -05:00
d8b0a58fd8 turn on remote testing for images. podman-remote build now works.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-01 12:44:04 -04:00
8c1883721c Fix leak of empty tarball
In cases of trying to export an image, if the image was not found, we leaked an empty tarball or directory depending on the format.

Fixes: #6409

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-01 10:07:58 -05:00
22713d62e2 Merge pull request #6353 from lsm5/build-without-varlink
enable building without `varlink` tag
2020-06-01 14:48:35 +02:00
9037908b78 Merge pull request #5594 from edsantiago/bats
system tests: enable skopeo REGISTRY_AUTH_FILE
2020-05-30 05:17:18 -04:00
8a914e8a0b default build without varlink tag
Issue gh#6286 was already fixed in a prior commit but the Makefile still
ran some varlink steps by default.

This commit makes any varlink build steps dependent on the varlink
build tag and also makes the contrib rpm spec file independent of
varlink.

Endpoint tests will be run only if BUILDTAGS contains varlink.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-05-29 14:38:33 -04:00
78c38460eb Merge pull request #6380 from mheon/fix_mount_readonly
Add support for `readonly` option to --mount
2020-05-29 08:26:05 -04:00
5626c2163b V2 verify JSON output is consistent and doesn't drift
$ cd test/apiv2
$ python -m unittest -v test_rest_v1_0_0.TestApi

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-28 16:20:29 -07:00
e8818ced80 Merge pull request #6416 from vrothberg/fix-ps-last
fix `ps --last=N`
2020-05-28 14:54:45 -04:00
d6469c9c9b fix ps --last=N
Fix `ps --last=N` to also include non-running containers. Also add an
e2e test to prevent us from regressing in the future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-28 14:24:01 +02:00
7e03d277f7 test.apiv2: add testing for image and deal with API returning binary
Add testing for displaying image history and exporting image

Deal with API returning binary (Content-Type =~ 'octet').
When so, set $output to the output of 'file'.

Bug fix: in 't' helper, declare loop var $i as local
to avoid contaminating caller

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
2020-05-28 10:00:13 +00:00
8438fa4fec Add streaming ability to endpoint
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-27 12:16:39 -05:00
89b4683cc4 Merge pull request #6372 from boaz0/gh_6283
Add --format to pod inspect
2020-05-27 09:59:25 -04:00
1f8a78747a Add --format to pod inspect
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2020-05-27 09:48:38 +03:00
e26f9eda64 Add support for readonly option to --mount
This is just an alias to the `ro` option, but it's already in the
manpages (and Docker) so we might as well add support for it.

Fixes #6379

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-26 16:05:11 -04:00
d32d588504 Merge pull request #6363 from jwhonce/wip/attach
V2 Fix interface nil checks
2020-05-26 14:36:17 -04:00
1fb907198f V2 Fix interface nil checks
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-26 10:00:15 -07:00
1077d2d0b7 Merge pull request #6321 from Luap99/podman-generate-systemd-unit-prefix
Allow to change the generated systemd unit name prefix
2020-05-25 06:46:17 -04:00
e41089244b Attempt to turn on build_without_cgo tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-22 12:56:19 -04:00
e704f1362a Added new flags to 'podman generate systemd' to change the unit name prefix
--container-prefix <string> - default 'container'
Systemd unit name prefix for containers

--pod-prefix <string> - default 'pod'
Systemd unit name prefix for pods

--separator <string> - default '-'
Systemd unit name seperator between name/id and prefix

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-05-22 18:38:39 +02:00
f51e0d0597 V2 enable remote logs and testing
* wire up bindings and handler for obtaining logs remotely
* enable debug logging from podman in e2e test using DEBUG and
  DEBUG_SERVICE env variables
* Fix error in streaming log frames
* enable remote logs test

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-22 07:51:29 -07:00
cf5d33807f Merge pull request #6345 from QiWang19/mani-push-test
remote manifest test
2020-05-22 15:47:33 +02:00
a61f9fd547 Removes remote system reset functionality. skip e2e test for remote.
As system reset too dangerous for remote use, deleting the functionality
and the test case.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-05-22 07:49:55 -04:00
3f2ab6bc2e Merge pull request #6331 from sujil02/iidfile-battest
Enables iidfile test as issue fixed now
2020-05-22 12:09:18 +02:00
398d46230b Merge pull request #6328 from sujil02/rmi-test
Enable rmi test
2020-05-22 12:03:50 +02:00
be43536c0a Merge pull request #6330 from rhatdan/start
Fix podman-remote start tests
2020-05-22 01:44:03 +02:00
99fcb90f28 Merge pull request #6275 from rhatdan/VERSION
Display human build date in podman info
2020-05-22 01:38:16 +02:00
9f5e661cfe Enables iidfile test as issue fixed now
Signed-off-by: Sujil02 <sushah@redhat.com>
2020-05-21 18:37:31 -04:00
b023d6d541 Merge pull request #6329 from rhatdan/test
Turn on more remote tests
2020-05-21 23:46:09 +02:00
7ff96dbc83 Fix podman-remote start tests
Also enable some tests for remote by removing -l flag.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-21 16:46:26 -04:00
7b188f7b5b podman version --format ... was not working
This patch fixes the podman --version --format command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-21 16:31:34 -04:00
f7dd915acc remote manifest test
Enable remove manifest tests. Skip --purge test because remote does not support it.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-21 16:17:39 -04:00
b941066566 Turn on more remote tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-21 16:04:31 -04:00