Skip to content

Commit e4f4824

Browse files
authored
Added acceptance test for sgx confidential compute mode (IBM-Cloud#6120)
* Added acceptance test for sgx confidential compute mode * Added acceptance test for sgx confidential compute mode
1 parent bff46dd commit e4f4824

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

ibm/service/vpc/resource_ibm_is_instance_test.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4197,3 +4197,38 @@ func testAccCheckIBMISInstanceConfigTDX(vpcname, subnetname, sshname, publicKey,
41974197
keys = [ibm_is_ssh_key.testacc_sshkey.id]
41984198
}`, vpcname, subnetname, acc.ISZoneName, acc.ISCIDR, sshname, publicKey, name, acc.IsImage, acc.ISZoneName)
41994199
}
4200+
4201+
// sgx
4202+
// Create a basic instance with SGX confidential compute mode
4203+
func TestAccIBMISInstanceSGX_basic(t *testing.T) {
4204+
var instance string
4205+
vpcname := fmt.Sprintf("tf-vpc-%d", acctest.RandIntRange(10, 100))
4206+
name := fmt.Sprintf("tf-instance-%d", acctest.RandIntRange(10, 100))
4207+
subnetname := fmt.Sprintf("tf-subnet-%d", acctest.RandIntRange(10, 100))
4208+
sshname := fmt.Sprintf("tf-ssh-%d", acctest.RandIntRange(10, 100))
4209+
publicKey := strings.TrimSpace(`
4210+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR
4211+
`)
4212+
4213+
resource.Test(t, resource.TestCase{
4214+
PreCheck: func() { acc.TestAccPreCheck(t) },
4215+
Providers: acc.TestAccProviders,
4216+
CheckDestroy: testAccCheckIBMISInstanceDestroy,
4217+
Steps: []resource.TestStep{
4218+
{
4219+
Config: testAccCheckIBMISInstanceConfigSGX(vpcname, subnetname, sshname, publicKey, name),
4220+
Check: resource.ComposeTestCheckFunc(
4221+
testAccCheckIBMISInstanceExists("ibm_is_instance.testacc_instance", instance),
4222+
resource.TestCheckResourceAttr(
4223+
"ibm_is_instance.testacc_instance", "name", name),
4224+
resource.TestCheckResourceAttr(
4225+
"ibm_is_instance.testacc_instance", "confidential_compute_mode", "sgx"),
4226+
resource.TestCheckResourceAttr(
4227+
"ibm_is_instance.testacc_instance", "profile", "bx3dc-2x10"),
4228+
resource.TestCheckResourceAttr(
4229+
"ibm_is_instance.testacc_instance", "zone", acc.ISZoneName),
4230+
),
4231+
},
4232+
},
4233+
})
4234+
}

0 commit comments

Comments
 (0)