summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
Diffstat (limited to 'test/system')
-rw-r--r--test/system/015-help.bats36
-rw-r--r--test/system/030-run.bats19
-rw-r--r--test/system/090-events.bats14
-rw-r--r--test/system/250-systemd.bats2
4 files changed, 52 insertions, 19 deletions
diff --git a/test/system/015-help.bats b/test/system/015-help.bats
index 651fdcd09..22db8be8a 100644
--- a/test/system/015-help.bats
+++ b/test/system/015-help.bats
@@ -6,7 +6,7 @@
# provides its own --help output. If the usage message ends in '[command]',
# treat it as a subcommand, and recurse into its own list of sub-subcommands.
#
-# Any usage message that ends in '[flags]' is interpreted as a command
+# Any usage message that ends in '[options]' is interpreted as a command
# that takes no further arguments; we confirm by running with 'invalid-arg'
# and confirming that it exits with error status and message.
#
@@ -17,7 +17,7 @@ load helpers
function podman_commands() {
dprint "$@"
run_podman help "$@" |\
- awk '/^Available Commands:/{ok=1;next}/^Flags:/{ok=0}ok { print $1 }' |\
+ awk '/^Available Commands:/{ok=1;next}/^Options:/{ok=0}ok { print $1 }' |\
grep .
"$output"
}
@@ -42,7 +42,7 @@ function check_help() {
# e.g. 'podman ps' should not show 'podman container ps' in usage
# Trailing space in usage handles 'podman system renumber' which
- # has no ' [flags]'
+ # has no ' [options]'
is "$usage " " $command_string .*" "Usage string matches command"
# If usage ends in '[command]', recurse into subcommands
@@ -52,25 +52,25 @@ function check_help() {
continue
fi
- # We had someone write upper-case '[FLAGS]' once. Prevent it.
- if expr "$usage" : '.*\[FLAG' >/dev/null; then
- die "'flags' string must be lower-case in usage: $usage"
+ # We had someone write upper-case '[OPTIONS]' once. Prevent it.
+ if expr "$usage" : '.*\[OPTION' >/dev/null; then
+ die "'options' string must be lower-case in usage: $usage"
fi
- # We had someone do 'podman foo ARG [flags]' one time. Yeah, no.
- if expr "$usage" : '.*[A-Z].*\[flag' >/dev/null; then
- die "'flags' must precede arguments in usage: $usage"
+ # We had someone do 'podman foo ARG [options]' one time. Yeah, no.
+ if expr "$usage" : '.*[A-Z].*\[option' >/dev/null; then
+ die "'options' must precede arguments in usage: $usage"
fi
- # Cross-check: if usage includes '[flags]', there must be a
- # longer 'Flags:' section in the full --help output; vice-versa,
- # if 'Flags:' is in full output, usage line must have '[flags]'.
- if expr "$usage" : '.*\[flag' >/dev/null; then
- if ! expr "$full_help" : ".*Flags:" >/dev/null; then
- die "$command_string: Usage includes '[flags]' but has no 'Flags:' subsection"
+ # Cross-check: if usage includes '[options]', there must be a
+ # longer 'Options:' section in the full --help output; vice-versa,
+ # if 'Options:' is in full output, usage line must have '[options]'.
+ if expr "$usage" : '.*\[option' >/dev/null; then
+ if ! expr "$full_help" : ".*Options:" >/dev/null; then
+ die "$command_string: Usage includes '[options]' but has no 'Options:' subsection"
fi
- elif expr "$full_help" : ".*Flags:" >/dev/null; then
- die "$command_string: --help has 'Flags:' section but no '[flags]' in synopsis"
+ elif expr "$full_help" : ".*Options:" >/dev/null; then
+ die "$command_string: --help has 'Options:' section but no '[options]' in synopsis"
fi
# If usage lists no arguments (strings in ALL CAPS), confirm
@@ -102,7 +102,7 @@ function check_help() {
# If usage has required arguments, try running without them.
# The expression here is 'first capital letter is not in [BRACKETS]'.
- # It is intended to handle 'podman foo [flags] ARG' but not ' [ARG]'.
+ # It is intended to handle 'podman foo [options] ARG' but not ' [ARG]'.
if expr "$usage" : '[^A-Z]\+ [A-Z]' >/dev/null; then
# Exceptions: these commands don't work rootless
if is_rootless; then
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 564de6a69..48f25f8d3 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -484,4 +484,23 @@ json-file | f
run_podman kill $cid
}
+# Regression test for issue #8082
+@test "podman run : look up correct image name" {
+ # Create a 2nd tag for the local image.
+ local name="localhost/foo/bar"
+ run_podman tag $IMAGE $name
+
+ # Create a container with the 2nd tag and make sure that it's being
+ # used. #8082 always inaccurately used the 1st tag.
+ run_podman create $name
+ cid="$output"
+
+ run_podman inspect --format "{{.ImageName}}" $cid
+ is "$output" "$name"
+
+ # Clean up.
+ run_podman rm $cid
+ run_podman untag $IMAGE $name
+}
+
# vim: filetype=sh
diff --git a/test/system/090-events.bats b/test/system/090-events.bats
new file mode 100644
index 000000000..06e28ec3a
--- /dev/null
+++ b/test/system/090-events.bats
@@ -0,0 +1,14 @@
+#!/usr/bin/env bats -*- bats -*-
+#
+# tests for podman events functionality
+#
+
+load helpers
+
+@test "events with a filter by label" {
+ skip_if_remote "Need to talk to Ed on why this is failing on remote"
+ rand=$(random_string 30)
+ run_podman 0 run --label foo=bar --name test-$rand --rm $IMAGE ls
+ run_podman 0 events --filter type=container --filter container=test-$rand --filter label=foo=bar --filter event=start --stream=false
+ is "$output" ".*foo=bar" "check for label event on container with label"
+}
diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats
index 9bd3e15a1..ac3ae2f98 100644
--- a/test/system/250-systemd.bats
+++ b/test/system/250-systemd.bats
@@ -42,7 +42,7 @@ function teardown() {
cname=$(random_string)
# See #7407 for --pull=always.
- run_podman create --pull=always --name $cname --label "io.containers.autoupdate=image" --detach $IMAGE top
+ run_podman create --pull=always --name $cname --label "io.containers.autoupdate=image" $IMAGE top
run_podman generate systemd --new $cname
echo "$output" > "$UNIT_FILE"