2010-12-29 20:23:40 -05:00
|
|
|
for provider, config in dns_providers
|
|
|
|
|
2011-06-21 17:50:01 -04:00
|
|
|
# FIXME: delay/timing breaks things :(
|
|
|
|
next if [:dnsmadeeasy].include?(provider)
|
|
|
|
|
2011-11-10 20:56:32 -05:00
|
|
|
domain_name = uniq_id + '.com'
|
|
|
|
|
2011-07-14 20:22:43 -04:00
|
|
|
Shindo.tests("Fog::DNS[:#{provider}] | record", [provider.to_s]) do
|
2010-12-29 20:23:40 -05:00
|
|
|
|
2012-11-06 20:33:25 -05:00
|
|
|
a_record_attributes = {
|
|
|
|
:name => 'a.' + domain_name,
|
2011-05-27 13:30:20 -04:00
|
|
|
:type => 'A',
|
|
|
|
:value => '1.2.3.4'
|
2011-01-03 16:36:31 -05:00
|
|
|
}.merge!(config[:record_attributes] || {})
|
2010-12-29 20:23:40 -05:00
|
|
|
|
2012-11-06 20:33:25 -05:00
|
|
|
aaaa_record_attributes = {
|
|
|
|
:name => 'aaaa.' + domain_name,
|
|
|
|
:type => 'AAAA',
|
|
|
|
:value => '2001:0db8:0000:0000:0000:ff00:0042:8329'
|
|
|
|
}.merge!(config[:record_attributes] || {})
|
|
|
|
|
|
|
|
cname_record_attributes = {
|
|
|
|
:name => 'cname.' + domain_name,
|
|
|
|
:type => 'CNAME',
|
|
|
|
:value => 'real.' + domain_name
|
|
|
|
}.merge!(config[:record_attributes] || {})
|
|
|
|
|
2011-01-03 14:48:55 -05:00
|
|
|
if !Fog.mocking? || config[:mocked]
|
2011-01-03 18:39:38 -05:00
|
|
|
zone_attributes = {
|
2011-11-10 20:56:32 -05:00
|
|
|
:domain => domain_name
|
2011-01-03 18:39:38 -05:00
|
|
|
}.merge(config[:zone_attributes] || {})
|
2011-01-03 14:23:51 -05:00
|
|
|
|
2011-06-15 20:25:01 -04:00
|
|
|
@zone = Fog::DNS[provider].zones.create(zone_attributes)
|
2011-07-14 20:22:43 -04:00
|
|
|
|
2012-11-06 20:33:25 -05:00
|
|
|
model_tests(@zone.records, a_record_attributes, config[:mocked])
|
|
|
|
model_tests(@zone.records, aaaa_record_attributes, config[:mocked])
|
|
|
|
model_tests(@zone.records, cname_record_attributes, config[:mocked])
|
2011-01-03 14:23:51 -05:00
|
|
|
|
|
|
|
@zone.destroy
|
|
|
|
end
|
2010-12-29 20:23:40 -05:00
|
|
|
|
|
|
|
end
|
|
|
|
|
2011-07-14 20:22:43 -04:00
|
|
|
end
|