Пример #1
0
// sessionInit is a small help function used to quickly establish a session for
// the unit tests.
func sessionInit() (s *splunk.Session) {
	s, err := splunk.NewSession(testHost, testPort, testUsername, testPassword)
	if err != nil {
		fmt.Println("Authentication error. Stopping all unit tests")
		os.Exit(-1)
	}

	return s
}
Пример #2
0
func TestNewSession(t *testing.T) {
	_, err := splunk.NewSession(testHost, testPort, testUsername, testPassword)
	if err != nil {
		t.Error(err)
	}
}