diff options
author | Boaz Shuster <boaz.shuster.github@gmail.com> | 2021-07-29 08:18:58 +0300 |
---|---|---|
committer | Boaz Shuster <boaz.shuster.github@gmail.com> | 2021-10-22 04:19:18 +0300 |
commit | ece0c7e5d31a6ae97274a7db80dbabb7564fdc72 (patch) | |
tree | d6096edfebd2733238c34f8d5946586c5d7499b6 /test | |
parent | c09fab59ddc6964e1c6afc31fa5f1b04c57a2b8c (diff) | |
download | podman-ece0c7e5d31a6ae97274a7db80dbabb7564fdc72.tar.gz podman-ece0c7e5d31a6ae97274a7db80dbabb7564fdc72.tar.bz2 podman-ece0c7e5d31a6ae97274a7db80dbabb7564fdc72.zip |
Support template unit files in podman generate systemd
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/system/250-systemd.bats | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/system/250-systemd.bats b/test/system/250-systemd.bats index 98241c309..d4fb7ab08 100644 --- a/test/system/250-systemd.bats +++ b/test/system/250-systemd.bats @@ -201,4 +201,33 @@ LISTEN_FDNAMES=listen_fdnames" "LISTEN Environment passed: $context" check_listen_env "$stdenv" "podman start" } +@test "podman generate - systemd template" { + cname=$(random_string) + run_podman run -dt --name $cname $IMAGE top + + run_podman generate systemd --template -n $cname + is "$output" ".*%I.*" "%I indentifiers in template" + is "$output" ".*%i.*" "%i indentifiers in template" +} + +@test "podman generate - systemd template no support for pod" { + cname=$(random_string) + podname=$(random_string) + run_podman pod create --name $podname + run_podman run --pod $podname -dt --name $cname $IMAGE top + + run_podman 125 generate systemd --new --template -n $podname + is "$output" ".*--template is not supported for pods.*" "Error message contains 'not supported'" + + run_podman rm -f $cname + run_podman pod rm -f $podname +} + +@test "podman generate - systemd template only used on --new" { + cname=$(random_string) + run_podman create --name $cname $IMAGE top + run_podman 125 generate systemd --new=false --template -n $cname + is "$output" ".*--template cannot be set" "Error message should be '--template requires --new'" +} + # vim: filetype=sh |