Skip to content

Commit fc13486

Browse files
Addded Acceptance Tests
1 parent 09db8fe commit fc13486

7 files changed

+281
-0
lines changed

ibm/service/vpc/data_source_ibm_is_instance_profile_test.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,43 @@ func TestAccIBMISInstanceProfileDataSource_basic(t *testing.T) {
4646
},
4747
})
4848
}
49+
50+
func TestAccIBMISInstanceProfileDataSource_QoSMode(t *testing.T) {
51+
resName := "data.ibm_is_instance_profile.test1"
52+
53+
resource.Test(t, resource.TestCase{
54+
PreCheck: func() { acc.TestAccPreCheck(t) },
55+
Providers: acc.TestAccProviders,
56+
Steps: []resource.TestStep{
57+
{
58+
Config: testAccCheckIBMISInstanceProfileDataSourceConfig(),
59+
Check: resource.ComposeTestCheckFunc(
60+
resource.TestCheckResourceAttr(resName, "name", acc.InstanceProfileName),
61+
resource.TestCheckResourceAttrSet(resName, "family"),
62+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "bandwidth.#"),
63+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "family"),
64+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "href"),
65+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "memory.#"),
66+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "architecture"),
67+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "port_speed.#"),
68+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "vcpu_architecture.#"),
69+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "vcpu_count.#"),
70+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "vcpu_manufacturer.#"),
71+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "vcpu_manufacturer.0.type"),
72+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "vcpu_manufacturer.0.value"),
73+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "network_interface_count.0.type"),
74+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "network_attachment_count.0.type"),
75+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "network_attachment_count.#"),
76+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "reservation_terms.#"),
77+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "reservation_terms.0.type"),
78+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "reservation_terms.0.values"),
79+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profile.test1", "volume_bandwidth_qos_modes.#"),
80+
),
81+
},
82+
},
83+
})
84+
}
85+
4986
func TestAccIBMISInstanceProfileDataSource_cluster(t *testing.T) {
5087
resName := "data.ibm_is_instance_profile.test1"
5188

ibm/service/vpc/data_source_ibm_is_instance_profiles_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,44 @@ func TestAccIBMISInstanceProfilesDataSource_basic(t *testing.T) {
4747
},
4848
})
4949
}
50+
51+
func TestAccIBMISInstanceProfilesDataSource_QoS(t *testing.T) {
52+
resName := "data.ibm_is_instance_profiles.test1"
53+
54+
resource.Test(t, resource.TestCase{
55+
PreCheck: func() { acc.TestAccPreCheck(t) },
56+
Providers: acc.TestAccProviders,
57+
Steps: []resource.TestStep{
58+
{
59+
Config: testAccCheckIBMISInstanceProfilesDataSourceConfig(),
60+
Check: resource.ComposeTestCheckFunc(
61+
resource.TestCheckResourceAttrSet(resName, "profiles.0.name"),
62+
resource.TestCheckResourceAttrSet(resName, "profiles.0.family"),
63+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.bandwidth.#"),
64+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.family"),
65+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.href"),
66+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.memory.#"),
67+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.architecture"),
68+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.port_speed.#"),
69+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.vcpu_architecture.#"),
70+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.vcpu_count.#"),
71+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.network_interface_count.#"),
72+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.network_interface_count.0.type"),
73+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.network_attachment_count.#"),
74+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.network_attachment_count.0.type"),
75+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.vcpu_manufacturer.#"),
76+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.vcpu_manufacturer.0.type"),
77+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.vcpu_manufacturer.0.value"),
78+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.reservation_terms.#"),
79+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.reservation_terms.0.type"),
80+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.reservation_terms.0.values"),
81+
resource.TestCheckResourceAttrSet("data.ibm_is_instance_profiles.test1", "profiles.0.volume_bandwidth_qos_modes.#"),
82+
),
83+
},
84+
},
85+
})
86+
}
87+
5088
func TestAccIBMISInstanceProfilesDataSource_cluster(t *testing.T) {
5189
resName := "data.ibm_is_instance_profiles.test1"
5290

ibm/service/vpc/data_source_ibm_is_instance_template_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,36 @@ func TestAccIBMISInstanceTemplate_dataBasic(t *testing.T) {
4040
},
4141
})
4242
}
43+
44+
func TestAccIBMISInstanceTemplate_QoS(t *testing.T) {
45+
randInt := acctest.RandIntRange(600, 700)
46+
publicKey := strings.TrimSpace(`
47+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQ+WiiUR1Jg3oGSmB/2//GJ3XnotriBiGN6t3iwGces6sUsvRkza1t0Mf05DKZxC/zp0WvDTvbit2gTkF9sD37OZSn5aCJk1F5URk/JNPmz25ZogkICFL4OUfhrE3mnyKio6Bk1JIEIypR5PRtGxY9vFDUfruADDLfRi+dGwHF6U9RpvrDRo3FNtI8T0GwvWwFE7bg63vLz65CjYY5XqH9z/YWz/asH6BKumkwiphLGhuGn03+DV6DkIZqr3Oh13UDjMnTdgv1y/Kou5UM3CK1dVsmLRXPEf2KUWUq1EwRfrJXkPOrBwn8to+Yydo57FgrRM9Qw8uzvKmnVxfKW6iG3oSGA0L6ROuCq1lq0MD8ySLd56+d1ftSDaUq+0/Yt9vK3olzVP0/iZobD7chbGqTLMCzL4/CaIUR/UmX08EA0Oh0DdyAdj3UUNETAj3W8gBrV6xLR7fZAJ8roX2BKb4K8Ed3YqzgiY0zgjqvpBYl9xZl0jgVX0qMFaEa6+CeGI8= root@ffd8363b1226
48+
`)
49+
vpcName := fmt.Sprintf("testvpc%d", randInt)
50+
subnetName := fmt.Sprintf("testsubnet%d", randInt)
51+
templateName := fmt.Sprintf("testtemplate%d", randInt)
52+
sshKeyName := fmt.Sprintf("testsshkey%d", randInt)
53+
resource.Test(t, resource.TestCase{
54+
PreCheck: func() { acc.TestAccPreCheck(t) },
55+
Providers: acc.TestAccProviders,
56+
CheckDestroy: testAccCheckIBMISInstanceGroupDestroy,
57+
Steps: []resource.TestStep{
58+
{
59+
Config: testAccCheckIBMISInstanceTemplateDConfig(vpcName, subnetName, sshKeyName, publicKey, templateName),
60+
Check: resource.ComposeTestCheckFunc(
61+
resource.TestCheckResourceAttr(
62+
"data.ibm_is_instance_template.instance_template_data", "name", templateName),
63+
resource.TestCheckResourceAttrSet(
64+
"data.ibm_is_instance_template.instance_template_data", "availability_policy_host_failure"),
65+
resource.TestCheckResourceAttrSet(
66+
"data.ibm_is_instance_template.instance_template_data", "volume_bandwidth_qos_mode"),
67+
),
68+
},
69+
},
70+
})
71+
}
72+
4373
func TestAccIBMISInstanceTemplateDatasourceCluster(t *testing.T) {
4474
randInt := acctest.RandIntRange(600, 700)
4575
publicKey := strings.TrimSpace(`

ibm/service/vpc/data_source_ibm_is_instance_templates.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ func DataSourceIBMISInstanceTemplates() *schema.Resource {
275275
Computed: true,
276276
Description: "The amount of bandwidth (in megabits per second) allocated exclusively to instance storage volumes",
277277
},
278+
isInstanceVolumeBandwidthQoSMode: {
279+
Type: schema.TypeString,
280+
Computed: true,
281+
Description: "The volume bandwidth QoS mode for this virtual server instance.",
282+
},
278283
isInstanceDefaultTrustedProfileAutoLink: {
279284
Type: schema.TypeBool,
280285
Computed: true,
@@ -1090,6 +1095,9 @@ func dataSourceIBMISInstanceTemplatesRead(d *schema.ResourceData, meta interface
10901095
template[isInstanceTotalVolumeBandwidth] = int(*instance.TotalVolumeBandwidth)
10911096
}
10921097

1098+
if instance.VolumeBandwidthQosMode != nil {
1099+
template[isInstanceVolumeBandwidthQoSMode] = *instance.VolumeBandwidthQosMode
1100+
}
10931101
// vni
10941102

10951103
networkAttachments := []map[string]interface{}{}

ibm/service/vpc/data_source_ibm_is_instance_templates_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,36 @@ func TestAccIBMISInstanceTemplates_dataBasic(t *testing.T) {
4040
},
4141
})
4242
}
43+
44+
func TestAccIBMISInstanceTemplates_QoS(t *testing.T) {
45+
randInt := acctest.RandIntRange(600, 700)
46+
publicKey := strings.TrimSpace(`
47+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDQ+WiiUR1Jg3oGSmB/2//GJ3XnotriBiGN6t3iwGces6sUsvRkza1t0Mf05DKZxC/zp0WvDTvbit2gTkF9sD37OZSn5aCJk1F5URk/JNPmz25ZogkICFL4OUfhrE3mnyKio6Bk1JIEIypR5PRtGxY9vFDUfruADDLfRi+dGwHF6U9RpvrDRo3FNtI8T0GwvWwFE7bg63vLz65CjYY5XqH9z/YWz/asH6BKumkwiphLGhuGn03+DV6DkIZqr3Oh13UDjMnTdgv1y/Kou5UM3CK1dVsmLRXPEf2KUWUq1EwRfrJXkPOrBwn8to+Yydo57FgrRM9Qw8uzvKmnVxfKW6iG3oSGA0L6ROuCq1lq0MD8ySLd56+d1ftSDaUq+0/Yt9vK3olzVP0/iZobD7chbGqTLMCzL4/CaIUR/UmX08EA0Oh0DdyAdj3UUNETAj3W8gBrV6xLR7fZAJ8roX2BKb4K8Ed3YqzgiY0zgjqvpBYl9xZl0jgVX0qMFaEa6+CeGI8= root@ffd8363b1226
48+
`)
49+
vpcName := fmt.Sprintf("testvpc%d", randInt)
50+
subnetName := fmt.Sprintf("testsubnet%d", randInt)
51+
templateName := fmt.Sprintf("testtemplate%d", randInt)
52+
sshKeyName := fmt.Sprintf("testsshkey%d", randInt)
53+
resource.Test(t, resource.TestCase{
54+
PreCheck: func() { acc.TestAccPreCheck(t) },
55+
Providers: acc.TestAccProviders,
56+
CheckDestroy: testAccCheckIBMISInstanceGroupDestroy,
57+
Steps: []resource.TestStep{
58+
{
59+
Config: testAccCheckIBMISInstanceTemplatesDConfig(vpcName, subnetName, sshKeyName, publicKey, templateName),
60+
Check: resource.ComposeTestCheckFunc(
61+
resource.TestCheckResourceAttrSet(
62+
"data.ibm_is_instance_templates.instance_templates_data", "templates.0.id"),
63+
resource.TestCheckResourceAttrSet(
64+
"data.ibm_is_instance_templates.instance_templates_data", "templates.0.name"),
65+
resource.TestCheckResourceAttrSet(
66+
"data.ibm_is_instance_templates.instance_templates_data", "templates.0.volume_bandwidth_qos_mode"),
67+
),
68+
},
69+
},
70+
})
71+
}
72+
4373
func TestAccIBMISInstanceTemplatesDataSourceCluster(t *testing.T) {
4474
randInt := acctest.RandIntRange(600, 700)
4575
publicKey := strings.TrimSpace(`

ibm/service/vpc/data_source_ibm_is_instances_test.go

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,58 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
6363
},
6464
})
6565
}
66+
67+
func TestAccIBMISInstancesDataSource_QoSMode(t *testing.T) {
68+
var instance string
69+
vpcname := fmt.Sprintf("tfins-vpc-%d", acctest.RandIntRange(10, 100))
70+
subnetname := fmt.Sprintf("tfins-subnet-%d", acctest.RandIntRange(10, 100))
71+
publicKey := strings.TrimSpace(`
72+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR
73+
`)
74+
sshname := fmt.Sprintf("tfins-ssh-%d", acctest.RandIntRange(10, 100))
75+
instanceName := fmt.Sprintf("tfins-name-%d", acctest.RandIntRange(10, 100))
76+
resName := "data.ibm_is_instances.ds_instances"
77+
userData := "a"
78+
resource.Test(t, resource.TestCase{
79+
PreCheck: func() { acc.TestAccPreCheck(t) },
80+
Providers: acc.TestAccProviders,
81+
Steps: []resource.TestStep{
82+
{
83+
Config: testAccCheckIBMISInstanceConfig(vpcname, subnetname, sshname, publicKey, instanceName, userData),
84+
Check: resource.ComposeTestCheckFunc(
85+
testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance),
86+
resource.TestCheckResourceAttr(
87+
"ibm_is_instance.testacc_instance", "name", instanceName),
88+
resource.TestCheckResourceAttr(
89+
"ibm_is_instance.testacc_instance", "zone", acc.ISZoneName),
90+
),
91+
},
92+
{
93+
Config: testAccCheckIBMISInstancesDataSourceConfig(),
94+
Check: resource.ComposeTestCheckFunc(
95+
resource.TestCheckResourceAttrSet(resName, "instances.0.name"),
96+
resource.TestCheckResourceAttrSet(resName, "instances.0.memory"),
97+
resource.TestCheckResourceAttrSet(resName, "instances.0.status"),
98+
resource.TestCheckResourceAttrSet(resName, "instances.0.resource_group"),
99+
resource.TestCheckResourceAttrSet(resName, "instances.0.vpc"),
100+
resource.TestCheckResourceAttrSet(resName, "instances.0.boot_volume.#"),
101+
resource.TestCheckResourceAttrSet(resName, "instances.0.volume_attachments.#"),
102+
resource.TestCheckResourceAttrSet(resName, "instances.0.primary_network_interface.#"),
103+
resource.TestCheckResourceAttrSet(resName, "instances.0.network_interfaces.#"),
104+
resource.TestCheckResourceAttrSet(resName, "instances.0.profile"),
105+
resource.TestCheckResourceAttrSet(resName, "instances.0.vcpu.#"),
106+
resource.TestCheckResourceAttrSet(resName, "instances.0.zone"),
107+
resource.TestCheckResourceAttrSet(resName, "instances.0.availability_policy_host_failure"),
108+
resource.TestCheckResourceAttrSet(resName, "instances.0.lifecycle_state"),
109+
resource.TestCheckResourceAttr(resName, "instances.0.lifecycle_reasons.#", "0"),
110+
resource.TestCheckResourceAttrSet(resName, "instances.0.vcpu.0.manufacturer"),
111+
resource.TestCheckResourceAttrSet(resName, "instances.0.volume_bandwidth_qos_mode"),
112+
),
113+
},
114+
},
115+
})
116+
}
117+
66118
func TestAccIBMISInstancesDS_basicCluster(t *testing.T) {
67119
// var instance string
68120
// vpcname := fmt.Sprintf("tfins-vpc-%d", acctest.RandIntRange(10, 100))

ibm/service/vpc/resource_ibm_is_instance_test.go

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,55 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
775775
})
776776
}
777777

778+
func TestAccIBMISInstance_QoS(t *testing.T) {
779+
var instance string
780+
vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100))
781+
name := fmt.Sprintf("tf-instnace-%d", acctest.RandIntRange(10, 100))
782+
subnetname := fmt.Sprintf("tf-subnet-%d", acctest.RandIntRange(10, 100))
783+
publicKey := strings.TrimSpace(`
784+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR
785+
`)
786+
sshname := fmt.Sprintf("tf-ssh-%d", acctest.RandIntRange(10, 100))
787+
totalVolumeBandwidth := 1000
788+
qosMode := "pooled"
789+
qosModeUpdated := "weighted"
790+
resource.Test(t, resource.TestCase{
791+
PreCheck: func() { acc.TestAccPreCheck(t) },
792+
Providers: acc.TestAccProviders,
793+
CheckDestroy: testAccCheckIBMISInstanceDestroy,
794+
Steps: []resource.TestStep{
795+
{
796+
Config: testAccCheckIBMISInstanceQOSConfig(vpcname, subnetname, sshname, publicKey, name, qosMode, totalVolumeBandwidth),
797+
Check: resource.ComposeTestCheckFunc(
798+
testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance),
799+
resource.TestCheckResourceAttr(
800+
"ibm_is_instance.testacc_instance", "name", name),
801+
resource.TestCheckResourceAttr(
802+
"ibm_is_instance.testacc_instance", "zone", acc.ISZoneName),
803+
resource.TestCheckResourceAttr(
804+
"ibm_is_instance.testacc_instance", "total_volume_bandwidth", strconv.Itoa(totalVolumeBandwidth)),
805+
resource.TestCheckResourceAttr(
806+
"ibm_is_instance.testacc_instance", "volume_bandwidth_qos_mode", qosMode),
807+
),
808+
},
809+
{
810+
Config: testAccCheckIBMISInstanceQOSConfig(vpcname, subnetname, sshname, publicKey, name, qosModeUpdated, totalVolumeBandwidth),
811+
Check: resource.ComposeTestCheckFunc(
812+
testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance),
813+
resource.TestCheckResourceAttr(
814+
"ibm_is_instance.testacc_instance", "name", name),
815+
resource.TestCheckResourceAttr(
816+
"ibm_is_instance.testacc_instance", "zone", acc.ISZoneName),
817+
resource.TestCheckResourceAttr(
818+
"ibm_is_instance.testacc_instance", "total_volume_bandwidth", strconv.Itoa(totalVolumeBandwidth)),
819+
resource.TestCheckResourceAttr(
820+
"ibm_is_instance.testacc_instance", "volume_bandwidth_qos_mode", qosModeUpdated),
821+
),
822+
},
823+
},
824+
})
825+
}
826+
778827
func TestAccIBMISInstanceWithSecurityGroup_basic(t *testing.T) {
779828
var instance string
780829
vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100))
@@ -1985,6 +2034,43 @@ func testAccCheckIBMISInstanceRenameConfig(vpcname, subnetname, sshname, publicK
19852034
`, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, sshname, publicKey, name, acc.IsImage, acc.InstanceProfileName, rename, userData, acc.ISZoneName)
19862035
}
19872036

2037+
func testAccCheckIBMISInstanceQOSConfig(vpcname, subnetname, sshname, publicKey, name, qosMode string, bandwidth int) string {
2038+
return fmt.Sprintf(`
2039+
resource "ibm_is_vpc" "testacc_vpc" {
2040+
name = "%s"
2041+
}
2042+
2043+
resource "ibm_is_subnet" "testacc_subnet" {
2044+
name = "%s"
2045+
vpc = ibm_is_vpc.testacc_vpc.id
2046+
zone = "%s"
2047+
ipv4_cidr_block = "%s"
2048+
}
2049+
2050+
resource "ibm_is_ssh_key" "testacc_sshkey" {
2051+
name = "%s"
2052+
public_key = "%s"
2053+
}
2054+
2055+
resource "ibm_is_instance" "testacc_instance" {
2056+
name = "%s"
2057+
image = "%s"
2058+
profile = "%s"
2059+
primary_network_interface {
2060+
subnet = ibm_is_subnet.testacc_subnet.id
2061+
}
2062+
total_volume_bandwidth = %d
2063+
vpc = ibm_is_vpc.testacc_vpc.id
2064+
zone = "%s"
2065+
keys = [ibm_is_ssh_key.testacc_sshkey.id]
2066+
network_interfaces {
2067+
subnet = ibm_is_subnet.testacc_subnet.id
2068+
name = "eth1"
2069+
}
2070+
volume_bandwidth_qos_mode = "%s"
2071+
}`, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, sshname, publicKey, name, acc.IsImage, acc.InstanceProfileName, bandwidth, acc.ISZoneName, qosMode)
2072+
}
2073+
19882074
func testAccCheckIBMISInstanceBandwidthConfig(vpcname, subnetname, sshname, publicKey, name string, bandwidth int) string {
19892075
return fmt.Sprintf(`
19902076
resource "ibm_is_vpc" "testacc_vpc" {

0 commit comments

Comments
 (0)