Skip to content

Commit a560811

Browse files
deepakraj1997kaovilai
authored andcommitted
E2E Tests: Fix azure templating name. (openshift#573)
* Fixing Azure to run locally * Aligning json
1 parent 1d39a95 commit a560811

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

tests/e2e/e2e_suite_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ var _ = BeforeSuite(func() {
104104
// ci cloud
105105
ciJsonData, err := utils.GetJsonData(ci_cred_file)
106106
Expect(err).NotTo(HaveOccurred())
107+
107108
if _, ok := ciJsonData["resourceGroup"]; !ok {
108109
resourceGroup, err := GetAzureResource(azure_resource_file)
109110
Expect(err).NotTo(HaveOccurred())
@@ -116,6 +117,23 @@ var _ = BeforeSuite(func() {
116117
err = utils.WriteFile(dpaCR.Credentials, ciCreds)
117118
Expect(err).NotTo(HaveOccurred())
118119
}
120+
} else {
121+
if dpaCR.Provider == "azure" {
122+
cloudCredData, err := utils.GetJsonData(dpaCR.Credentials) // azure credentials need to be in json - can be changed
123+
Expect(err).NotTo(HaveOccurred())
124+
dpaCR.DpaAzureConfig = DpaAzureConfig{
125+
BslSubscriptionId: fmt.Sprintf("%v", cloudCredData["subscriptionId"]),
126+
BslResourceGroup: fmt.Sprintf("%v", cloudCredData["resourceGroup"]),
127+
BslStorageAccount: fmt.Sprintf("%v", cloudCredData["storageAccount"]),
128+
BslStorageAccountKeyEnvVar: "AZURE_STORAGE_ACCOUNT_ACCESS_KEY",
129+
VslSubscriptionId: fmt.Sprintf("%v", cloudCredData["subscriptionId"]),
130+
VslResourceGroup: fmt.Sprintf("%v", cloudCredData["resourceGroup"]),
131+
}
132+
ciCreds := GetAzureCreds(cloudCredData)
133+
dpaCR.Credentials = "/tmp/azure-credentials"
134+
err = utils.WriteFile(dpaCR.Credentials, ciCreds)
135+
Expect(err).NotTo(HaveOccurred())
136+
}
119137
}
120138
credData, err := utils.ReadFile(dpaCR.Credentials)
121139
Expect(err).NotTo(HaveOccurred())

tests/e2e/scripts/azure_setting.sh renamed to tests/e2e/scripts/azure_settings.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cat > $TMP_DIR/oadpcreds <<EOF
1818
"subscriptionId": "",
1919
"storageAccount": "",
2020
"resourceGroup": "",
21-
"storageAccountKeyEnvVar": "",
21+
"storageAccountKeyEnvVar": ""
2222
},
2323
2424
"objectStorage":{
@@ -37,7 +37,7 @@ cat > $TMP_DIR/oadpcreds <<EOF
3737
"provider": "$PROVIDER",
3838
"config": {
3939
"subscriptionId": "",
40-
"resourceGroup": "",
40+
"resourceGroup": ""
4141
}
4242
}
4343
}

0 commit comments

Comments
 (0)