| 1 |
package ecs |
| 2 |
|
| 3 |
import ( |
| 4 |
"os" |
| 5 |
|
| 6 |
"github.com/denverdino/aliyungo/common" |
| 7 |
) |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
var ( |
| 12 |
TestAccessKeyId = os.Getenv("AccessKeyId") |
| 13 |
TestAccessKeySecret = os.Getenv("AccessKeySecret") |
| 14 |
TestSecurityToken = os.Getenv("SecurityToken") |
| 15 |
TestRegionID = common.Region(os.Getenv("RegionId")) |
| 16 |
TestVpcId = os.Getenv("VpcId") |
| 17 |
|
| 18 |
TestInstanceId = os.Getenv("InstanceId") |
| 19 |
TestSecurityGroupId = "MY_TEST_SECURITY_GROUP_ID" |
| 20 |
TestImageId = "MY_IMAGE_ID" |
| 21 |
TestAccountId = "MY_TEST_ACCOUNT_ID" |
| 22 |
TestInstanceType = "ecs.n4.large" |
| 23 |
TestVSwitchID = "MY_TEST_VSWITCHID" |
| 24 |
|
| 25 |
TestIAmRich = false |
| 26 |
TestQuick = false |
| 27 |
) |
| 28 |
|
| 29 |
var testClient *Client |
| 30 |
|
| 31 |
func NewTestClient() *Client { |
| 32 |
if testClient == nil { |
| 33 |
testClient = NewClient(TestAccessKeyId, TestAccessKeySecret) |
| 34 |
} |
| 35 |
return testClient |
| 36 |
} |
| 37 |
|
| 38 |
var testDebugClient *Client |
| 39 |
|
| 40 |
func NewTestClientForDebug() *Client { |
| 41 |
if testDebugClient == nil { |
| 42 |
testDebugClient = NewClient(TestAccessKeyId, TestAccessKeySecret) |
| 43 |
testDebugClient.SetDebug(true) |
| 44 |
} |
| 45 |
return testDebugClient |
| 46 |
} |
| 47 |
|
| 48 |
var testVpcDebugClient *Client |
| 49 |
|
| 50 |
func NewVpcTestClientForDebug() *Client { |
| 51 |
if testVpcDebugClient == nil { |
| 52 |
testVpcDebugClient = NewVPCClient(TestAccessKeyId, TestAccessKeySecret, TestRegionID) |
| 53 |
testVpcDebugClient.SetDebug(true) |
| 54 |
} |
| 55 |
return testVpcDebugClient |
| 56 |
} |
| 57 |
|
| 58 |
var testLocationClient *Client |
| 59 |
|
| 60 |
func NetTestLocationClientForDebug() *Client { |
| 61 |
if testLocationClient == nil { |
| 62 |
testLocationClient = NewECSClient(TestAccessKeyId, TestAccessKeySecret, TestRegionID) |
| 63 |
testLocationClient.SetDebug(true) |
| 64 |
} |
| 65 |
|
| 66 |
return testLocationClient |
| 67 |
} |