From 4b586f8622c42c6a5b40964070cf029350789a6c Mon Sep 17 00:00:00 2001 From: Jericho Keyne Date: Wed, 28 Aug 2024 16:20:57 -0400 Subject: [PATCH] OCM-9780 | test: automated id:65900 install with use-local-credentials will work --- tests/ci/data/profiles/rosa-classic.yaml | 29 ++++++++++++++++++- tests/e2e/test_rosacli_cluster_post.go | 11 +++++++ tests/utils/profilehandler/interface.go | 1 + tests/utils/profilehandler/profile_handler.go | 5 ++++ 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/tests/ci/data/profiles/rosa-classic.yaml b/tests/ci/data/profiles/rosa-classic.yaml index 0cf32c8df8..c776e7350f 100644 --- a/tests/ci/data/profiles/rosa-classic.yaml +++ b/tests/ci/data/profiles/rosa-classic.yaml @@ -214,4 +214,31 @@ profiles: oidc_config: "" shared_vpc: false imdsv2: "optional" - admin_enabled: false \ No newline at end of file + admin_enabled: false +- as: rosa-non-sts-local-creds + version: latest + channel_group: candidate + region: "us-east-1" + cluster: + multi_az: true + instance_type: "" + hcp: false + sts: false + byo_vpc: false + private_link: false + private: false + etcd_encryption: false + autoscale: false + kms_key: false + networking: false + proxy_enabled: false + label_enabled: false + zones: "us-east-1a,us-east-1b,us-east-1c" + tag_enabled: false + etcd_kms: false + fips: false + oidc_config: "" + shared_vpc: false + imdsv2: "optional" + admin_enabled: true + use_local_credentials: true \ No newline at end of file diff --git a/tests/e2e/test_rosacli_cluster_post.go b/tests/e2e/test_rosacli_cluster_post.go index a258990c15..31fb626ae8 100644 --- a/tests/e2e/test_rosacli_cluster_post.go +++ b/tests/e2e/test_rosacli_cluster_post.go @@ -331,6 +331,17 @@ var _ = Describe("Healthy check", Expect(jsonData.DigString("nodes", "compute_machine_type", "id")).To(Equal(profile.ClusterConfig.InstanceType)) } }) + + It("with use-local-credentials will work - [id:65900]", labels.Runtime.Day1Post, labels.High, + func() { + By("Check that the cluster was installed with the right profile") + if !profile.ClusterConfig.UseLocalCredentials { + Skip("Must be ran with the use_local_credentials flag set") + } + jsonData, err := clusterService.GetJSONClusterDescription(clusterID) + Expect(err).ToNot(HaveOccurred()) + Expect(jsonData.DigBool("properties", "use_local_credentials")).To(BeTrue()) + }) }) var _ = Describe("Create cluster with the version in some channel group testing", diff --git a/tests/utils/profilehandler/interface.go b/tests/utils/profilehandler/interface.go index 5280021651..e481425a47 100644 --- a/tests/utils/profilehandler/interface.go +++ b/tests/utils/profilehandler/interface.go @@ -57,6 +57,7 @@ type ClusterConfig struct { SharedVPC bool `yaml:"shared_vpc,omitempty" json:"shared_vpc,omitempty"` TagEnabled bool `yaml:"tag_enabled,omitempty" json:"tag_enabled,omitempty"` NetworkType string `yaml:"network_type,omitempty" json:"network_type,omitempty"` + UseLocalCredentials bool `yaml:"use_local_credentials,omitempty" json:"use_local_credentials,omitempty"` } // UserData will record the user data prepared for resource clean up diff --git a/tests/utils/profilehandler/profile_handler.go b/tests/utils/profilehandler/profile_handler.go index 9ee98b26da..b7c7163da2 100644 --- a/tests/utils/profilehandler/profile_handler.go +++ b/tests/utils/profilehandler/profile_handler.go @@ -181,6 +181,11 @@ func GenerateClusterCreateFlags(profile *Profile, client *rosacli.Client) ([]str ) } + if profile.ClusterConfig.UseLocalCredentials { + flags = append(flags, + "--use-local-credentials", + ) + } if profile.ClusterConfig.STS { var accRoles *rosacli.AccountRolesUnit var oidcConfigID string