summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-20 19:14:08 +0000
committerGitHub <noreply@github.com>2021-10-20 19:14:08 +0000
commit4268a4afee4c1d030c1f901398e6a9b3f282eae3 (patch)
tree9b94171cc3807e028d218a793b73aded58a7badb
parenteba281c3e0e69533427d3eb5c66c60b5ca038c1b (diff)
parent70a5d8cd1d8e44d755be316730046b73a4a6e2eb (diff)
downloadpodman-4268a4afee4c1d030c1f901398e6a9b3f282eae3.tar.gz
podman-4268a4afee4c1d030c1f901398e6a9b3f282eae3.tar.bz2
podman-4268a4afee4c1d030c1f901398e6a9b3f282eae3.zip
Merge pull request #12049 from edsantiago/test_dash_a_with_l
System tests: confirm that -a and -l clash
-rw-r--r--cmd/podman/containers/start.go3
-rw-r--r--test/system/015-help.bats6
-rw-r--r--test/system/045-start.bats4
3 files changed, 9 insertions, 4 deletions
diff --git a/cmd/podman/containers/start.go b/cmd/podman/containers/start.go
index 1163b9093..8813fc273 100644
--- a/cmd/podman/containers/start.go
+++ b/cmd/podman/containers/start.go
@@ -87,6 +87,9 @@ func validateStart(cmd *cobra.Command, args []string) error {
if len(args) == 0 && !startOptions.Latest && !startOptions.All {
return errors.New("start requires at least one argument")
}
+ if startOptions.All && startOptions.Latest {
+ return errors.Errorf("--all and --latest cannot be used together")
+ }
if len(args) > 0 && startOptions.Latest {
return errors.Errorf("--latest and containers cannot be used together")
}
diff --git a/test/system/015-help.bats b/test/system/015-help.bats
index 5f38c34a1..b0795b524 100644
--- a/test/system/015-help.bats
+++ b/test/system/015-help.bats
@@ -86,6 +86,12 @@ function check_help() {
run_podman 125 "$@" $cmd -l nonexistent-container
is "$output" "Error: .*--latest and \(containers\|pods\|arguments\) cannot be used together" \
"'$command_string' with both -l and container"
+
+ # Combine -l and -a, too (but spell it as --all, because "-a"
+ # means "attach" in podman container start)
+ run_podman 125 "$@" $cmd --all --latest
+ is "$output" "Error: \(--all and --latest cannot be used together\|--all, --latest and containers cannot be used together\|--all, --latest and arguments cannot be used together\|unknown flag\)" \
+ "'$command_string' with both --all and --latest"
fi
fi
diff --git a/test/system/045-start.bats b/test/system/045-start.bats
index 7e4bbde8d..2ea057cd3 100644
--- a/test/system/045-start.bats
+++ b/test/system/045-start.bats
@@ -36,10 +36,6 @@ load helpers
expected="Error: either start all containers or the container(s) provided in the arguments"
run_podman 125 start --all 12333
is "$output" "$expected" "start --all, with args, throws error"
- if ! is_remote; then
- run_podman 125 start --all --latest
- is "$output" "$expected" "podman start --all --latest"
- fi
}
@test "podman start --filter - start only containers that match the filter" {