Skip to content

Commit

Permalink
fix: Remove bootstrap_storages option from the testing pipeline (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelebanski authored Nov 28, 2024
1 parent 47f6a24 commit 97f12a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
22 changes: 2 additions & 20 deletions examples/dedicated_vmseries/main_test.go
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
package dedicated_vmseries

import (
"fmt"
"log"
"os"
"testing"

"github.com/PaloAltoNetworks/terraform-modules-swfw-tests-skeleton/pkg/testskeleton"
"github.com/gruntwork-io/terratest/modules/logger"
"github.com/gruntwork-io/terratest/modules/terraform"

"github.com/PaloAltoNetworks/terraform-modules-swfw-tests-skeleton/pkg/testskeleton"
)

func CreateTerraformOptions(t *testing.T) *terraform.Options {
// prepare random prefix
randomNames, _ := testskeleton.GenerateTerraformVarsInfo("azure")
// storageDefinition := fmt.Sprintf("{ bootstrap = { name = \"%s\", public_snet_key = \"public\", private_snet_key = \"private\", intranet_cidr = \"10.0.0.0/25\"} }", randomNames.AzureStorageAccountName)
storageDefinition := fmt.Sprintf("{ bootstrap = { name = \"%s\" }}", randomNames.AzureStorageAccountName)

// copy the init-cfg.sample.txt file to init-cfg.txt for test purposes
_, err := os.Stat("files/init-cfg.txt")
if err != nil {
buff, err := os.ReadFile("files/init-cfg.sample.txt")
if err != nil {
log.Fatal(err)
}
err = os.WriteFile("files/init-cfg.txt", buff, 0644)
if err != nil {
log.Fatal(err)
}
}

// define options for Terraform
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Expand All @@ -37,7 +20,6 @@ func CreateTerraformOptions(t *testing.T) *terraform.Options {
Vars: map[string]interface{}{
"name_prefix": randomNames.NamePrefix,
"resource_group_name": randomNames.AzureResourceGroupName,
"bootstrap_storages": storageDefinition,
},
Logger: logger.Default,
Lock: true,
Expand Down
21 changes: 2 additions & 19 deletions examples/gwlb_with_vmseries/main_test.go
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
package gwlb_with_vmseries

import (
"fmt"
"log"
"os"
"testing"

"github.com/PaloAltoNetworks/terraform-modules-swfw-tests-skeleton/pkg/testskeleton"
"github.com/gruntwork-io/terratest/modules/logger"
"github.com/gruntwork-io/terratest/modules/terraform"

"github.com/PaloAltoNetworks/terraform-modules-swfw-tests-skeleton/pkg/testskeleton"
)

func CreateTerraformOptions(t *testing.T) *terraform.Options {
// prepare random prefix
randomNames, _ := testskeleton.GenerateTerraformVarsInfo("azure")
storageDefinition := fmt.Sprintf("{ bootstrap = { name = \"%s\" } }", randomNames.AzureStorageAccountName)

// copy the init-cfg.sample.txt file to init-cfg.txt for test purposes
_, err := os.Stat("files/init-cfg.txt")
if err != nil {
buff, err := os.ReadFile("files/init-cfg.sample.txt")
if err != nil {
log.Fatal(err)
}
err = os.WriteFile("files/init-cfg.txt", buff, 0644)
if err != nil {
log.Fatal(err)
}
}

// define options for Terraform
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
Expand All @@ -36,7 +20,6 @@ func CreateTerraformOptions(t *testing.T) *terraform.Options {
Vars: map[string]interface{}{
"name_prefix": randomNames.NamePrefix,
"resource_group_name": randomNames.AzureResourceGroupName,
"bootstrap_storages": storageDefinition,
},
Logger: logger.Default,
Lock: true,
Expand Down

0 comments on commit 97f12a8

Please sign in to comment.