Merge pull request #20545 from giuseppe/fix-hostname-with-host-uts

libpod: fix /etc/hostname with --uts=host
This commit is contained in:
openshift-ci[bot]
2023-10-31 14:05:52 +00:00
committed by GitHub
2 changed files with 28 additions and 0 deletions

View File

@@ -911,4 +911,15 @@ EOF
run_podman network rm $net1
}
# Issue #20448 - /etc/hostname with --uts=host must show "uname -n"
@test "podman --uts=host must use 'uname -n' for /etc/hostname" {
run_podman info --format '{{.Host.Hostname}}'
hostname="$output"
run_podman run --rm --uts=host $IMAGE cat /etc/hostname
assert "$output" = $hostname "/etc/hostname with --uts=host must be equal to 'uname -n'"
run_podman run --rm --net=host --uts=host $IMAGE cat /etc/hostname
assert "$output" = $hostname "/etc/hostname with --uts=host --net=host must be equal to 'uname -n'"
}
# vim: filetype=sh