add test

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
add hostname generation with --net=host

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Merge pull request #6391 from vieux/fix_hostname_file_net_host

fix hostname generation with --net=host