Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): Establish terraform dependencies between resources #281

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 38 additions & 17 deletions assets/terraform/test/resource_dynamic_updates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/hashicorp/terraform-plugin-testing/tfjsonpath"
)

func TestAccDynamicUpdates(t *testing.T) {
func TestAccDynamicUpdates_1(t *testing.T) {
t.Parallel()

nameSuffix := acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
Expand Down Expand Up @@ -303,9 +303,13 @@ func TestAccDynamicUpdates(t *testing.T) {
},
},
})
}

func TestAccDynamicUpdates_2(t *testing.T) {
t.Parallel()

nameSuffix = acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix = fmt.Sprintf("test-acc-%s", nameSuffix)
nameSuffix := acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix := fmt.Sprintf("test-acc-%s", nameSuffix)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProviders,
Expand Down Expand Up @@ -510,8 +514,13 @@ func TestAccDynamicUpdates(t *testing.T) {
},
})

nameSuffix = acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix = fmt.Sprintf("test-acc-%s", nameSuffix)
}

func TestAccDynamicUpdates_3(t *testing.T) {
t.Parallel()

nameSuffix := acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix := fmt.Sprintf("test-acc-%s", nameSuffix)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProviders,
Expand Down Expand Up @@ -637,9 +646,13 @@ func TestAccDynamicUpdates(t *testing.T) {
},
},
})
}

func TestAccDynamicUpdates_4(t *testing.T) {
t.Parallel()

nameSuffix = acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix = fmt.Sprintf("test-acc-%s", nameSuffix)
nameSuffix := acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix := fmt.Sprintf("test-acc-%s", nameSuffix)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProviders,
Expand Down Expand Up @@ -804,9 +817,13 @@ func TestAccDynamicUpdates(t *testing.T) {
},
},
})
}

nameSuffix = acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix = fmt.Sprintf("test-acc-%s", nameSuffix)
func TestAccDynamicUpdates_5(t *testing.T) {
t.Parallel()

nameSuffix := acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix := fmt.Sprintf("test-acc-%s", nameSuffix)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProviders,
Expand Down Expand Up @@ -843,9 +860,13 @@ func TestAccDynamicUpdates(t *testing.T) {
},
},
})
}

func TestAccDynamicUpdates_6(t *testing.T) {
t.Parallel()

nameSuffix = acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix = fmt.Sprintf("test-acc-%s", nameSuffix)
nameSuffix := acctest.RandStringFromCharSet(6, acctest.CharSetAlphaNum)
prefix := fmt.Sprintf("test-acc-%s", nameSuffix)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProviders,
Expand Down Expand Up @@ -890,7 +911,7 @@ resource "panos_template" "template" {
}

resource "panos_dynamic_updates" "updates" {
location = { template = { name = local.template_name } }
location = { template = { name = panos_template.template.name } }

update_schedule = {
anti_virus = {
Expand Down Expand Up @@ -981,7 +1002,7 @@ resource "panos_template" "template" {
}

resource "panos_dynamic_updates" "updates" {
location = { template = { name = local.template_name } }
location = { template = { name = panos_template.template.name } }

update_schedule = {
anti_virus = {
Expand Down Expand Up @@ -1058,7 +1079,7 @@ resource "panos_template" "template" {
}

resource "panos_dynamic_updates" "updates" {
location = { template = { name = local.template_name } }
location = { template = { name = panos_template.template.name } }

update_schedule = {
anti_virus = {
Expand Down Expand Up @@ -1124,7 +1145,7 @@ resource "panos_template" "template" {
}

resource "panos_dynamic_updates" "updates" {
location = { template = { name = local.template_name } }
location = { template = { name = panos_template.template.name } }

update_schedule = {
anti_virus = {
Expand Down Expand Up @@ -1187,7 +1208,7 @@ resource "panos_template" "template" {
}

resource "panos_dynamic_updates" "updates" {
location = { template = { name = local.template_name } }
location = { template = { name = panos_template.template.name } }

update_schedule = {
wf_private = {
Expand Down Expand Up @@ -1219,7 +1240,7 @@ resource "panos_template" "template" {
}

resource "panos_dynamic_updates" "updates" {
location = { template = { name = local.template_name } }
location = { template = { name = panos_template.template.name } }

update_schedule = {
wildfire = {
Expand Down
Loading