summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/system/001-basic.bats31
-rw-r--r--test/system/300-cli-parsing.bats14
2 files changed, 44 insertions, 1 deletions
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index 9b0a71285..582efa058 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -33,6 +33,23 @@ function setup() {
fi
}
+@test "podman info" {
+ # These will be displayed on the test output stream, offering an
+ # at-a-glance overview of important system configuration details
+ local -a want=(
+ 'Arch:{{.Host.Arch}}'
+ 'OS:{{.Host.Distribution.Distribution}}{{.Host.Distribution.Version}}'
+ 'Runtime:{{.Host.OCIRuntime.Name}}'
+ 'Rootless:{{.Host.Security.Rootless}}'
+ 'Events:{{.Host.EventLogger}}'
+ 'Logdriver:{{.Host.LogDriver}}'
+ 'Cgroups:{{.Host.CgroupsVersion}}+{{.Host.CgroupManager}}'
+ 'Net:{{.Host.NetworkBackend}}'
+ )
+ run_podman info --format "$(IFS='/' echo ${want[@]})"
+ echo "# $output" >&3
+}
+
@test "podman --context emits reasonable output" {
# All we care about here is that the command passes
@@ -88,7 +105,8 @@ function setup() {
# ...but no matter what, --remote is never allowed after subcommand
PODMAN="${podman_non_remote} ${podman_args[@]}" run_podman 125 version --remote
- is "$output" "Error: unknown flag: --remote" "podman version --remote"
+ is "$output" "Error: unknown flag: --remote
+See 'podman version --help'" "podman version --remote"
}
@test "podman-remote: defaults" {
@@ -108,6 +126,17 @@ function setup() {
if grep -- " --remote " <<<"$output"; then
die "podman --help, with CONTAINER_CONNECTION set, is showing --remote"
fi
+
+ # When it detects --url or --connection, --remote is not an option
+ run_podman --url foobar --help
+ if grep -- " --remote " <<<"$output"; then
+ die "podman --help, with --url set, is showing --remote"
+ fi
+
+ run_podman --connection foobar --help
+ if grep -- " --remote " <<<"$output"; then
+ die "podman --help, with --connection set, is showing --remote"
+ fi
}
# Check that just calling "podman-remote" prints the usage message even
diff --git a/test/system/300-cli-parsing.bats b/test/system/300-cli-parsing.bats
index 92c073102..ec493d3d8 100644
--- a/test/system/300-cli-parsing.bats
+++ b/test/system/300-cli-parsing.bats
@@ -12,4 +12,18 @@ load helpers
run_podman run --rm --label 'true="false"' $IMAGE true
}
+@test "podman flag error" {
+ local name="podman"
+ if is_remote; then
+ name="podman-remote"
+ fi
+ run_podman 125 run -h
+ is "$output" "Error: flag needs an argument: 'h' in -h
+See '$name run --help'" "expected error output"
+
+ run_podman 125 bad --invalid
+ is "$output" "Error: unknown flag: --invalid
+See '$name --help'" "expected error output"
+}
+
# vim: filetype=sh