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: routeros_ip_dns - new fields in 7.8 #170

Merged
merged 1 commit into from
Mar 23, 2023
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
19 changes: 19 additions & 0 deletions routeros/resource_ip_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ func ResourceDns() *schema.Resource {
Computed: true,
Description: "Shows the currently used cache size in KiB.",
},
"doh_max_concurrent_queries": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "Specifies how many DoH concurrent queries are allowed.",
},
"doh_max_server_connections": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "Specifies how many concurrent connections to the DoH server are allowed.",
},
"doh_timeout": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Specifies how long to wait for query response from the DoH server.",
DiffSuppressFunc: TimeEquall,
},
"dynamic_servers": {
Type: schema.TypeString,
Computed: true,
Expand Down
23 changes: 17 additions & 6 deletions routeros/resource_ip_dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ func TestAccResourceDnsTest_basic(t *testing.T) {
ProviderFactories: testAccProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccResourceDnsConfig(),
Config: testAccResourceDnsConfig(0),
Check: resource.ComposeTestCheckFunc(
testAccCheckResourceDnsExists(testResourceDnsTask),
resource.TestCheckResourceAttr(testResourceDnsTask, "allow_remote_requests", "true"),
),
},
{
Config: testAccResourceDnsConfig(1),
},
},
})

Expand All @@ -49,13 +52,15 @@ func testAccCheckResourceDnsExists(name string) resource.TestCheckFunc {
}
}

func testAccResourceDnsConfig() string {
return `

func testAccResourceDnsConfig(n int) string {
provider := `
provider "routeros" {
insecure = true
}

`

tests := []string{`
resource "routeros_dns" "test" {
allow_remote_requests = true
cache_max_ttl = "3d"
Expand All @@ -68,6 +73,12 @@ resource "routeros_dns" "test" {
servers = "1.1.1.1"
use_doh_server = "https://cloudflare-dns.com/dns-query"
verify_doh_cert = true
}
`
}`,
`
resource "routeros_ip_dns" "dns-server" {
allow_remote_requests = true
servers = "2606:4700:4700::1112,1.1.1.2,2606:4700:4700::1002,1.0.0.2"
}`,
}
return provider + tests[n]
}