@@ -144,7 +144,7 @@ func TestRunUpgradeRootDA(t *testing.T) {
144144 }
145145}
146146
147- func TestWithExistingKP (t * testing.T ) {
147+ func TestWithExistingKPKey (t * testing.T ) {
148148 t .Parallel ()
149149
150150 region := validRegions [rand .Intn (len (validRegions ))]
@@ -188,11 +188,54 @@ func TestWithExistingKP(t *testing.T) {
188188 cleanupResources (t , existingTerraformOptions , prefix )
189189}
190190
191- func TestRunUpgradeExistingKP (t * testing.T ) {
191+ func TestWithExistingKP (t * testing.T ) {
192+ t .Parallel ()
193+
194+ region := validRegions [rand .Intn (len (validRegions ))]
195+ prefix := fmt .Sprintf ("kp-wx-%s" , strings .ToLower (random .UniqueId ()))
196+
197+ // Provision Existing KMS instance
198+ existingTerraformOptions := setupKMSKeyProtect (t , region , prefix )
199+
200+ // Deploy watsonx DA using existing KP details
201+ options := testhelper .TestOptionsDefault (& testhelper.TestOptions {
202+ Testing : t ,
203+ TerraformDir : rootDaDir ,
204+ IgnoreDestroys : testhelper.Exemptions { // Ignore for consistency check
205+ List : []string {
206+ "module.configure_user.null_resource.configure_user" ,
207+ "module.configure_user.null_resource.restrict_access" ,
208+ },
209+ },
210+ IgnoreUpdates : testhelper.Exemptions { // Ignore for consistency check
211+ List : []string {
212+ "module.configure_user.null_resource.configure_user" ,
213+ "module.configure_user.null_resource.restrict_access" ,
214+ },
215+ },
216+ })
217+
218+ options .TerraformVars = map [string ]interface {}{
219+ "region" : region ,
220+ "provider_visibility" : "public" ,
221+ "enable_cos_kms_encryption" : true ,
222+ "cos_kms_crn" : terraform .Output (t , existingTerraformOptions , "key_protect_crn" ),
223+ "existing_cos_instance_crn" : terraform .Output (t , existingTerraformOptions , "cos_crn" ),
224+ "prefix" : prefix ,
225+ }
226+
227+ output , err := options .RunTestConsistency ()
228+ assert .Nil (t , err , "This should not have errored" )
229+ assert .NotNil (t , output , "Expected some output" )
230+
231+ cleanupResources (t , existingTerraformOptions , prefix )
232+ }
233+
234+ func TestRunUpgradeExistingKPNewKey (t * testing.T ) {
192235 t .Parallel ()
193236
194237 region := validRegions [rand .Intn (len (validRegions ))]
195- prefix := fmt .Sprintf ("kp-ut -%s" , strings .ToLower (random .UniqueId ()))
238+ prefix := fmt .Sprintf ("kp-t -%s" , strings .ToLower (random .UniqueId ()))
196239
197240 // Provision Existing KMS instance
198241 existingTerraformOptions := setupKMSKeyProtect (t , region , prefix )
0 commit comments