Skip to content

Commit 9704c15

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
fix: vpe tests SKIP UPGRADE TESTS
1 parent 58be59d commit 9704c15

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

solutions/standard/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ resource "random_password" "admin_password" {
229229
}
230230

231231
locals {
232-
# _- are invalid first characters
232+
# _- are invalid first characters.
233233
# if - replace first char with J
234234
# elseif _ replace first char with K
235235
# else use asis

tests/pr_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,20 @@ func TestRunStandardUpgradeSolution(t *testing.T) {
181181
ResourceGroup: resourceGroup,
182182
})
183183

184+
// Generate a 15 char long random string for the admin_pass
185+
randomBytes := make([]byte, 13)
186+
_, randErr := rand.Read(randomBytes)
187+
require.Nil(t, randErr) // do not proceed if we can't gen a random password
188+
189+
randomPass := "A1" + base64.URLEncoding.EncodeToString(randomBytes)[:13]
190+
184191
options.TerraformVars = map[string]interface{}{
185192
"access_tags": permanentResources["accessTags"],
186193
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
187194
"kms_endpoint_type": "public",
188195
"provider_visibility": "public",
189196
"resource_group_name": options.Prefix,
190-
"admin_pass": options.Prefix,
197+
"admin_pass": randomPass,
191198
}
192199

193200
output, err := options.RunTestUpgrade()

0 commit comments

Comments
 (0)