@@ -15,6 +15,7 @@ import (
15
15
// Use existing resource group
16
16
const resourceGroup = "geretain-test-resources"
17
17
const defaultExampleTerraformDir = "solutions/standard"
18
+ const quickstartExampleTerraformDir = "solutions/standard-plus-vsi"
18
19
19
20
var sharedInfoSvc * cloudinfo.CloudInfoService
20
21
@@ -33,7 +34,7 @@ func TestMain(m *testing.M) {
33
34
os .Exit (m .Run ())
34
35
}
35
36
36
- func setupOptions (t * testing.T , prefix string ) * testhelper.TestOptions {
37
+ func setupOptionsStandardSolution (t * testing.T , prefix string ) * testhelper.TestOptions {
37
38
38
39
options := testhelper .TestOptionsDefault (& testhelper.TestOptions {
39
40
Testing : t ,
@@ -70,19 +71,80 @@ func setupOptions(t *testing.T, prefix string) *testhelper.TestOptions {
70
71
return options
71
72
}
72
73
73
- func TestRunBranchExample (t * testing.T ) {
74
+ func TestRunBranchStandardExample (t * testing.T ) {
74
75
t .Parallel ()
75
76
76
- options := setupOptions (t , "pvs-i-b" )
77
+ options := setupOptionsStandardSolution (t , "pvs-i-b" )
77
78
78
79
output , err := options .RunTestConsistency ()
79
80
assert .Nil (t , err , "This should not have errored" )
80
81
assert .NotNil (t , output , "Expected some output" )
81
82
}
82
83
83
- func TestRunMainExample (t * testing.T ) {
84
+ func TestRunMainStandardExample (t * testing.T ) {
84
85
t .Parallel ()
85
- options := setupOptions (t , "pvs-i-m" )
86
+ options := setupOptionsStandardSolution (t , "pvs-i-m" )
87
+
88
+ output , err := options .RunTestUpgrade ()
89
+ if ! options .UpgradeTestSkipped {
90
+ assert .Nil (t , err , "This should not have errored" )
91
+ assert .NotNil (t , output , "Expected some output" )
92
+ }
93
+ }
94
+
95
+ // quickstart =standard-plus-vsi
96
+ func setupOptionsQuickstartSolution (t * testing.T , prefix string ) * testhelper.TestOptions {
97
+
98
+ options := testhelper .TestOptionsDefault (& testhelper.TestOptions {
99
+ Testing : t ,
100
+ TerraformDir : quickstartExampleTerraformDir ,
101
+ Prefix : prefix ,
102
+ ResourceGroup : resourceGroup ,
103
+ Region : "us-south" , // specify default region to skip best choice query
104
+ DefaultRegion : "dal10" ,
105
+ BestRegionYAMLPath : "./common-go-assets/cloudinfo-region-power-prefs.yaml" , // specific to powervs zones
106
+ // temporary workaround for BSS backend issue
107
+ ImplicitDestroy : []string {
108
+ "module.standard.module.landing_zone.module.landing_zone.ibm_resource_group.resource_groups" ,
109
+ },
110
+ })
111
+
112
+ // query for best zone to deploy powervs example, based on current connection count
113
+ // NOTE: this is why we do not want to run multiple tests in parallel.
114
+ options .Region , _ = testhelper .GetBestPowerSystemsRegionO (options .RequiredEnvironmentVars ["TF_VAR_ibmcloud_api_key" ], options .BestRegionYAMLPath , options .DefaultRegion ,
115
+ testhelper.TesthelperTerraformOptions {CloudInfoService : sharedInfoSvc })
116
+ // if for any reason the region is empty at this point, such as error, use default
117
+ if len (options .Region ) == 0 {
118
+ options .Region = options .DefaultRegion
119
+ }
120
+
121
+ options .TerraformVars = map [string ]interface {}{
122
+ "prefix" : options .Prefix ,
123
+ "powervs_resource_group_name" : options .ResourceGroup ,
124
+ "external_access_ip" : "0.0.0.0/0" ,
125
+ "tshirt_size" : map [string ]string {
126
+ "image" : "7300-02-01" ,
127
+ "tshirt_size" : "aix_xs" ,
128
+ },
129
+ "powervs_zone" : options .Region ,
130
+ }
131
+
132
+ return options
133
+ }
134
+
135
+ func TestRunBranchQuickstartExample (t * testing.T ) {
136
+ t .Parallel ()
137
+
138
+ options := setupOptionsQuickstartSolution (t , "pvs-qs-b" )
139
+
140
+ output , err := options .RunTestConsistency ()
141
+ assert .Nil (t , err , "This should not have errored" )
142
+ assert .NotNil (t , output , "Expected some output" )
143
+ }
144
+
145
+ func TestRunMainQuickstartExample (t * testing.T ) {
146
+ t .Parallel ()
147
+ options := setupOptionsQuickstartSolution (t , "pvs-qs-m" )
86
148
87
149
output , err := options .RunTestUpgrade ()
88
150
if ! options .UpgradeTestSkipped {
0 commit comments