diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-09-09 09:06:18 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-09-15 08:17:15 -0400 |
commit | 3508bd22fe355630453d497d905e480974a84b96 (patch) | |
tree | 42874103bb7d0329796598fc251e6e8f4fac1bdc /test/system/272-system-connection.bats | |
parent | 4fc18d07a6b206476421ed134f0eeec1221936c2 (diff) | |
download | podman-3508bd22fe355630453d497d905e480974a84b96.tar.gz podman-3508bd22fe355630453d497d905e480974a84b96.tar.bz2 podman-3508bd22fe355630453d497d905e480974a84b96.zip |
Add support for podman context as alias to podman system connection
Alias
podman --context -> podman --connection
podman context use -> podman system connection default
podman context rm -> podman system connection rm
podman context create -> podman system connection add
podman context ls ->podman system connection ls
podman context inspect ->podman system connection ls --json (For
specified connections)
Podman context is a hidden command, but can be used for existing scripts
that assume Docker under the covers.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/system/272-system-connection.bats')
-rw-r--r-- | test/system/272-system-connection.bats | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/test/system/272-system-connection.bats b/test/system/272-system-connection.bats index e937a7273..402e69736 100644 --- a/test/system/272-system-connection.bats +++ b/test/system/272-system-connection.bats @@ -56,8 +56,22 @@ function _run_podman_remote() { c1="c1_$(random_string 15)" c2="c2_$(random_string 15)" - run_podman system connection add $c1 tcp://localhost:12345 - run_podman system connection add --default $c2 tcp://localhost:54321 + run_podman system connection add $c1 tcp://localhost:12345 + run_podman context create --docker "host=tcp://localhost:54321" $c2 + run_podman system connection ls + is "$output" \ + ".*$c1[ ]\+tcp://localhost:12345[ ]\+true +$c2[ ]\+tcp://localhost:54321[ ]\+false" \ + "system connection ls" + run_podman system connection ls -q + is "$(echo $(sort <<<$output))" \ + "$c1 $c2" \ + "system connection ls -q should show two names" + run_podman context ls -q + is "$(echo $(sort <<<$output))" \ + "$c1 $c2" \ + "context ls -q should show two names" + run_podman context use $c2 run_podman system connection ls is "$output" \ ".*$c1[ ]\+tcp://localhost:12345[ ]\+false @@ -66,11 +80,11 @@ $c2[ ]\+tcp://localhost:54321[ ]\+true" \ # Remove default connection; the remaining one should still not be default run_podman system connection rm $c2 - run_podman system connection ls + run_podman context ls is "$output" ".*$c1[ ]\+tcp://localhost:12345[ ]\+false" \ "system connection ls (after removing default connection)" - run_podman system connection rm $c1 + run_podman context rm $c1 } # Test tcp socket; requires starting a local server |