-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specify connection props directly (#417)
* specify connection props directly Since we're not using the normal setupDatabase file path, they don't get picked up if we specify them the normal way * setupDatabase.xml will still need access to these * add unit test for custom props * fix compile error * import fmt * Fix paths to config files * also check site dependent props * fix assertion
- Loading branch information
1 parent
7152d36
commit 2dbb9eb
Showing
9 changed files
with
141 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
terratest/src/test/pega/data/expectedDB2SiteDependent.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#BLBBFP=BP32K1 | ||
#BLBLCK=LOB | ||
#BLBLCM=0 | ||
#BLBLOG=YES | ||
#BLBPRI=14400 | ||
#BLBSEC=7200 | ||
#BLBSTG=Blob.storage.group.name | ||
## | ||
#IDXBP=BP2 | ||
#IDXPRI=7200 | ||
#IDXSEC=7200 | ||
#IDXSTG=Index.storage.group.name | ||
## | ||
#TSPLCK=PAGE | ||
#TSPLCM=0 | ||
#TSPPRI=14400 | ||
#TSPSEC=7200 | ||
#TSPSTG=Table.storage.group.name | ||
#TS32BP=BP32K | ||
# | ||
#CCSID=EBCDIC | ||
#DBNAME=PEGDB | ||
#DBOWNR=PEGDBDBO | ||
#DBUSER=PEGDB | ||
#WLMUDF= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
prop1=value1 | ||
|
||
prop2=value2 | ||
|
||
# Add any special properties for your Database configuration | ||
currentSchema= | ||
currentSQLID= | ||
currentFunctionPath=SYSIBM,SYSFUN | ||
progressiveStreaming=2 | ||
fullyMaterializeLobData=true | ||
defaultIsolationLevel=1 | ||
useJDBC4ColumnNameAndLabelSemantics=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
prop1=value1 | ||
|
||
prop2=value2 | ||
|
||
# Add any special properties for your Database configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
prop1=value1 | ||
|
||
prop2=value2 | ||
|
||
# Add any special properties for your Database configuration | ||
oracle.jdbc.V8Compatible=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
prop1=value1 | ||
|
||
prop2=value2 | ||
|
||
# Add any special properties for your Database configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
prop1=value1 | ||
|
||
prop2=value2 | ||
|
||
# Add any special properties for your Database configuration | ||
currentSchema= | ||
currentFunctionPath=SYSIBM,SYSFUN |
59 changes: 59 additions & 0 deletions
59
terratest/src/test/pega/pega-installer-config-connprops_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package pega | ||
|
||
import ( | ||
"fmt" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/gruntwork-io/terratest/modules/helm" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
k8score "k8s.io/api/core/v1" | ||
) | ||
|
||
func TestPegaInstallerConnectionPropsConfig(t *testing.T) { | ||
var supportedVendors = []string{"k8s", "openshift", "eks", "gke", "aks", "pks"} | ||
var supportedOperations = []string{"install", "install-deploy", "upgrade", "upgrade-deploy"} | ||
var supportedDbs = []string{"postgres", "mssql", "oracledate", "udb", "db2zos"} | ||
|
||
helmChartPath, err := filepath.Abs(PegaHelmChartPath) | ||
require.NoError(t, err) | ||
|
||
for _, vendor := range supportedVendors { | ||
for _, operation := range supportedOperations { | ||
for _, dbPlatform := range supportedDbs { | ||
var options = &helm.Options{ | ||
SetValues: map[string]string{ | ||
"global.provider": vendor, | ||
"global.actions.execute": operation, | ||
"global.jdbc.dbType": dbPlatform, | ||
"global.jdbc.connectionProperties": "prop1=value1;prop2=value2", | ||
"installer.upgrade.upgradeType": "zero-downtime", | ||
}, | ||
} | ||
|
||
yamlContent := RenderTemplate(t, options, helmChartPath, []string{"charts/installer/templates/pega-installer-config.yaml"}) | ||
assertInstallerConnectionPropsConfig(t, yamlContent, dbPlatform) | ||
} | ||
} | ||
} | ||
} | ||
|
||
func assertInstallerConnectionPropsConfig(t *testing.T, configYaml string, dbPlatform string) { | ||
var installConfigMap k8score.ConfigMap | ||
UnmarshalK8SYaml(t, configYaml, &installConfigMap) | ||
installConfigData := installConfigMap.Data | ||
|
||
compareConfigMapData(t, installConfigData["prconfig.xml.tmpl"], "data/expectedPrconfig.xml") | ||
compareConfigMapData(t, installConfigData["setupDatabase.properties.tmpl"], "data/expectedSetupdatabase.properties") | ||
compareConfigMapData(t, installConfigData["prbootstrap.properties.tmpl"], "data/expectedPRbootstrap.properties") | ||
compareConfigMapData(t, installConfigData["migrateSystem.properties.tmpl"], "data/expectedMigrateSystem.properties.tmpl") | ||
compareConfigMapData(t, installConfigData["prlog4j2.xml"], "data/expectedPRlog4j2.xml") | ||
compareConfigMapData(t, installConfigData["prpcUtils.properties.tmpl"], "data/expectedPRPCUtils.properties.tmpl") | ||
compareConfigMapData(t, installConfigData[fmt.Sprintf("%s.conf", dbPlatform)], fmt.Sprintf("data/expected%s.conf", dbPlatform)) | ||
if dbPlatform == "db2zos" { | ||
compareConfigMapData(t, installConfigData["DB2SiteDependent.properties"], "data/expectedDB2SiteDependent.properties") | ||
} else { | ||
assert.Equal(t, installConfigData["DB2SiteDependent.properties"], "") | ||
} | ||
} |