-d1f90c9b77baca5c33a398ab844fb4440c6a5ee7
+97eb3f61cf1c2cc01b9db6ed20e39bc04573c207
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
}
}
-func runBinHostname(t *testing.T) string {
+func runBinHostname(t *testing.T, argv []string) string {
// Run /bin/hostname and collect output.
r, w, err := Pipe()
if err != nil {
}
defer r.Close()
const path = "/bin/hostname"
- p, err := StartProcess(path, []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}})
+ p, err := StartProcess(path, argv, &ProcAttr{Files: []*File{nil, w, Stderr}})
if err != nil {
if _, err := Stat(path); IsNotExist(err) {
t.Skipf("skipping test; test requires %s but it does not exist", path)
if err != nil {
t.Fatalf("%v", err)
}
- want := runBinHostname(t)
+
+ var want string
+ if runtime.GOOS == "aix" {
+ want = runBinHostname(t, []string{"hostname", "-s"})
+ } else {
+ want = runBinHostname(t, []string{"hostname"})
+ }
if hostname != want {
i := strings.Index(hostname, ".")
if i < 0 || hostname[0:i] != want {