os: in test, allow Hostname to return FQDN even if /bin/hostname does not
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
http://codereview.appspot.com/181097

Committer: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>

dsriram/golang,h8liu/golang,gnanderson/go,pombredanne/go-deleteme,pombredanne/go-deleteme,nightlyone/golang,dsriram/golang,bdwalton/debian-golang,tv42/old-go,bdwalton/debian-golang,bdwalton/debian-golang,gnanderson/go,h8liu/golang,gnanderson/go,gnanderson/go,gnanderson/go,h8liu/golang,h8liu/golang,nightlyone/golang,dsriram/golang,pombredanne/go-deleteme,apparentlymart/golang,ssrl/go,nightlyone/golang,ssrl/go,tianon/debian-golang,ssrl/go,tv42/old-go,gnanderson/go,pombredanne/go-deleteme,h8liu/golang,tv42/old-go,apparentlymart/golang,tv42/old-go,gnanderson/go,apparentlymart/golang,bdwalton/debian-golang,nightlyone/golang,tv42/old-go,tv42/old-go,tianon/debian-golang,bdwalton/debian-golang,nightlyone/golang,tianon/debian-golang,ssrl/go,tianon/debian-golang,ssrl/go,dsriram/golang,dsriram/golang,pombredanne/go-deleteme,dsriram/golang,bdwalton/debian-golang,dsriram/golang,h8liu/golang,ssrl/go,apparentlymart/golang,h8liu/golang,bdwalton/debian-golang,nightlyone/golang,tianon/debian-golang,apparentlymart/golang,nightlyone/golang,tv42/old-go,tianon/debian-golang,tianon/debian-golang,pombredanne/go-deleteme,apparentlymart/golang,apparentlymart/golang,pombredanne/go-deleteme,ssrl/go,tianon/debian-golang,bdwalton/debian-golang