summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-19 17:35:43 +0200
committerGitHub <noreply@github.com>2022-09-19 17:35:43 +0200
commit5f5d40084c71a5adabc029c97d682c33cab07353 (patch)
tree1ad481a8d7d177ad6f1f1fffbddf21c5e7b72ff5 /test
parent541655f31a5301ea042d04782d1635ad51e9f434 (diff)
parent3508bd22fe355630453d497d905e480974a84b96 (diff)
downloadpodman-5f5d40084c71a5adabc029c97d682c33cab07353.tar.gz
podman-5f5d40084c71a5adabc029c97d682c33cab07353.tar.bz2
podman-5f5d40084c71a5adabc029c97d682c33cab07353.zip
Merge pull request #15072 from rhatdan/context
Add support for podman context as alias to podman system connection
Diffstat (limited to 'test')
-rw-r--r--test/system/001-basic.bats7
-rw-r--r--test/system/272-system-connection.bats22
2 files changed, 23 insertions, 6 deletions
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index 378edc013..ba6bde4df 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -56,14 +56,17 @@ function setup() {
@test "podman --context emits reasonable output" {
+ if ! is_remote; then
+ skip "only applicable on podman-remote"
+ fi
# All we care about here is that the command passes
run_podman --context=default version
# This one must fail
run_podman 125 --context=swarm version
is "$output" \
- "Error: podman does not support swarm, the only --context value allowed is \"default\"" \
- "--context=default or fail"
+ "Error: failed to resolve active destination: \"swarm\" service destination not found" \
+ "--context=swarm should fail"
}
@test "podman can pull an image" {
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