summaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
Diffstat (limited to 'test/system')
-rw-r--r--test/system/035-logs.bats27
-rw-r--r--test/system/250-systemd.bats23
2 files changed, 50 insertions, 0 deletions
diff --git a/test/system/035-logs.bats b/test/system/035-logs.bats
index 32282c8e1..a04d2ac74 100644
--- a/test/system/035-logs.bats
+++ b/test/system/035-logs.bats
@@ -174,4 +174,31 @@ $s_after"
_log_test_until journald
}
+function _log_test_follow() {
+ local driver=$1
+ cname=$(random_string)
+ contentA=$(random_string)
+ contentB=$(random_string)
+ contentC=$(random_string)
+
+ # Note: it seems we need at least three log lines to hit #11461.
+ run_podman run --log-driver=$driver --name $cname $IMAGE sh -c "echo $contentA; echo $contentB; echo $contentC"
+ run_podman logs -f $cname
+ is "$output" "$contentA
+$contentB
+$contentC" "logs -f on exitted container works"
+
+ run_podman rm -f $cname
+}
+
+@test "podman logs - --follow k8s-file" {
+ _log_test_follow k8s-file
+}
+
+@test "podman logs - --follow journald" {
+ # We can't use journald on RHEL as rootless: rhbz#1895105
+ skip_if_journald_unavailable
+
+ _log_test_follow journald
+}
# vim: filetype=sh
diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats
index 08fad5e7c..4578d9e60 100644
--- a/test/system/250-systemd.bats
+++ b/test/system/250-systemd.bats
@@ -136,6 +136,29 @@ function service_cleanup() {
service_cleanup
}
+# Regression test for #11438
+@test "podman generate systemd - restart policy" {
+ cname=$(random_string)
+ run_podman create --restart=always --name $cname $IMAGE
+ run_podman generate systemd --new $cname
+ is "$output" ".*Restart=always.*" "Use container's restart policy if set"
+ run_podman generate systemd --new --restart-policy=on-failure $cname
+ is "$output" ".*Restart=on-failure.*" "Override container's restart policy"
+
+ cname2=$(random_string)
+ run_podman create --restart=unless-stopped --name $cname2 $IMAGE
+ run_podman generate systemd --new $cname2
+ is "$output" ".*Restart=always.*" "unless-stopped translated to always"
+
+ cname3=$(random_string)
+ run_podman create --restart=on-failure:42 --name $cname3 $IMAGE
+ run_podman generate systemd --new $cname3
+ is "$output" ".*Restart=on-failure.*" "on-failure:xx is parsed correclty"
+ is "$output" ".*StartLimitBurst=42.*" "on-failure:xx is parsed correctly"
+
+ run_podman rm -f $cname $cname2 $cname3
+}
+
function set_listen_env() {
export LISTEN_PID="100" LISTEN_FDS="1" LISTEN_FDNAMES="listen_fdnames"
}