mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-12-09 13:46:07 +08:00
CLOUDFLAREAPI: remove proxy "full" tests
This commit is contained in:
parent
0a0e617a20
commit
46393bee55
2 changed files with 17 additions and 129 deletions
|
|
@ -32,13 +32,13 @@ var globalDCN *domaintags.DomainNameVarieties
|
|||
|
||||
// Helper constants/funcs for the CLOUDFLARE proxy testing:
|
||||
|
||||
func CfProxyOff() *TestCase { return tc("proxyoff", cfProxyA("prxy", "174.136.107.111", "off")) }
|
||||
func CfProxyOn() *TestCase { return tc("proxyon", cfProxyA("prxy", "174.136.107.111", "on")) }
|
||||
func CfProxyFull1() *TestCase { return tc("proxyf1", cfProxyA("prxy", "174.136.107.111", "full")) }
|
||||
func CfProxyFull2() *TestCase { return tc("proxyf2", cfProxyA("prxy", "174.136.107.222", "full")) }
|
||||
func CfCProxyOff() *TestCase { return tc("cproxyoff", cfProxyCNAME("cproxy", "example.com.", "off")) }
|
||||
func CfCProxyOn() *TestCase { return tc("cproxyon", cfProxyCNAME("cproxy", "example.com.", "on")) }
|
||||
func CfCProxyFull() *TestCase { return tc("cproxyf", cfProxyCNAME("cproxy", "example.com.", "full")) }
|
||||
// A-record proxy off/on
|
||||
func CfProxyOff() *TestCase { return tc("proxyoff", cfProxyA("prxy", "174.136.107.111", "off")) }
|
||||
func CfProxyOn() *TestCase { return tc("proxyon", cfProxyA("prxy", "174.136.107.111", "on")) }
|
||||
|
||||
// CNAME-record proxy off/on
|
||||
func CfCProxyOff() *TestCase { return tc("cproxyoff", cfProxyCNAME("cproxy", "example.com.", "off")) }
|
||||
func CfCProxyOn() *TestCase { return tc("cproxyon", cfProxyCNAME("cproxy", "example.com.", "on")) }
|
||||
|
||||
func getDomainConfigWithNameservers(t *testing.T, prv providers.DNSServiceProvider, domainName string) *models.DomainConfig {
|
||||
dc := &models.DomainConfig{
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@ func makeTests() []*TestGroup {
|
|||
tc("Internationalized CNAME Target", cname("a", "ööö.com.")),
|
||||
),
|
||||
testgroup("IDNAs in CNAME targets",
|
||||
not("CLOUDFLAREAPI"),
|
||||
//not("CLOUDFLAREAPI"),
|
||||
// LINODE: hostname validation does not allow the target domain TLD
|
||||
tc("IDN CNAME AND Target", cname("öoö", "ööö.企业.")),
|
||||
),
|
||||
|
|
@ -1172,85 +1172,13 @@ func makeTests() []*TestGroup {
|
|||
|
||||
// CLOUDFLAREAPI: Redirects:
|
||||
|
||||
// go test -v -verbose -profile CLOUDFLAREAPI // PAGE_RULEs
|
||||
// go test -v -verbose -profile CLOUDFLAREAPI -cfredirect=c // Convert: Convert page rules to Single Redirect
|
||||
// go test -v -verbose -profile CLOUDFLAREAPI -cfredirect=n // New: Convert old to new Single Redirect
|
||||
// ProTip: Add this to just run this test:
|
||||
// -start 59 -end 60
|
||||
|
||||
testgroup("CF_REDIRECT",
|
||||
only("CLOUDFLAREAPI"),
|
||||
alltrue(cfSingleRedirectEnabled()),
|
||||
tc("redir", cfRedir("cnn.**current-domain**/*", "https://www.cnn.com/$1")),
|
||||
tc("change", cfRedir("cnn.**current-domain**/*", "https://change.cnn.com/$1")),
|
||||
tc("changelabel", cfRedir("cable.**current-domain**/*", "https://change.cnn.com/$1")),
|
||||
|
||||
// Removed these for speed. They tested if order matters,
|
||||
// which it doesn't seem to. Re-add if needed.
|
||||
tcEmptyZone(),
|
||||
tc("multipleA",
|
||||
cfRedir("cnn.**current-domain**/*", "https://www.cnn.com/$1"),
|
||||
cfRedir("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
),
|
||||
tcEmptyZone(),
|
||||
tc("multipleB",
|
||||
cfRedir("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
cfRedir("cnn.**current-domain**/*", "https://www.cnn.com/$1"),
|
||||
),
|
||||
tc("change1",
|
||||
cfRedir("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
cfRedir("cnn.**current-domain**/*", "https://change.cnn.com/$1"),
|
||||
),
|
||||
tc("change1",
|
||||
cfRedir("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
cfRedir("cablenews.**current-domain**/*", "https://change.cnn.com/$1"),
|
||||
),
|
||||
|
||||
// NB(tlim): This test case used to fail but mysteriously started working.
|
||||
tcEmptyZone(),
|
||||
tc("multiple3",
|
||||
cfRedir("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
cfRedir("cnn.**current-domain**/*", "https://www.cnn.com/$1"),
|
||||
cfRedir("nytimes.**current-domain**/*", "https://www.nytimes.com/$1"),
|
||||
),
|
||||
|
||||
// Repeat the above tests using CF_TEMP_REDIR instead
|
||||
tcEmptyZone(),
|
||||
tc("tempredir", cfRedirTemp("cnn.**current-domain**/*", "https://www.cnn.com/$1")),
|
||||
tc("tempchange", cfRedirTemp("cnn.**current-domain**/*", "https://change.cnn.com/$1")),
|
||||
tc("tempchangelabel", cfRedirTemp("cable.**current-domain**/*", "https://change.cnn.com/$1")),
|
||||
tcEmptyZone(),
|
||||
tc("tempmultipleA",
|
||||
cfRedirTemp("cnn.**current-domain**/*", "https://www.cnn.com/$1"),
|
||||
cfRedirTemp("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
),
|
||||
tcEmptyZone(),
|
||||
tc("tempmultipleB",
|
||||
cfRedirTemp("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
cfRedirTemp("cnn.**current-domain**/*", "https://www.cnn.com/$1"),
|
||||
),
|
||||
tc("tempchange1",
|
||||
cfRedirTemp("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
cfRedirTemp("cnn.**current-domain**/*", "https://change.cnn.com/$1"),
|
||||
),
|
||||
tc("tempchange1",
|
||||
cfRedirTemp("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
cfRedirTemp("cablenews.**current-domain**/*", "https://change.cnn.com/$1"),
|
||||
),
|
||||
// NB(tlim): This test case used to fail but mysteriously started working.
|
||||
tc("tempmultiple3",
|
||||
cfRedirTemp("msnbc.**current-domain**/*", "https://msnbc.cnn.com/$1"),
|
||||
cfRedirTemp("cnn.**current-domain**/*", "https://www.cnn.com/$1"),
|
||||
cfRedirTemp("nytimes.**current-domain**/*", "https://www.nytimes.com/$1"),
|
||||
),
|
||||
),
|
||||
// go test -v -verbose -profile CLOUDFLAREAPI -cfredirect=true // Convert: Test Single Redirects
|
||||
|
||||
testgroup("CF_REDIRECT_CONVERT",
|
||||
only("CLOUDFLAREAPI"),
|
||||
alltrue(cfSingleRedirectEnabled()),
|
||||
tc("start301", cfRedir("cnn.**current-domain**/*", "https://www.cnn.com/$1")),
|
||||
tc("convert302", cfRedirTemp("cnn.**current-domain**/*", "https://www.cnn.com/$1")),
|
||||
tc("convert301", cfRedir("cnn.**current-domain**/*", "https://www.cnn.com/$1")),
|
||||
),
|
||||
|
||||
testgroup("CLOUDFLAREAPI_SINGLE_REDIRECT",
|
||||
|
|
@ -1269,72 +1197,32 @@ func makeTests() []*TestGroup {
|
|||
only("CLOUDFLAREAPI"),
|
||||
CfProxyOff(), tcEmptyZone(),
|
||||
CfProxyOn(), tcEmptyZone(),
|
||||
CfProxyFull1(), tcEmptyZone(),
|
||||
CfProxyFull2(), tcEmptyZone(),
|
||||
),
|
||||
|
||||
// These next testgroups attempt every possible transition between off, on, full1 and full2.
|
||||
// "full1" simulates "full" without the IP being translated.
|
||||
// "full2" simulates "full" WITH the IP translated.
|
||||
|
||||
testgroup("CF_PROXY A off to X",
|
||||
testgroup("CF_PROXY A off to on",
|
||||
only("CLOUDFLAREAPI"),
|
||||
// CF_PROXY_OFF(), CF_PROXY_OFF(), tcEmptyZone(), // redundant
|
||||
CfProxyOff(), CfProxyOn(), tcEmptyZone(),
|
||||
CfProxyOff(), CfProxyFull1(), tcEmptyZone(),
|
||||
CfProxyOff(), CfProxyFull2(), tcEmptyZone(),
|
||||
CfProxyOff(), CfProxyOn(),
|
||||
),
|
||||
|
||||
testgroup("CF_PROXY A on to X",
|
||||
testgroup("CF_PROXY A on to off",
|
||||
only("CLOUDFLAREAPI"),
|
||||
CfProxyOn(), CfProxyOff(), tcEmptyZone(),
|
||||
// CF_PROXY_ON(), CF_PROXY_ON(), tcEmptyZone(), // redundant
|
||||
// CF_PROXY_ON(), CF_PROXY_FULL1().ExpectNoChanges(), tcEmptyZone(), // Removed for speed
|
||||
CfProxyOn(), CfProxyFull2(), tcEmptyZone(),
|
||||
),
|
||||
|
||||
testgroup("CF_PROXY A full1 to X",
|
||||
only("CLOUDFLAREAPI"),
|
||||
CfProxyFull1(), CfProxyOff(), tcEmptyZone(),
|
||||
// CF_PROXY_FULL1(), CF_PROXY_ON().ExpectNoChanges(), tcEmptyZone(), // Removed for speed
|
||||
// CF_PROXY_FULL1(), tcEmptyZone(), // redundant
|
||||
CfProxyFull1(), CfProxyFull2(), tcEmptyZone(),
|
||||
),
|
||||
|
||||
testgroup("CF_PROXY A full2 to X",
|
||||
only("CLOUDFLAREAPI"),
|
||||
CfProxyFull2(), CfProxyOff(), tcEmptyZone(),
|
||||
CfProxyFull2(), CfProxyOn(), tcEmptyZone(),
|
||||
CfProxyFull2(), CfProxyFull1(), tcEmptyZone(),
|
||||
// CF_PROXY_FULL2(), CF_PROXY_FULL2(), tcEmptyZone(), // redundant
|
||||
CfProxyOn(), CfProxyOff(),
|
||||
),
|
||||
|
||||
testgroup("CF_PROXY CNAME create",
|
||||
only("CLOUDFLAREAPI"),
|
||||
CfCProxyOff(), tcEmptyZone(),
|
||||
CfCProxyOn(), tcEmptyZone(),
|
||||
CfCProxyFull(), tcEmptyZone(),
|
||||
),
|
||||
|
||||
testgroup("CF_PROXY CNAME off to X",
|
||||
testgroup("CF_PROXY CNAME off to on",
|
||||
only("CLOUDFLAREAPI"),
|
||||
// CF_CPROXY_OFF(), CF_CPROXY_OFF(), tcEmptyZone(), // redundant
|
||||
CfCProxyOff(), CfCProxyOn(), tcEmptyZone(),
|
||||
CfCProxyOff(), CfCProxyFull(), tcEmptyZone(),
|
||||
CfCProxyOff(), CfCProxyOn(),
|
||||
),
|
||||
|
||||
testgroup("CF_PROXY CNAME on to X",
|
||||
testgroup("CF_PROXY CNAME on to off",
|
||||
only("CLOUDFLAREAPI"),
|
||||
CfCProxyOn(), CfCProxyOff(), tcEmptyZone(),
|
||||
// CF_CPROXY_ON(), CF_CPROXY_ON(), tcEmptyZone(), // redundant
|
||||
// CF_CPROXY_ON(), CF_CPROXY_FULL().ExpectNoChanges(), tcEmptyZone(), // Removed for speed
|
||||
),
|
||||
|
||||
testgroup("CF_PROXY CNAME full to X",
|
||||
only("CLOUDFLAREAPI"),
|
||||
CfCProxyFull(), CfCProxyOff(), tcEmptyZone(),
|
||||
// CF_CPROXY_FULL(), CF_CPROXY_ON().ExpectNoChanges(), tcEmptyZone(), // Removed for speed
|
||||
// CF_CPROXY_FULL(), tcEmptyZone(), // redundant
|
||||
CfCProxyOn(), CfCProxyOff(),
|
||||
),
|
||||
|
||||
testgroup("CF_WORKER_ROUTE",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue