|
|
@@ -83,6 +83,34 @@ func TestProcessDescribePriceAndCreateAlibabaPricing(t *testing.T) {
|
|
|
teststruct interface{}
|
|
|
expectedError error
|
|
|
}{
|
|
|
+ {
|
|
|
+ name: "test General Purpose Type g7 instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.g7.4xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "16777216KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-01a",
|
|
|
+ InstanceTypeFamily: "g7",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test General Purpose Type g7a instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.g7a.8xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "33554432KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-01b",
|
|
|
+ InstanceTypeFamily: "g7a",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
{
|
|
|
name: "test Enhanced General Purpose Type g6e instance family",
|
|
|
teststruct: &SlimK8sNode{
|
|
|
@@ -153,6 +181,174 @@ func TestProcessDescribePriceAndCreateAlibabaPricing(t *testing.T) {
|
|
|
},
|
|
|
expectedError: nil,
|
|
|
},
|
|
|
+ {
|
|
|
+ name: "test Memory Optmized instance type r7 instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.r7.6xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "2013265592KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-06",
|
|
|
+ InstanceTypeFamily: "r7",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Memory Optmized instance type r7a instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.r7a.8xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "33554432KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-06a",
|
|
|
+ InstanceTypeFamily: "r7a",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Enhanced Memory Optmized instance type r6e instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.r6e.4xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "2013265592KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-07",
|
|
|
+ InstanceTypeFamily: "r6e",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Memory Optmized instance type r6a instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.r6a.8xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "33554432KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-07a",
|
|
|
+ InstanceTypeFamily: "r6a",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Memory Optmized instance type r6 instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.r6.8xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "33554432KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-08",
|
|
|
+ InstanceTypeFamily: "r6",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Memory type instance and r5 instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.r5.xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "33554432KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-09",
|
|
|
+ InstanceTypeFamily: "r5",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Memory Optmized instance type with se1 instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.se1.4xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "16777216KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-10",
|
|
|
+ InstanceTypeFamily: "se1",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Memory Optmized instance type with Enhanced Network Performance se1ne instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.se1ne.3xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "100663296KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-11",
|
|
|
+ InstanceTypeFamily: "se1ne",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test High Memory type with re6 instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.re6.8xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "33554432KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-12",
|
|
|
+ InstanceTypeFamily: "re6",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Persistent Memory Optimized type with re6p instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.re6p.4xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "33554432KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-13",
|
|
|
+ InstanceTypeFamily: "re6p",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Memory type with re4 instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.re4.10xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "41943040KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-14",
|
|
|
+ InstanceTypeFamily: "re4",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "test Memory optimized type with se1 instance family",
|
|
|
+ teststruct: &SlimK8sNode{
|
|
|
+ InstanceType: "ecs.se1.8xlarge",
|
|
|
+ RegionID: "cn-hangzhou",
|
|
|
+ PriceUnit: "Hour",
|
|
|
+ MemorySizeInKiB: "33554432KiB",
|
|
|
+ IsIoOptimized: true,
|
|
|
+ OSType: "Linux",
|
|
|
+ ProviderID: "cn-hangzhou.i-test-15",
|
|
|
+ InstanceTypeFamily: "se1",
|
|
|
+ },
|
|
|
+ expectedError: nil,
|
|
|
+ },
|
|
|
{
|
|
|
name: "test for a nil information",
|
|
|
teststruct: nil,
|