Esempio n. 1
0
// get a test driver for acceptance testing
func getTestDriverA(env string) (*OVTest, *OVClient) {
	// os.Setenv("DEBUG", "true")  // remove comment to debug logs
	var ot *OVTest
	var tc *testconfig.TestConfig
	ot = &OVTest{Tc: tc.NewTestConfig(), Env: env}
	ot.GetEnvironment(env)
	ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA"))
	ot.Client = &OVClient{
		rest.Client{
			User:     os.Getenv("ONEVIEW_OV_USER"),
			Password: os.Getenv("ONEVIEW_OV_PASSWORD"),
			Domain:   os.Getenv("ONEVIEW_OV_DOMAIN"),
			Endpoint: os.Getenv("ONEVIEW_OV_ENDPOINT"),
			// ConfigDir:
			SSLVerify: false,
			APIKey:    "none",
		},
	}
	err := ot.Client.RefreshVersion()
	if err != nil {
		log.Errorf("Problem with getting api version refreshed : %+v", err)
	}
	// fmt.Println("Setting up test with getTestDriverA")
	return ot, ot.Client
}
Esempio n. 2
0
// get a test driver for acceptance testing
func getTestDriverA(env string) (*I3STest, *i3s.I3SClient) {
	// os.Setenv("DEBUG", "true")  // remove comment to debug logs
	var ot *I3STest
	var tc *testconfig.TestConfig
	ot = &I3STest{Tc: tc.NewTestConfig(), Env: "dev"}
	ot.GetEnvironment(env)
	ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA"))
	ot.OVClient = &ov.OVClient{
		rest.Client{
			User:       os.Getenv("ONEVIEW_OV_USER"),
			Password:   os.Getenv("ONEVIEW_OV_PASSWORD"),
			Domain:     os.Getenv("ONEVIEW_OV_DOMAIN"),
			Endpoint:   os.Getenv("ONEVIEW_OV_ENDPOINT"),
			APIVersion: 300,
			// ConfigDir:
			SSLVerify: false,
			APIKey:    "none",
		},
	}
	ot.OVClient.RefreshLogin()
	ot.Client = ot.Client.NewI3SClient(os.Getenv("ONEVIEW_I3S_ENDPOINT"), ot.OVClient.SSLVerify, ot.OVClient.APIVersion, ot.OVClient.APIKey)

	// TODO: implement ot.Client.RefreshVersion()
	return ot, ot.Client
}
// get a test driver for acceptance testing
func (ot *OneViewTest) GetTestDriverA() (*OneViewTest, *ov.OVClient, *icsp.ICSPClient) {
	// os.Setenv("DEBUG", "true")  // remove comment to debug logs
	var tc *testconfig.TestConfig
	ot = &OneViewTest{Tc: tc.NewTestConfig(), Env: "dev"}
	ot.GetEnvironment()
	ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA"))
	ot.ICSPClient = &icsp.ICSPClient{
		rest.Client{
			User:     os.Getenv("ONEVIEW_ICSP_USER"),
			Password: os.Getenv("ONEVIEW_ICSP_PASSWORD"),
			Domain:   os.Getenv("ONEVIEW_ICSP_DOMAIN"),
			Endpoint: os.Getenv("ONEVIEW_ICSP_ENDPOINT"),
			// ConfigDir:
			SSLVerify: false,
			APIKey:    "none",
		},
	}
	ot.ICSPClient.RefreshVersion()

	ot.OVClient = &ov.OVClient{
		rest.Client{
			User:     os.Getenv("ONEVIEW_OV_USER"),
			Password: os.Getenv("ONEVIEW_OV_PASSWORD"),
			Domain:   os.Getenv("ONEVIEW_OV_DOMAIN"),
			Endpoint: os.Getenv("ONEVIEW_OV_ENDPOINT"),
			// ConfigDir:
			SSLVerify: false,
			APIKey:    "none",
		},
	}
	ot.OVClient.RefreshVersion()
	// fmt.Println("Setting up test with getTestDriverA")
	return ot, ot.OVClient, ot.ICSPClient
}
Esempio n. 4
0
// Unit test
func getTestDriverU(env string) (*I3STest, *i3s.I3SClient) {
	var ot *I3STest
	var tc *testconfig.TestConfig
	ot = &I3STest{Tc: tc.NewTestConfig(), Env: "dev"}
	ot.GetEnvironment(env)
	ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA"))
	ot.Client = &i3s.I3SClient{
		rest.Client{
			Endpoint:   "https://i3stestcase",
			SSLVerify:  false,
			APIVersion: 300,
			APIKey:     "none",
		},
	}
	return ot, ot.Client
}
Esempio n. 5
0
// Unit test
func getTestDriverU() (*I3STest, *I3SClient) {
	var ot *I3STest
	var tc *testconfig.TestConfig
	ot = &I3STest{Tc: tc.NewTestConfig(), Env: "dev"}
	ot.GetEnvironment()
	ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA"))
	ot.Client = &I3SClient{
		rest.Client{
			User:       "******",
			Password:   "******",
			Domain:     "LOCAL",
			Endpoint:   "https://i3stestcase",
			SSLVerify:  false,
			APIVersion: 300,
			APIKey:     "none",
		},
	}
	return ot, ot.Client
}
Esempio n. 6
0
// Unit test
func getTestDriverU() (*ICSPTest, *icsp.ICSPClient) {
	var ot *ICSPTest
	var tc *testconfig.TestConfig
	ot = &ICSPTest{Tc: tc.NewTestConfig(), Env: "dev"}
	ot.GetEnvironment()
	ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA"))
	ot.Client = &icsp.ICSPClient{
		rest.Client{
			User:       "******",
			Password:   "******",
			Domain:     "LOCAL",
			Endpoint:   "https://icsptestcase",
			SSLVerify:  false,
			APIVersion: 108,
			APIKey:     "none",
		},
	}
	// fmt.Println("Setting up test with getTestDriverU")
	return ot, ot.Client
}
Esempio n. 7
0
// Unit test
func getTestDriverU(env string) (*OVTest, *ov.OVClient) {
	var ot *OVTest
	var tc *testconfig.TestConfig
	ot = &OVTest{Tc: tc.NewTestConfig(), Env: env}
	ot.GetEnvironment(env)
	ot.Tc.GetTestingConfiguration(os.Getenv("ONEVIEW_TEST_DATA"))
	ot.Client = &ov.OVClient{
		rest.Client{
			User:       "******",
			Password:   "******",
			Domain:     "LOCAL",
			Endpoint:   "https://ovtestcase",
			SSLVerify:  false,
			APIVersion: 120,
			APIKey:     "none",
		},
	}
	// fmt.Println("Setting up test with getTestDriverU")
	return ot, ot.Client
}