mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
forgot to commit dhcp_options tests
This commit is contained in:
parent
528243cd3a
commit
eabb29e0e7
3 changed files with 48 additions and 0 deletions
4
tests/aws/models/compute/dhcp_option_tests.rb
Normal file
4
tests/aws/models/compute/dhcp_option_tests.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
Shindo.tests("Fog::Compute[:aws] | dhcp_options", ['aws']) do
|
||||
model_tests(Fog::Compute[:aws].dhcp_options, {'dhcp_configuration_set' => {'domain-name' => 'example.com', 'domain-name-servers' => '10.10.10.10'}}, true)
|
||||
end
|
||||
|
4
tests/aws/models/compute/dhcp_options_tests.rb
Normal file
4
tests/aws/models/compute/dhcp_options_tests.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
Shindo.tests("Fog::Compute[:aws] | dhcp_options", ['aws']) do
|
||||
collection_tests(Fog::Compute[:aws].dhcp_options, {'dhcp_configuration_set' => {'domain-name' => 'example.com', 'domain-name-servers' => '10.10.10.10'}}, true)
|
||||
end
|
||||
|
40
tests/aws/requests/compute/dhcp_options_tests.rb
Normal file
40
tests/aws/requests/compute/dhcp_options_tests.rb
Normal file
|
@ -0,0 +1,40 @@
|
|||
Shindo.tests('Fog::Compute[:aws] | dhcp_options requests', ['aws']) do
|
||||
|
||||
@dhcp_options_format = {
|
||||
'dhcpOptionsSet' => [{
|
||||
'dhcpOptionsId' => String,
|
||||
'dhcpConfigurationSet' => Hash,
|
||||
'tagSet' => Fog::Nullable::Hash,
|
||||
}],
|
||||
'requestId' => String
|
||||
}
|
||||
|
||||
tests('success') do
|
||||
@vpc=Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24')
|
||||
@vpc_id = @vpc.id
|
||||
|
||||
|
||||
tests('#create_dhcp_options').formats(@dhcp_options_format) do
|
||||
data = Fog::Compute[:aws].create_dhcp_options({'domain-name' => 'example.com', 'domain-name-servers' => '10.10.10.10'}).body
|
||||
@dopt_id = data['dhcpOptionsSet'].first['dhcpOptionsId']
|
||||
data
|
||||
end
|
||||
|
||||
tests('#describe_dhcp_options').formats(@dhcp_options_format) do
|
||||
Fog::Compute[:aws].describe_dhcp_options.body
|
||||
end
|
||||
|
||||
tests("#associate_dhcp_options('#{@dopt_id}, #{@vpc_id}')").formats(AWS::Compute::Formats::BASIC) do
|
||||
Fog::Compute[:aws].associate_dhcp_options(@dopt_id, @vpc_id).body
|
||||
end
|
||||
|
||||
tests("#associate_default_dhcp_options('default', #{@vpc_id}')").formats(AWS::Compute::Formats::BASIC) do
|
||||
Fog::Compute[:aws].associate_dhcp_options('default', @vpc_id).body
|
||||
end
|
||||
|
||||
tests("#delete_dhcp_options('#{@dopt_id}')").formats(AWS::Compute::Formats::BASIC) do
|
||||
Fog::Compute[:aws].delete_dhcp_options(@dopt_id).body
|
||||
end
|
||||
@vpc.destroy
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue