From 5c3e4cfa62452b9cd5c2c08bf081ab524ded1cb4 Mon Sep 17 00:00:00 2001 From: baude Date: Sat, 20 Jan 2018 11:07:35 -0600 Subject: Override hostname for container Adds the ability to override the container's hostname. Also, uses the first twelve characters of the container ID as the default hostname if none is provided. Signed-off-by: baude Closes: #248 Approved by: baude --- test/podman_run_dns.bats | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/podman_run_dns.bats b/test/podman_run_dns.bats index bdb99dedd..d37737093 100644 --- a/test/podman_run_dns.bats +++ b/test/podman_run_dns.bats @@ -45,3 +45,12 @@ function setup() { echo "$output" [ "$status" -eq 0 ] } + +@test "test addition of hostname" { + run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run --rm --hostname='foobar' ${ALPINE} cat /etc/hostname | grep foobar" + echo "$output" + [ "$status" -eq 0 ] + run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run --rm --hostname='foobar' ${ALPINE} hostname | grep foobar" + echo "$output" + [ "$status" -eq 0 ] +} -- cgit v1.2.3-54-g00ecf