summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-09-21 21:35:18 -0500
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-09-23 22:07:49 -0500
commit8088cb8b6aacf9b7003845e4c9081b7f569b6fac (patch)
tree21a410f18aa56ba1be911063c47e7740d71d19b6 /smoketest
parent35e88be03f013e0ae240b6ec9b73fdd8d36ed75e (diff)
downloadvyos-1x-8088cb8b6aacf9b7003845e4c9081b7f569b6fac.tar.gz
vyos-1x-8088cb8b6aacf9b7003845e4c9081b7f569b6fac.zip
ddclient: T5612: Enable TTL support for web-service based protocols
Enable TTL support for web-service based protocols in addition to RFC2136 based (nsupdate) protocol. Since TTL is not supported by all protocols, and thus cannot have a configuration default, the existing XML snippet `include/dns/time-to-live.xml.i` does not have common `<defaultValue>300</defaultValue>` anymore and is instead added explicitly whenever necessary.
Diffstat (limited to 'smoketest')
-rwxr-xr-xsmoketest/scripts/cli/test_service_dns_dynamic.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/smoketest/scripts/cli/test_service_dns_dynamic.py b/smoketest/scripts/cli/test_service_dns_dynamic.py
index 366b063c7..aa4891829 100755
--- a/smoketest/scripts/cli/test_service_dns_dynamic.py
+++ b/smoketest/scripts/cli/test_service_dns_dynamic.py
@@ -63,18 +63,29 @@ class TestServiceDDNS(VyOSUnitTestSHIM.TestCase):
self.cli_set(base_path + ddns + [svc, 'host-name', hostname])
self.cli_set(base_path + ddns + [svc, 'password', password])
self.cli_set(base_path + ddns + [svc, 'zone', zone])
+ self.cli_set(base_path + ddns + [svc, 'ttl', ttl])
for opt, value in details.items():
self.cli_set(base_path + ddns + [svc, opt, value])
- # commit changes
+ # 'zone' option is supported and required by 'cloudfare', but not 'freedns' and 'zoneedit'
+ self.cli_set(base_path + ddns + [svc, 'zone', zone])
+ if details['protocol'] == 'cloudflare':
+ pass
+ else:
+ # exception is raised for unsupported ones
+ with self.assertRaises(ConfigSessionError):
+ self.cli_commit()
+ self.cli_delete(base_path + ddns + [svc, 'zone'])
+
+ # 'ttl' option is supported by 'cloudfare', but not 'freedns' and 'zoneedit'
+ self.cli_set(base_path + ddns + [svc, 'ttl', ttl])
if details['protocol'] == 'cloudflare':
pass
else:
- # zone option does not work on all protocols, an exception is
- # raised for all others
+ # exception is raised for unsupported ones
with self.assertRaises(ConfigSessionError):
self.cli_commit()
- self.cli_delete(base_path + ddns + [svc, 'zone', zone])
+ self.cli_delete(base_path + ddns + [svc, 'ttl'])
# commit changes
self.cli_commit()