@@ -14,7 +14,9 @@ import (
1414 "github.com/gruntwork-io/terratest/modules/terraform"
1515 "github.com/stretchr/testify/assert"
1616 "github.com/stretchr/testify/require"
17+ "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
1718 "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/common"
19+ "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testaddons"
1820 "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
1921 "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
2022)
@@ -219,3 +221,48 @@ func TestRunAccountSettings(t *testing.T) {
219221 err := options .RunSchematicTest ()
220222 assert .Nil (t , err , "This should not have errored" )
221223}
224+
225+ func TestAddonDefaultConfiguration (t * testing.T ) {
226+ t .Parallel ()
227+
228+ options := testaddons .TestAddonsOptionsDefault (& testaddons.TestAddonOptions {
229+ Testing : t ,
230+ Prefix : "icm-def" ,
231+ ResourceGroup : resourceGroup ,
232+ QuietMode : true , // Suppress logs except on failure
233+ })
234+
235+ options .AddonConfig = cloudinfo .NewAddonConfigTerraform (
236+ options .Prefix ,
237+ "deploy-arch-ibm-cloud-monitoring" ,
238+ "fully-configurable" ,
239+ map [string ]interface {}{
240+ "prefix" : options .Prefix ,
241+ "region" : validRegions [rand .Intn (len (validRegions ))],
242+ },
243+ )
244+
245+ err := options .RunAddonTest ()
246+ require .NoError (t , err )
247+ }
248+
249+ // TestDependencyPermutations runs dependency permutations for Cloud Monitoring and all its dependencies
250+ func TestDependencyPermutations (t * testing.T ) {
251+ t .Parallel ()
252+
253+ options := testaddons .TestAddonsOptionsDefault (& testaddons.TestAddonOptions {
254+ Testing : t ,
255+ Prefix : "icm-per" ,
256+ AddonConfig : cloudinfo.AddonConfig {
257+ OfferingName : "deploy-arch-ibm-cloud-monitoring" ,
258+ OfferingFlavor : "fully-configurable" ,
259+ Inputs : map [string ]interface {}{
260+ "prefix" : "icm-per" ,
261+ "region" : validRegions [rand .Intn (len (validRegions ))],
262+ },
263+ },
264+ })
265+
266+ err := options .RunAddonPermutationTest ()
267+ assert .NoError (t , err , "Dependency permutation test should not fail" )
268+ }
0 commit comments