本文整理匯總了Golang中github.com/HewlettPackard/oneview-golang/testconfig.TestConfig類的典型用法代碼示例。如果您正苦於以下問題:Golang TestConfig類的具體用法?Golang TestConfig怎麽用?Golang TestConfig使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了TestConfig類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getTestDriverA
// 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
}
示例2: getTestDriverA
// 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
}
示例3: GetTestDriverA
// 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
}
示例4: getTestDriverU
// 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
}
示例5: getTestDriverU
// 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: "foo",
Password: "bar",
Domain: "LOCAL",
Endpoint: "https://i3stestcase",
SSLVerify: false,
APIVersion: 300,
APIKey: "none",
},
}
return ot, ot.Client
}
示例6: getTestDriverU
// 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: "foo",
Password: "bar",
Domain: "LOCAL",
Endpoint: "https://icsptestcase",
SSLVerify: false,
APIVersion: 108,
APIKey: "none",
},
}
// fmt.Println("Setting up test with getTestDriverU")
return ot, ot.Client
}
示例7: getTestDriverU
// 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: "foo",
Password: "bar",
Domain: "LOCAL",
Endpoint: "https://ovtestcase",
SSLVerify: false,
APIVersion: 120,
APIKey: "none",
},
}
// fmt.Println("Setting up test with getTestDriverU")
return ot, ot.Client
}