]> Cypherpunks repositories - gostls13.git/commit
os: in test, allow Hostname to return FQDN even if /bin/hostname does not
authorIcarus Sparry <golang@icarus.freeuk.com>
Tue, 26 Jan 2010 21:16:03 +0000 (13:16 -0800)
committerRuss Cox <rsc@golang.org>
Tue, 26 Jan 2010 21:16:03 +0000 (13:16 -0800)
commit090e71e7fd122a176f65a08189ac2324f073d826
tree24794ceee2941dc966f70c307667729b7d44ee26
parent7c1841fb2a5668ce560a8f0ff1253bfb2e70def7
os: in test, allow Hostname to return FQDN even if /bin/hostname does not

Hostname reads the file /proc/sys/kernel/hostname to determine
the value it returns. Some people set this to a Fully Qualified
Doamin Name. At least one implementation of /bin/hostname
truncates the name it gets (often from the "uname" system call)
at the first dot unless it is given a "-f" flag. This change makes
the unit test also truncate at the first dot and checks if the strings
then match. This seems more portable than adding an extra flag
to the called /bin/hostname program.

R=rsc
CC=golang-dev
https://golang.org/cl/181097
src/pkg/os/os_test.go