@@ -537,7 +537,7 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
537537 resource .TestCheckResourceAttr (
538538 "ibm_is_bare_metal_server.testacc_bms" , "name" , name ),
539539 resource .TestCheckResourceAttr (
540- "ibm_is_bare_metal_server.testacc_bms" , "zone" , acc .ISZoneName ),
540+ "ibm_is_bare_metal_server.testacc_bms" , "zone" , acc .ISZoneName2 ),
541541 resource .TestCheckResourceAttr (
542542 "ibm_is_bare_metal_server.testacc_bms" , "metadata_service.0.enabled" , "true" ),
543543 resource .TestCheckResourceAttr (
@@ -551,7 +551,7 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
551551 resource .TestCheckResourceAttr (
552552 "ibm_is_bare_metal_server.testacc_bms" , "name" , name ),
553553 resource .TestCheckResourceAttr (
554- "ibm_is_bare_metal_server.testacc_bms" , "zone" , acc .ISZoneName ),
554+ "ibm_is_bare_metal_server.testacc_bms" , "zone" , acc .ISZoneName2 ),
555555 resource .TestCheckResourceAttr (
556556 "ibm_is_bare_metal_server.testacc_bms" , "metadata_service.0.enabled" , "true" ),
557557 resource .TestCheckResourceAttr (
@@ -626,7 +626,7 @@ func testAccCheckIBMISBareMetalServerMetadataServiceConfig(vpcname, subnetname,
626626 protocol = "%s"
627627 }
628628 }
629- ` , vpcname , subnetname , acc .ISZoneName , sshname , publicKey , acc .IsBareMetalServerProfileName , name , acc .IsBareMetalServerImage , acc .ISZoneName , enabled , protocol )
629+ ` , vpcname , subnetname , acc .ISZoneName2 , sshname , publicKey , acc .IsBareMetalServerProfileName , name , acc .IsBareMetalServerImage , acc .ISZoneName2 , enabled , protocol )
630630}
631631
632632func testAccCheckIBMISBareMetalServerReservationConfig (vpcname , subnetname , sshname , publicKey , name string ) string {
@@ -707,6 +707,11 @@ func testAccCheckIBMISBareMetalServerExists(n, ip string) resource.TestCheckFunc
707707 return err
708708 }
709709 ip = * bms .ID
710+ println ()
711+ fmt .Printf ("%+v" , * bms )
712+ fmt .Printf ("%+v" , * bms .MetadataService )
713+ fmt .Printf ("%+v" , * bms .MetadataService .Enabled )
714+ fmt .Printf ("%+v" , * bms .MetadataService .Protocol )
710715 return nil
711716 }
712717}
@@ -1182,13 +1187,13 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
11821187 CheckDestroy : testAccCheckIBMISBareMetalServerDestroy ,
11831188 Steps : []resource.TestStep {
11841189 {
1185- Config : testAccCheckIBMISBareMetalServerInitializationConfig (vpcname , subnetname , sshname , publicKey , name , acc .IsBareMetalServerImage , userdata1 , acc . IamIdentityAssignmentTargetAccountId , true ),
1190+ Config : testAccCheckIBMISBareMetalServerInitializationConfig (vpcname , subnetname , sshname , publicKey , name , acc .IsBareMetalServerImage , userdata1 , true , "https" , true ),
11861191 Check : resource .ComposeTestCheckFunc (
11871192 testAccCheckIBMISBareMetalServerExists ("ibm_is_bare_metal_server.testacc_bms" , server ),
11881193 resource .TestCheckResourceAttr (
11891194 "ibm_is_bare_metal_server.testacc_bms" , "name" , name ),
11901195 resource .TestCheckResourceAttr (
1191- "ibm_is_bare_metal_server.testacc_bms" , "zone" , acc .ISZoneName ),
1196+ "ibm_is_bare_metal_server.testacc_bms" , "zone" , acc .ISZoneName2 ),
11921197 resource .TestCheckResourceAttr (
11931198 "ibm_is_bare_metal_server.testacc_bms" , "image" , acc .IsBareMetalServerImage ),
11941199 resource .TestCheckResourceAttrSet (
@@ -1198,17 +1203,17 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
11981203 resource .TestCheckResourceAttr (
11991204 "ibm_is_bare_metal_server.testacc_bms" , "default_trusted_profile.0.auto_link" , "true" ),
12001205 resource .TestCheckResourceAttr (
1201- "ibm_is_bare_metal_server.testacc_bms" , "default_trusted_profile.0.target" , "true" ),
1206+ "ibm_is_bare_metal_server.testacc_bms" , "default_trusted_profile.0.target.0.id " , acc . IAMTrustedProfileID ),
12021207 ),
12031208 },
12041209 {
1205- Config : testAccCheckIBMISBareMetalServerInitializationConfig (vpcname , subnetname , sshname , publicKey , name , acc .IsBareMetalServerImage2 , userdata2 , acc . IamIdentityAssignmentTargetAccountId , false ),
1210+ Config : testAccCheckIBMISBareMetalServerInitializationConfig (vpcname , subnetname , sshname , publicKey , name , acc .IsBareMetalServerImage2 , userdata2 , false , "http" , true ),
12061211 Check : resource .ComposeTestCheckFunc (
12071212 testAccCheckIBMISBareMetalServerExists ("ibm_is_bare_metal_server.testacc_bms" , server ),
12081213 resource .TestCheckResourceAttr (
12091214 "ibm_is_bare_metal_server.testacc_bms" , "name" , name ),
12101215 resource .TestCheckResourceAttr (
1211- "ibm_is_bare_metal_server.testacc_bms" , "zone" , acc .ISZoneName ),
1216+ "ibm_is_bare_metal_server.testacc_bms" , "zone" , acc .ISZoneName2 ),
12121217 resource .TestCheckResourceAttr (
12131218 "ibm_is_bare_metal_server.testacc_bms" , "image" , acc .IsBareMetalServerImage2 ),
12141219 resource .TestCheckResourceAttrSet (
@@ -1218,14 +1223,14 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVE
12181223 resource .TestCheckResourceAttr (
12191224 "ibm_is_bare_metal_server.testacc_bms" , "default_trusted_profile.0.auto_link" , "true" ),
12201225 resource .TestCheckResourceAttr (
1221- "ibm_is_bare_metal_server.testacc_bms" , "default_trusted_profile.0.target" , "true" ),
1226+ "ibm_is_bare_metal_server.testacc_bms" , "default_trusted_profile.0.target.0.id " , acc . IAMTrustedProfileID ),
12221227 ),
12231228 },
12241229 },
12251230 })
12261231}
12271232
1228- func testAccCheckIBMISBareMetalServerInitializationConfig (vpcname , subnetname , sshname , publicKey , name , image , userdata , targetId string , autolink bool ) string {
1233+ func testAccCheckIBMISBareMetalServerInitializationConfig (vpcname , subnetname , sshname , publicKey , name , image , userdata string , metadataEnabled bool , metadataProtocol string , autolink bool ) string {
12291234 return fmt .Sprintf (`
12301235 resource "ibm_is_vpc" "testacc_vpc" {
12311236 name = "%s"
@@ -1249,8 +1254,12 @@ func testAccCheckIBMISBareMetalServerInitializationConfig(vpcname, subnetname, s
12491254 image = "%s"
12501255 zone = "%s"
12511256 user_data = "%s"
1257+ metadata_service {
1258+ enabled = %t
1259+ protocol = "%s"
1260+ }
12521261 default_trusted_profile {
1253- target = {
1262+ target {
12541263 id = "%s"
12551264 }
12561265 auto_link = %t
@@ -1261,5 +1270,5 @@ func testAccCheckIBMISBareMetalServerInitializationConfig(vpcname, subnetname, s
12611270 }
12621271 vpc = ibm_is_vpc.testacc_vpc.id
12631272 }
1264- ` , vpcname , subnetname , acc .ISZoneName , sshname , publicKey , acc .IsBareMetalServerProfileName , name , image , acc .ISZoneName , userdata , targetId , autolink )
1273+ ` , vpcname , subnetname , acc .ISZoneName2 , sshname , publicKey , acc .IsBareMetalServerProfileName , name , image , acc .ISZoneName2 , userdata , metadataEnabled , metadataProtocol , acc . IAMTrustedProfileID , autolink )
12651274}
0 commit comments