Added test for issue #39

master
Chris Bednarski 4 years ago
parent ebbdf23b34
commit 0e15ef497a

@ -1,6 +1,8 @@
package main
import (
"os"
"path/filepath"
"testing"
)
@ -24,3 +26,13 @@ func TestStrPadRight(t *testing.T) {
}
}
}
func TestLoadHostfile(t *testing.T) {
// Issue #39: This hosts file contains a duplicate. We should paper over it.
os.Setenv("HOSTESS_PATH", filepath.Join("testdata", "issue39"))
defer os.Unsetenv("HOSTESS_PATH")
if _, err := LoadHostfile(); err != nil {
t.Fatal(err)
}
}

6
testdata/issue39 vendored

@ -0,0 +1,6 @@
127.0.0.1 localhost kubernetes.docker.internal
::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
Loading…
Cancel
Save