mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
Merge pull request #19276 from edsantiago/quadlet_no_journal
systests: quadlet: fixes for RHEL8
This commit is contained in:
@ -16,7 +16,7 @@ function start_time() {
|
|||||||
function setup() {
|
function setup() {
|
||||||
skip_if_remote "quadlet tests are meaningless over remote"
|
skip_if_remote "quadlet tests are meaningless over remote"
|
||||||
skip_if_rootless_cgroupsv1 "Can't use --cgroups=split w/ CGv1 (issue 17456, wontfix)"
|
skip_if_rootless_cgroupsv1 "Can't use --cgroups=split w/ CGv1 (issue 17456, wontfix)"
|
||||||
skip_if_journald_unavailable "quadlet isn't really usable without journal"
|
skip_if_journald_unavailable "Needed for RHEL. FIXME: we might be able to reenable a subset of tests."
|
||||||
|
|
||||||
test -x "$QUADLET" || die "Cannot run quadlet tests without executable \$QUADLET ($QUADLET)"
|
test -x "$QUADLET" || die "Cannot run quadlet tests without executable \$QUADLET ($QUADLET)"
|
||||||
|
|
||||||
@ -640,16 +640,14 @@ EOF
|
|||||||
cat > $quadlet_file <<EOF
|
cat > $quadlet_file <<EOF
|
||||||
[Container]
|
[Container]
|
||||||
Rootfs=/:O
|
Rootfs=/:O
|
||||||
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; top"
|
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; top -b"
|
||||||
Notify=yes
|
Notify=yes
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
run_quadlet "$quadlet_file"
|
run_quadlet "$quadlet_file"
|
||||||
service_setup $QUADLET_SERVICE_NAME
|
service_setup $QUADLET_SERVICE_NAME
|
||||||
|
|
||||||
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
wait_for_output "STARTED CONTAINER" $QUADLET_CONTAINER_NAME
|
||||||
run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME"
|
|
||||||
is "$output" '.*STARTED CONTAINER.*'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "quadlet - selinux disable" {
|
@test "quadlet - selinux disable" {
|
||||||
@ -659,15 +657,14 @@ EOF
|
|||||||
[Container]
|
[Container]
|
||||||
Image=$IMAGE
|
Image=$IMAGE
|
||||||
SecurityLabelDisable=true
|
SecurityLabelDisable=true
|
||||||
Exec=sh -c "echo STARTED CONTAINER; top"
|
Exec=sh -c "echo STARTED CONTAINER; top -b"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
run_quadlet "$quadlet_file"
|
run_quadlet "$quadlet_file"
|
||||||
service_setup $QUADLET_SERVICE_NAME
|
service_setup $QUADLET_SERVICE_NAME
|
||||||
|
|
||||||
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
||||||
run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME"
|
wait_for_output "STARTED CONTAINER" $QUADLET_CONTAINER_NAME
|
||||||
is "$output" '.*STARTED CONTAINER.*'
|
|
||||||
|
|
||||||
run_podman container inspect --format "{{.ProcessLabel}}" $QUADLET_CONTAINER_NAME
|
run_podman container inspect --format "{{.ProcessLabel}}" $QUADLET_CONTAINER_NAME
|
||||||
is "$output" "" "container should be started without specifying a Process Label"
|
is "$output" "" "container should be started without specifying a Process Label"
|
||||||
@ -686,15 +683,14 @@ Image=$IMAGE
|
|||||||
SecurityLabelType=spc_t
|
SecurityLabelType=spc_t
|
||||||
SecurityLabelLevel=s0:c100,c200
|
SecurityLabelLevel=s0:c100,c200
|
||||||
SecurityLabelFileType=container_ro_file_t
|
SecurityLabelFileType=container_ro_file_t
|
||||||
Exec=sh -c "echo STARTED CONTAINER; top"
|
Exec=sh -c "echo STARTED CONTAINER; top -b"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
run_quadlet "$quadlet_file"
|
run_quadlet "$quadlet_file"
|
||||||
service_setup $QUADLET_SERVICE_NAME
|
service_setup $QUADLET_SERVICE_NAME
|
||||||
|
|
||||||
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
||||||
run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME"
|
wait_for_output "STARTED CONTAINER" $NAME
|
||||||
is "$output" '.*STARTED CONTAINER.*'
|
|
||||||
|
|
||||||
run_podman container ps
|
run_podman container ps
|
||||||
run_podman container inspect --format "{{.ProcessLabel}}" $NAME
|
run_podman container inspect --format "{{.ProcessLabel}}" $NAME
|
||||||
@ -714,7 +710,7 @@ EOF
|
|||||||
ContainerName=$NAME
|
ContainerName=$NAME
|
||||||
Image=$IMAGE
|
Image=$IMAGE
|
||||||
Secret=$SECRET_NAME,type=env,target=MYSECRET
|
Secret=$SECRET_NAME,type=env,target=MYSECRET
|
||||||
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; top"
|
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; top -b"
|
||||||
Notify=yes
|
Notify=yes
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@ -722,8 +718,7 @@ EOF
|
|||||||
service_setup $QUADLET_SERVICE_NAME
|
service_setup $QUADLET_SERVICE_NAME
|
||||||
|
|
||||||
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
||||||
run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME"
|
wait_for_output "STARTED CONTAINER" $QUADLET_CONTAINER_NAME
|
||||||
is "$output" '.*STARTED CONTAINER.*'
|
|
||||||
|
|
||||||
run_podman exec $QUADLET_CONTAINER_NAME /bin/sh -c "printenv MYSECRET"
|
run_podman exec $QUADLET_CONTAINER_NAME /bin/sh -c "printenv MYSECRET"
|
||||||
is "$output" $SECRET
|
is "$output" $SECRET
|
||||||
@ -741,7 +736,7 @@ EOF
|
|||||||
ContainerName=$NAME
|
ContainerName=$NAME
|
||||||
Image=$IMAGE
|
Image=$IMAGE
|
||||||
Secret=$SECRET_NAME,type=mount,target=/root/secret
|
Secret=$SECRET_NAME,type=mount,target=/root/secret
|
||||||
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; top"
|
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; top -b"
|
||||||
Notify=yes
|
Notify=yes
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@ -749,8 +744,7 @@ EOF
|
|||||||
service_setup $QUADLET_SERVICE_NAME
|
service_setup $QUADLET_SERVICE_NAME
|
||||||
|
|
||||||
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
# Ensure we have output. Output is synced via sd-notify (socat in Exec)
|
||||||
run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME"
|
wait_for_output "STARTED CONTAINER" $QUADLET_CONTAINER_NAME
|
||||||
is "$output" '.*STARTED CONTAINER.*'
|
|
||||||
|
|
||||||
run_podman exec $QUADLET_CONTAINER_NAME /bin/sh -c "cat /root/secret"
|
run_podman exec $QUADLET_CONTAINER_NAME /bin/sh -c "cat /root/secret"
|
||||||
is "$output" $SECRET
|
is "$output" $SECRET
|
||||||
|
Reference in New Issue
Block a user