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 FowardingAndOthers test #4744

Merged
Merged
Show file tree
Hide file tree
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
11 changes: 5 additions & 6 deletions internal/services/page_rule/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,14 @@ func TestAccCloudflarePageRule_ForwardingAndOthers(t *testing.T) {
CheckDestroy: testAccCheckCloudflarePageRuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckCloudflarePageRuleConfigForwardingAndOthers(zoneID, target, rnd),
Config: testAccCheckCloudflarePageRuleConfigForwardingAndOthers(zoneID, target, rnd, rnd+"."+domain),
Check: resource.ComposeTestCheckFunc(
testAccCheckCloudflarePageRuleExists(resourceName, &pageRule),
resource.TestCheckResourceAttr(resourceName, consts.ZoneIDSchemaKey, zoneID),
resource.TestCheckResourceAttr(resourceName, "target", target),
resource.TestCheckResourceAttr(resourceName, "target", fmt.Sprintf("%s/", target)),
resource.TestCheckResourceAttr(resourceName, "target", fmt.Sprintf("%s", target)),
),

ExpectError: regexp.MustCompile("\"forwarding_url\" cannot be set with any other actions"),
ExpectError: regexp.MustCompile(`\\"forwarding_url\\"\s+may not be used with \\"any setting\\"`),
},
},
})
Expand Down Expand Up @@ -2033,8 +2032,8 @@ func testAccCheckCloudflarePageRuleConfigForwardingOnly(zoneID, target, rnd, zon
return acctest.LoadTestCase("pageruleconfigforwardingonly.tf", zoneID, target, rnd, zoneName)
}

func testAccCheckCloudflarePageRuleConfigForwardingAndOthers(zoneID, target, rnd string) string {
return acctest.LoadTestCase("pageruleconfigforwardingandothers.tf", zoneID, target, rnd)
func testAccCheckCloudflarePageRuleConfigForwardingAndOthers(zoneID, target, rnd, zoneName string) string {
return acctest.LoadTestCase("pageruleconfigforwardingandothers.tf", zoneID, target, rnd, zoneName)
}

func testAccCheckCloudflarePageRuleConfigWithEdgeCacheTtl(zoneID, target, rnd string) string {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

resource "cloudflare_page_rule" "%[3]s" {
zone_id = "%[1]s"
target = "%[2]s"
actions =[ {
disable_security = true
forwarding_url =[ {
url = "http://%s/forward"
status_code = 301
}]
}]
}
zone_id = "%[1]s"
target = "%[2]s"
actions = {
disable_security = true
forwarding_url = {
url = "http://%[4]s/forward"
status_code = 301
}
}
}
Loading