diff --git a/tests/e2e/hcp_cluster_test.go b/tests/e2e/hcp_cluster_test.go index 1184231ee3..0cd62497f8 100644 --- a/tests/e2e/hcp_cluster_test.go +++ b/tests/e2e/hcp_cluster_test.go @@ -116,9 +116,25 @@ var _ = Describe("HCP cluster testing", Expect(output.String()).To(ContainSubstring("--enable-customer-managed-key")) By("Get cluster description") + output, err = clusterService.DescribeCluster(clusterID) + Expect(err).To(BeNil()) + clusterDetail, err := clusterService.ReflectClusterDescription(output) + Expect(err).To(BeNil()) + + if clusterConfig.EtcdEncryption { + Expect(clusterDetail.EnableEtcdEncryption).To(Equal("Enabled")) + Expect(clusterDetail.EtcdKmsKeyARN).To(Equal(clusterConfig.Encryption.EtcdEncryptionKmsArn)) + } else { + Expect(clusterDetail.EnableEtcdEncryption).To(Equal("Disabled")) + } + + By("Get cluster description in JSON format") jsonData, err := clusterService.GetJSONClusterDescription(clusterID) Expect(err).To(BeNil()) + enableEtcdEncryption := jsonData.DigBool("etcd_encryption") + Expect(clusterConfig.EtcdEncryption).To(Equal(enableEtcdEncryption)) + ectdKMS := jsonData.DigString("aws", "etcd_encryption", "kms_key_arn") npKMS := jsonData.DigString("aws", "kms_key_arn") diff --git a/tests/utils/exec/rosacli/cluster_service.go b/tests/utils/exec/rosacli/cluster_service.go index f1ac114ca3..332e353dde 100644 --- a/tests/utils/exec/rosacli/cluster_service.go +++ b/tests/utils/exec/rosacli/cluster_service.go @@ -115,6 +115,8 @@ type ClusterDescription struct { FailedInflightChecks string `yaml:"Failed Inflight Checks,omitempty"` ExternalAuthentication string `yaml:"External Authentication,omitempty"` EnableDeleteProtection string `yaml:"Delete Protection,omitempty"` + EnableEtcdEncryption string `yaml:"Etcd Encryption,omitempty"` + EtcdKmsKeyARN string `yaml:"Etcd KMS key ARN,omitempty"` } // Pasrse the result of 'rosa list cluster' to the ClusterList struct