brightbox-cli 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +13 -17
- data/README.rdoc +13 -17
- data/brightbox-cli.gemspec +1 -1
- data/lib/brightbox-cli/accounts.rb +7 -0
- data/lib/brightbox-cli/api.rb +3 -0
- data/lib/brightbox-cli/commands/config-client-list.rb +1 -1
- data/lib/brightbox-cli/commands/firewall-rules-create.rb +4 -0
- data/lib/brightbox-cli/commands/firewall-rules-update.rb +49 -0
- data/lib/brightbox-cli/commands/groups-show.rb +1 -1
- data/lib/brightbox-cli/commands/groups-update.rb +3 -1
- data/lib/brightbox-cli/commands/images-destroy.rb +1 -1
- data/lib/brightbox-cli/commands/images-list.rb +9 -3
- data/lib/brightbox-cli/commands/images-register.rb +1 -1
- data/lib/brightbox-cli/commands/images-update.rb +3 -1
- data/lib/brightbox-cli/commands/lbs-update.rb +4 -2
- data/lib/brightbox-cli/commands/{servers-activate-cloud.rb → servers-activate-console.rb} +2 -1
- data/lib/brightbox-cli/commands/servers-update.rb +2 -1
- data/lib/brightbox-cli/config.rb +17 -2
- data/lib/brightbox-cli/detailed_server.rb +1 -1
- data/lib/brightbox-cli/firewall_rule.rb +6 -0
- data/lib/brightbox-cli/gli_global_hooks.rb +8 -1
- data/lib/brightbox-cli/images.rb +22 -1
- data/lib/brightbox-cli/nilable_hash.rb +7 -0
- data/lib/brightbox-cli/server_groups.rb +0 -6
- data/lib/brightbox-cli/servers.rb +6 -2
- data/lib/brightbox-cli/tables.rb +13 -0
- data/lib/brightbox-cli/vendor/fog/README.rdoc +2 -9
- data/lib/brightbox-cli/vendor/fog/Rakefile +3 -2
- data/lib/brightbox-cli/vendor/fog/changelog.txt +213 -0
- data/lib/brightbox-cli/vendor/fog/docs/_layouts/default.html +1 -1
- data/lib/brightbox-cli/vendor/fog/docs/about/contributing.markdown +1 -1
- data/lib/brightbox-cli/vendor/fog/docs/about/getting_started.markdown +28 -3
- data/lib/brightbox-cli/vendor/fog/docs/dns/index.markdown +1 -1
- data/lib/brightbox-cli/vendor/fog/docs/index.markdown +2 -10
- data/lib/brightbox-cli/vendor/fog/docs/storage/index.markdown +2 -2
- data/lib/brightbox-cli/vendor/fog/fog.gemspec +6 -5
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/auto_scaling.rb +3 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_formation.rb +3 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_watch.rb +3 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/compute.rb +5 -3
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/elb.rb +4 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/emr.rb +133 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/addresses.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/key_pairs.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/security_groups.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/server.rb +4 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/servers.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/snapshots.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/spot_request.rb +21 -4
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/spot_requests.rb +45 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/volumes.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elb/load_balancer.rb +2 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/storage/file.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cdn/get_invalidation_list.rb +0 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_formation/update_stack.rb +19 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/add_instance_groups.rb +28 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/add_job_flow_steps.rb +17 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/describe_job_flows.rb +140 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/modify_instance_groups.rb +17 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/run_job_flow.rb +19 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/set_termination_protection.rb +17 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/terminate_job_flows.rb +17 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/rds.rb +3 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_formation/create_stack.rb +6 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_formation/update_stack.rb +62 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +141 -36
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/delete_security_group.rb +25 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/delete_tags.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_addresses.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_availability_zones.rb +5 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_images.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_instances.rb +15 -6
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_key_pairs.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_regions.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_reserved_instances.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_snapshots.rb +4 -4
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_volumes.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/modify_instance_attribute.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +41 -29
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/describe_load_balancers.rb +3 -3
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/add_instance_groups.rb +46 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/add_job_flow_steps.rb +49 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/describe_job_flows.rb +108 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/modify_instance_groups.rb +40 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/run_job_flow.rb +106 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/set_termination_protection.rb +39 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/terminate_job_flows.rb +37 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/simpledb/get_attributes.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/simpledb/select.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/acl_utils.rb +62 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_bucket_acl.rb +7 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_acl.rb +7 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_url.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_bucket_acl.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_object_acl.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/ses.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/simpledb.rb +2 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sns.rb +3 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sqs.rb +4 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/storage.rb +10 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws.rb +26 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/aws.rb +8 -4
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/bluebox.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/brightbox.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/dnsimple.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/dnsmadeeasy.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/ecloud.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/glesys.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/go_grid.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/google.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/libvirt.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/linode.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/local.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/new_servers.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/ninefold.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/openstack.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/rackspace.rb +3 -3
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/stormondemand.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/virtual_box.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/vmfusion.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/voxel.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin/zerigo.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/bin.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/compute.rb +2 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/cloud_ip.rb +10 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server.rb +11 -3
- data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server_group.rb +9 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +13 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/core/connection.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/core/credentials.rb +3 -3
- data/lib/brightbox-cli/vendor/fog/lib/fog/core/deprecation.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/core/logger.rb +8 -3
- data/lib/brightbox-cli/vendor/fog/lib/fog/core/mock.rb +4 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/core/provider.rb +7 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/core/service.rb +8 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/dnsmadeeasy/models/dns/record.rb +3 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/dynect/dns.rb +25 -3
- data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/compute.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/go_grid/requests/compute/grid_server_power.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/google/models/storage/file.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/google/requests/storage/get_object_url.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/google/storage.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/models/storage/file.rb +8 -6
- data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/models/storage/files.rb +3 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/requests/storage/head_namespace.rb +20 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/storage.rb +4 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/server.rb +7 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/create_server.rb +6 -11
- data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/load_balancers.rb +1 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/callback.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/record.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/zone.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/dns.rb +1 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/record.rb +7 -3
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/zone.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/create_record.rb +8 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/get_record.rb +17 -5
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/get_records.rb +10 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/get_record.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/get_records.rb +7 -8
- data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/update_record.rb +43 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/balancers.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/configs.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/images.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/servers.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/templates.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/terremark/vcloud.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/compute.rb +41 -23
- data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/models/compute/server.rb +19 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/models/compute/servers.rb +8 -2
- data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/datacenters.rb +34 -0
- data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +83 -10
- data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/vm_clone.rb +76 -37
- data/lib/brightbox-cli/vendor/fog/lib/fog.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/tests/aws/models/cloud_watch/alarm_data_tests.rb +8 -6
- data/lib/brightbox-cli/vendor/fog/tests/aws/models/cloud_watch/alarm_history_tests.rb +3 -1
- data/lib/brightbox-cli/vendor/fog/tests/aws/models/compute/security_group_tests.rb +15 -10
- data/lib/brightbox-cli/vendor/fog/tests/aws/models/elb/model_tests.rb +4 -4
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/cloud_formation/stack_tests.rb +14 -0
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/instance_tests.rb +16 -1
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/security_group_tests.rb +251 -32
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/tag_tests.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/helper.rb +172 -0
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/instance_group_tests.rb +106 -0
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/job_flow_tests.rb +88 -0
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/acl_utils_tests.rb +209 -0
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/bucket_tests.rb +80 -55
- data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/object_tests.rb +42 -24
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/account_tests.rb +11 -6
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/api_client_tests.rb +23 -12
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/cloud_ip_tests.rb +29 -20
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/helper.rb +70 -14
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/image_tests.rb +17 -14
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/interface_tests.rb +3 -2
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/load_balancer_tests.rb +57 -11
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_group_tests.rb +29 -22
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_tests.rb +38 -21
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_type_tests.rb +7 -6
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/user_tests.rb +11 -16
- data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/zone_tests.rb +7 -6
- data/lib/brightbox-cli/vendor/fog/tests/compute/helper.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/tests/core/credential_tests.rb +2 -2
- data/lib/brightbox-cli/vendor/fog/tests/core/mocking_tests.rb +60 -0
- data/lib/brightbox-cli/vendor/fog/tests/dns/models/record_tests.rb +4 -2
- data/lib/brightbox-cli/vendor/fog/tests/dns/models/records_tests.rb +4 -2
- data/lib/brightbox-cli/vendor/fog/tests/dns/models/zone_tests.rb +3 -1
- data/lib/brightbox-cli/vendor/fog/tests/dns/models/zones_tests.rb +4 -2
- data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/helper.rb +4 -2
- data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/server_tests.rb +1 -1
- data/lib/brightbox-cli/vendor/fog/tests/helper.rb +4 -0
- data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/dns_tests.rb +16 -12
- data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/records_tests.rb +13 -11
- data/lib/brightbox-cli/vendor/fog/tests/slicehost/requests/dns/dns_tests.rb +58 -11
- data/lib/brightbox-cli/vendor/fog/tests/vsphere/compute_tests.rb +18 -10
- data/lib/brightbox-cli/vendor/fog/tests/vsphere/requests/compute/vm_clone_tests.rb +3 -7
- data/lib/brightbox-cli/version.rb +1 -1
- data/lib/brightbox_cli.rb +1 -0
- data/spec/fixtures/vcr_cassettes/list_server_groups.yml +37 -6
- data/spec/nilable_hash_spec.rb +30 -0
- metadata +48 -18
- data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/hash_to_acl.rb +0 -44
@@ -2,58 +2,75 @@ Shindo.tests('Fog::Compute[:brightbox] | server requests', ['brightbox']) do
|
|
2
2
|
|
3
3
|
tests('success') do
|
4
4
|
|
5
|
-
image_id = Brightbox::Compute::TestSupport
|
5
|
+
image_id = Brightbox::Compute::TestSupport.image_id
|
6
6
|
server_id = nil
|
7
7
|
|
8
|
-
tests("#create_server(:image => '#{image_id}')")
|
8
|
+
tests("#create_server(:image => '#{image_id}')") do
|
9
9
|
pending if Fog.mocking?
|
10
|
-
|
11
|
-
server_id =
|
12
|
-
|
10
|
+
result = Fog::Compute[:brightbox].create_server(:image => image_id)
|
11
|
+
server_id = result["id"]
|
12
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
13
13
|
end
|
14
14
|
|
15
15
|
unless Fog.mocking?
|
16
16
|
Fog::Compute[:brightbox].servers.get(server_id).wait_for { ready? }
|
17
17
|
end
|
18
18
|
|
19
|
-
tests("#list_servers")
|
19
|
+
tests("#list_servers") do
|
20
20
|
pending if Fog.mocking?
|
21
|
-
Fog::Compute[:brightbox].list_servers
|
21
|
+
result = Fog::Compute[:brightbox].list_servers
|
22
|
+
formats(Brightbox::Compute::Formats::Collection::SERVERS) { result }
|
22
23
|
end
|
23
24
|
|
24
|
-
tests("#get_server('#{server_id}')")
|
25
|
+
tests("#get_server('#{server_id}')") do
|
25
26
|
pending if Fog.mocking?
|
26
|
-
Fog::Compute[:brightbox].get_server(server_id)
|
27
|
+
result = Fog::Compute[:brightbox].get_server(server_id)
|
28
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
27
29
|
end
|
28
30
|
|
29
|
-
tests("#update_server('#{server_id}')")
|
31
|
+
tests("#update_server('#{server_id}')") do
|
30
32
|
pending if Fog.mocking?
|
31
|
-
Fog::Compute[:brightbox].update_server(server_id, :name => "Fog@#{Time.now.iso8601}")
|
33
|
+
result = Fog::Compute[:brightbox].update_server(server_id, :name => "Fog@#{Time.now.iso8601}")
|
34
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
32
35
|
end
|
33
36
|
|
34
|
-
tests("#activate_console_server('#{server_id}')")
|
37
|
+
tests("#activate_console_server('#{server_id}')") do
|
35
38
|
pending if Fog.mocking?
|
36
|
-
Fog::Compute[:brightbox].activate_console_server(server_id)
|
39
|
+
result = Fog::Compute[:brightbox].activate_console_server(server_id)
|
40
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
37
41
|
end
|
38
42
|
|
39
|
-
tests("#stop_server('#{server_id}')")
|
43
|
+
tests("#stop_server('#{server_id}')") do
|
40
44
|
pending if Fog.mocking?
|
41
|
-
Fog::Compute[:brightbox].stop_server(server_id)
|
45
|
+
result = Fog::Compute[:brightbox].stop_server(server_id)
|
46
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
42
47
|
end
|
43
48
|
|
44
|
-
tests("#start_server('#{server_id}')")
|
49
|
+
tests("#start_server('#{server_id}')") do
|
45
50
|
pending if Fog.mocking?
|
46
|
-
Fog::Compute[:brightbox].start_server(server_id)
|
51
|
+
result = Fog::Compute[:brightbox].start_server(server_id)
|
52
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
47
53
|
end
|
48
54
|
|
49
|
-
tests("#shutdown_server('#{server_id}')")
|
55
|
+
tests("#shutdown_server('#{server_id}')") do
|
50
56
|
pending if Fog.mocking?
|
51
|
-
Fog::Compute[:brightbox].shutdown_server(server_id)
|
57
|
+
result = Fog::Compute[:brightbox].shutdown_server(server_id)
|
58
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
52
59
|
end
|
53
60
|
|
54
|
-
tests("#
|
61
|
+
tests("#snapshot_server('#{server_id}')") do
|
55
62
|
pending if Fog.mocking?
|
56
|
-
Fog::Compute[:brightbox].
|
63
|
+
result = Fog::Compute[:brightbox].snapshot_server(server_id)
|
64
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
65
|
+
snapshot_id = result["id"]
|
66
|
+
@snapshot = Fog::Compute[:brightbox].images.get(snapshot_id)
|
67
|
+
@snapshot.destroy
|
68
|
+
end
|
69
|
+
|
70
|
+
tests("#destroy_server('#{server_id}')") do
|
71
|
+
pending if Fog.mocking?
|
72
|
+
result = Fog::Compute[:brightbox].destroy_server(server_id)
|
73
|
+
formats(Brightbox::Compute::Formats::Full::SERVER) { result }
|
57
74
|
end
|
58
75
|
|
59
76
|
end
|
@@ -2,16 +2,17 @@ Shindo.tests('Fog::Compute[:brightbox] | server type requests', ['brightbox']) d
|
|
2
2
|
|
3
3
|
tests('success') do
|
4
4
|
|
5
|
-
tests("#list_server_types")
|
5
|
+
tests("#list_server_types") do
|
6
6
|
pending if Fog.mocking?
|
7
|
-
|
8
|
-
@server_type_id =
|
9
|
-
|
7
|
+
result = Fog::Compute[:brightbox].list_server_types
|
8
|
+
@server_type_id = result.first["id"]
|
9
|
+
formats(Brightbox::Compute::Formats::Collection::SERVER_TYPES) { result }
|
10
10
|
end
|
11
11
|
|
12
|
-
tests("#get_server_type('#{@server_type_id}')")
|
12
|
+
tests("#get_server_type('#{@server_type_id}')") do
|
13
13
|
pending if Fog.mocking?
|
14
|
-
Fog::Compute[:brightbox].get_server_type(@server_type_id)
|
14
|
+
result = Fog::Compute[:brightbox].get_server_type(@server_type_id)
|
15
|
+
formats(Brightbox::Compute::Formats::Full::SERVER_TYPE) { result }
|
15
16
|
end
|
16
17
|
|
17
18
|
end
|
@@ -2,29 +2,24 @@ Shindo.tests('Fog::Compute[:brightbox] | user requests', ['brightbox']) do
|
|
2
2
|
|
3
3
|
tests('success') do
|
4
4
|
|
5
|
-
tests("#list_users")
|
5
|
+
tests("#list_users") do
|
6
6
|
pending if Fog.mocking?
|
7
|
-
|
8
|
-
@user_id =
|
9
|
-
|
7
|
+
result = Fog::Compute[:brightbox].list_users
|
8
|
+
@user_id = result.first["id"]
|
9
|
+
formats(Brightbox::Compute::Formats::Collection::USERS) { result }
|
10
10
|
end
|
11
11
|
|
12
|
-
tests("#get_user('#{@user_id}')")
|
12
|
+
tests("#get_user('#{@user_id}')") do
|
13
13
|
pending if Fog.mocking?
|
14
|
-
|
15
|
-
|
16
|
-
data
|
14
|
+
result = Fog::Compute[:brightbox].get_user(@user_id)
|
15
|
+
formats(Brightbox::Compute::Formats::Full::USER) { result }
|
17
16
|
end
|
18
17
|
|
19
|
-
update_options = { :name => "
|
20
|
-
|
21
|
-
tests("#update_user('#{@user_id}', #{update_options.inspect})").formats(Brightbox::Compute::Formats::Full::USER) do
|
18
|
+
update_options = { :name => "Example User" }
|
19
|
+
tests("#update_user('#{@user_id}', #{update_options.inspect})") do
|
22
20
|
pending if Fog.mocking?
|
23
|
-
Fog::Compute[:brightbox].update_user(@user_id, update_options)
|
24
|
-
|
25
|
-
|
26
|
-
unless Fog.mocking?
|
27
|
-
Fog::Compute[:brightbox].update_user(@user_id, :name => @original_name)
|
21
|
+
result = Fog::Compute[:brightbox].update_user(@user_id, update_options)
|
22
|
+
formats(Brightbox::Compute::Formats::Full::USER) { result }
|
28
23
|
end
|
29
24
|
|
30
25
|
end
|
@@ -2,16 +2,17 @@ Shindo.tests('Fog::Compute[:brightbox] | zone requests', ['brightbox']) do
|
|
2
2
|
|
3
3
|
tests('success') do
|
4
4
|
|
5
|
-
tests("#list_zones")
|
5
|
+
tests("#list_zones") do
|
6
6
|
pending if Fog.mocking?
|
7
|
-
|
8
|
-
@zone_id =
|
9
|
-
|
7
|
+
result = Fog::Compute[:brightbox].list_zones
|
8
|
+
@zone_id = result.first["id"]
|
9
|
+
formats(Brightbox::Compute::Formats::Collection::ZONES) { result }
|
10
10
|
end
|
11
11
|
|
12
|
-
tests("#get_zone('#{@zone_id}')")
|
12
|
+
tests("#get_zone('#{@zone_id}')") do
|
13
13
|
pending if Fog.mocking?
|
14
|
-
Fog::Compute[:brightbox].get_zone(@zone_id)
|
14
|
+
result = Fog::Compute[:brightbox].get_zone(@zone_id)
|
15
|
+
formats(Brightbox::Compute::Formats::Full::ZONE) { result }
|
15
16
|
end
|
16
17
|
|
17
18
|
end
|
@@ -18,12 +18,12 @@ Shindo.tests do
|
|
18
18
|
tests('credential') do
|
19
19
|
returns(:default, "is :default") { Fog.credential }
|
20
20
|
|
21
|
-
returns(
|
21
|
+
returns(:foo, "can be set directly") do
|
22
22
|
Fog.credential = "foo"
|
23
23
|
Fog.credential
|
24
24
|
end
|
25
25
|
|
26
|
-
returns(
|
26
|
+
returns(:bar, "can be set with environment variable") do
|
27
27
|
ENV["FOG_CREDENTIAL"] = "bar"
|
28
28
|
Fog.credential
|
29
29
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
Shindo.tests('Fog mocking', 'core') do
|
2
|
+
before do
|
3
|
+
@fog_was_mocked = Fog.mock?
|
4
|
+
Fog.unmock! if @fog_was_mocked
|
5
|
+
end
|
6
|
+
|
7
|
+
after do
|
8
|
+
Fog.mock! if @fog_was_mocked
|
9
|
+
end
|
10
|
+
|
11
|
+
tests('Fog.mock!') do
|
12
|
+
tests('Fog.mock!').returns(true) do
|
13
|
+
Fog.mock!
|
14
|
+
end
|
15
|
+
|
16
|
+
tests('Fog.mock? without Fog.mock!').returns(false) do
|
17
|
+
Fog.mock?
|
18
|
+
end
|
19
|
+
|
20
|
+
tests('Fog.mock? with Fog.mock!').returns(true) do
|
21
|
+
Fog.mock!
|
22
|
+
Fog.mock?
|
23
|
+
end
|
24
|
+
|
25
|
+
tests('Fog.mocking? without Fog.mock!').returns(false) do
|
26
|
+
Fog.mocking?
|
27
|
+
end
|
28
|
+
|
29
|
+
tests('Fog.mocking? with Fog.mock!').returns(true) do
|
30
|
+
Fog.mock!
|
31
|
+
Fog.mocking?
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
tests('Fog::Mock.delay') do
|
36
|
+
tests('Fog::Mock.delay').returns(1, "defaults to 1") do
|
37
|
+
Fog::Mock.delay
|
38
|
+
end
|
39
|
+
|
40
|
+
tests('Fog::Mock.delay = 2').returns(2, "changes Fog::Mock.delay to 2") do
|
41
|
+
Fog::Mock.delay = 2
|
42
|
+
Fog::Mock.delay
|
43
|
+
end
|
44
|
+
|
45
|
+
tests('Fog::Mock.delay = 0').returns(0, "changes Fog::Mock.delay to 0") do
|
46
|
+
Fog::Mock.delay = 0
|
47
|
+
Fog::Mock.delay
|
48
|
+
end
|
49
|
+
|
50
|
+
tests('Fog::Mock.delay = -1').raises(ArgumentError) do
|
51
|
+
Fog::Mock.delay = -1
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
tests('Fog::Mock.not_implemented').raises(Fog::Errors::MockNotImplemented) do
|
56
|
+
Fog::Mock.not_implemented
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
end
|
@@ -3,17 +3,19 @@ for provider, config in dns_providers
|
|
3
3
|
# FIXME: delay/timing breaks things :(
|
4
4
|
next if [:dnsmadeeasy].include?(provider)
|
5
5
|
|
6
|
+
domain_name = uniq_id + '.com'
|
7
|
+
|
6
8
|
Shindo.tests("Fog::DNS[:#{provider}] | record", [provider.to_s]) do
|
7
9
|
|
8
10
|
record_attributes = {
|
9
|
-
:name => 'www.
|
11
|
+
:name => 'www.' + domain_name,
|
10
12
|
:type => 'A',
|
11
13
|
:value => '1.2.3.4'
|
12
14
|
}.merge!(config[:record_attributes] || {})
|
13
15
|
|
14
16
|
if !Fog.mocking? || config[:mocked]
|
15
17
|
zone_attributes = {
|
16
|
-
:domain =>
|
18
|
+
:domain => domain_name
|
17
19
|
}.merge(config[:zone_attributes] || {})
|
18
20
|
|
19
21
|
@zone = Fog::DNS[provider].zones.create(zone_attributes)
|
@@ -3,17 +3,19 @@ for provider, config in dns_providers
|
|
3
3
|
# FIXME: delay/timing breaks things :(
|
4
4
|
next if [:dnsmadeeasy].include?(provider)
|
5
5
|
|
6
|
+
domain_name = uniq_id + '.com'
|
7
|
+
|
6
8
|
Shindo.tests("Fog::DNS[:#{provider}] | records", [provider.to_s]) do
|
7
9
|
|
8
10
|
record_attributes = {
|
9
|
-
:name => 'www.
|
11
|
+
:name => 'www.' + domain_name,
|
10
12
|
:type => 'A',
|
11
13
|
:value => '1.2.3.4'
|
12
14
|
}.merge!(config[:record_attributes] || {})
|
13
15
|
|
14
16
|
if !Fog.mocking? || config[:mocked]
|
15
17
|
zone_attributes = {
|
16
|
-
:domain =>
|
18
|
+
:domain => domain_name
|
17
19
|
}.merge(config[:zone_attributes] || {})
|
18
20
|
|
19
21
|
@zone = Fog::DNS[provider].zones.create(zone_attributes)
|
@@ -3,10 +3,12 @@ for provider, config in dns_providers
|
|
3
3
|
# FIXME: delay/timing breaks things :(
|
4
4
|
next if [:dnsmadeeasy].include?(provider)
|
5
5
|
|
6
|
+
domain_name = uniq_id + '.com'
|
7
|
+
|
6
8
|
Shindo.tests("Fog::DNS[:#{provider}] | zone", [provider.to_s]) do
|
7
9
|
|
8
10
|
zone_attributes = {
|
9
|
-
:domain =>
|
11
|
+
:domain => domain_name
|
10
12
|
}.merge!(config[:zone_attributes] || {})
|
11
13
|
|
12
14
|
model_tests(Fog::DNS[provider].zones, zone_attributes, config[:mocked])
|
@@ -3,14 +3,16 @@ for provider, config in dns_providers
|
|
3
3
|
# FIXME: delay/timing breaks things :(
|
4
4
|
next if [:dnsmadeeasy].include?(provider)
|
5
5
|
|
6
|
+
domain_name = uniq_id + '.com'
|
7
|
+
|
6
8
|
Shindo.tests("Fog::DNS[:#{provider}] | zones", [provider.to_s]) do
|
7
9
|
|
8
10
|
zone_attributes = {
|
9
|
-
:domain =>
|
11
|
+
:domain => domain_name
|
10
12
|
}.merge!(config[:zone_attributes] || {})
|
11
13
|
|
12
14
|
collection_tests(Fog::DNS[provider].zones, zone_attributes, config[:mocked])
|
13
15
|
|
14
16
|
end
|
15
17
|
|
16
|
-
end
|
18
|
+
end
|
@@ -7,7 +7,9 @@ class Glesys
|
|
7
7
|
'arguments' => [],
|
8
8
|
'servers' => [{
|
9
9
|
'serverid' => String,
|
10
|
-
'hostname' => String
|
10
|
+
'hostname' => String,
|
11
|
+
'datacenter' => String,
|
12
|
+
'platform' => String,
|
11
13
|
}],
|
12
14
|
'status' => {
|
13
15
|
'code' => String,
|
@@ -144,6 +146,7 @@ class Glesys
|
|
144
146
|
'platform' => String,
|
145
147
|
'ip' => String,
|
146
148
|
'version' => String,
|
149
|
+
'PTR' => String,
|
147
150
|
}],
|
148
151
|
'status' => {
|
149
152
|
'code' => String,
|
@@ -172,7 +175,6 @@ class Glesys
|
|
172
175
|
IPLIST_CATCH_RELEASE = {
|
173
176
|
'arguments' => {
|
174
177
|
'ipaddress' => String,
|
175
|
-
'ipversion'=> String,
|
176
178
|
},
|
177
179
|
'status' => {
|
178
180
|
'code' => String,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Shindo.tests('Fog::Compute[:glesys] | server requests', ['glesys']) do
|
2
2
|
|
3
3
|
@serverid = nil
|
4
|
-
@hostname = "fog
|
4
|
+
@hostname = "fog-#{Time.now.to_i}"
|
5
5
|
|
6
6
|
@create = ":hostname => #@hostname, :rootpw => 'pw#{Time.now.to_i}', "+
|
7
7
|
":datacenter => 'Falkenberg', :platform => 'Xen', :template => 'Debian-6 x64', "+
|
@@ -7,6 +7,10 @@ def lorem_file
|
|
7
7
|
File.open(File.dirname(__FILE__) + '/lorem.txt', 'r')
|
8
8
|
end
|
9
9
|
|
10
|
+
def array_differences(array_a, array_b)
|
11
|
+
(array_a - array_b) | (array_b - array_a)
|
12
|
+
end
|
13
|
+
|
10
14
|
# check to see which credentials are available and add others to the skipped tags list
|
11
15
|
all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'linode', 'local', 'ninefold', 'newservers', 'openstack', 'rackspace', 'slicehost', 'stormondemand', 'voxel', 'zerigo']
|
12
16
|
available_providers = Fog.available_providers.map {|provider| provider.downcase}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
Shindo.tests('Fog::DNS[:rackspace] | DNS requests', ['rackspace', 'dns']) do
|
2
2
|
|
3
3
|
pending if Fog.mocking?
|
4
|
+
domain_name = uniq_id + '.com'
|
4
5
|
|
5
6
|
tests('success on simple domain') do
|
6
|
-
domain_tests(Fog::DNS[:rackspace], {:name =>
|
7
|
+
domain_tests(Fog::DNS[:rackspace], {:name => domain_name, :email => 'hostmaster@' + domain_name, :records => [{:ttl => 300, :name => domain_name, :type => 'A', :data => '192.168.1.1'}]}) do
|
7
8
|
|
8
9
|
tests('list_domains').formats(LIST_DOMAIN_FORMAT.reject {|key,value| key == 'links'}) do
|
9
10
|
Fog::DNS[:rackspace].list_domains.body
|
@@ -27,21 +28,21 @@ Shindo.tests('Fog::DNS[:rackspace] | DNS requests', ['rackspace', 'dns']) do
|
|
27
28
|
tests('success for domain with multiple records') do
|
28
29
|
domain_tests(Fog::DNS[:rackspace],
|
29
30
|
{
|
30
|
-
:name =>
|
31
|
-
:email => 'hostmaster@
|
31
|
+
:name => domain_name,
|
32
|
+
:email => 'hostmaster@' + domain_name,
|
32
33
|
:records =>
|
33
34
|
[
|
34
35
|
{
|
35
36
|
:ttl => 300,
|
36
|
-
:name =>
|
37
|
+
:name => domain_name,
|
37
38
|
:type => 'A',
|
38
39
|
:data => '192.168.1.1'
|
39
40
|
},
|
40
41
|
{
|
41
42
|
:ttl => 3600,
|
42
|
-
:name =>
|
43
|
+
:name => domain_name,
|
43
44
|
:type => 'MX',
|
44
|
-
:data => 'mx.
|
45
|
+
:data => 'mx.' + domain_name,
|
45
46
|
:priority => 10
|
46
47
|
}
|
47
48
|
]
|
@@ -49,21 +50,24 @@ Shindo.tests('Fog::DNS[:rackspace] | DNS requests', ['rackspace', 'dns']) do
|
|
49
50
|
end
|
50
51
|
|
51
52
|
tests('success for multiple domains') do
|
53
|
+
domain1_name = uniq_id + '-1.com'
|
54
|
+
domain2_name = uniq_id + '-2.com'
|
55
|
+
|
52
56
|
domains_tests(Fog::DNS[:rackspace],
|
53
57
|
[
|
54
|
-
{:name =>
|
55
|
-
{:name =>
|
58
|
+
{:name => domain1_name, :email => 'hostmaster@' + domain1_name, :records => [{:ttl => 300, :name => domain1_name, :type => 'A', :data => '192.168.1.1'}]},
|
59
|
+
{:name => domain2_name, :email => 'hostmaster@' + domain2_name, :records => [{:ttl => 300, :name => domain2_name, :type => 'A', :data => '192.168.1.1'}]}
|
56
60
|
])
|
57
61
|
end
|
58
62
|
|
59
63
|
tests('success for domain with subdomain') do
|
60
64
|
domains_tests(Fog::DNS[:rackspace],
|
61
65
|
[
|
62
|
-
{:name =>
|
63
|
-
{:name => 'subdomain.
|
66
|
+
{:name => domain_name, :email => 'hostmaster@' + domain_name, :records => [{:ttl => 300, :name => domain_name, :type => 'A', :data => '192.168.1.1'}]},
|
67
|
+
{:name => 'subdomain.' + domain_name, :email => 'hostmaster@subdomain.' + domain_name, :records => [{:ttl => 300, :name =>'subdomain.' + domain_name, :type => 'A', :data => '192.168.1.1'}]}
|
64
68
|
], true) do
|
65
69
|
|
66
|
-
@root_domain_id = @domain_details.find { |domain| domain['name'] ==
|
70
|
+
@root_domain_id = @domain_details.find { |domain| domain['name'] == domain_name }['id']
|
67
71
|
|
68
72
|
tests("list_domain_details('#{@root_domain_id}', :show_records => false, :show_subdomains => false)") do
|
69
73
|
response = Fog::DNS[:rackspace].list_domain_details(@root_domain_id, :show_records => false, :show_subdomains => false)
|
@@ -89,7 +93,7 @@ Shindo.tests('Fog::DNS[:rackspace] | DNS requests', ['rackspace', 'dns']) do
|
|
89
93
|
wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].remove_domain(@root_domain_id, :delete_subdomains => true)
|
90
94
|
|
91
95
|
test('domain and subdomains were really deleted') do
|
92
|
-
(Fog::DNS[:rackspace].list_domains.body['domains'].collect { |domain| domain['name'] } & [
|
96
|
+
(Fog::DNS[:rackspace].list_domains.body['domains'].collect { |domain| domain['name'] } & [domain_name, 'subdomain.' + domain_name]).empty?
|
93
97
|
end
|
94
98
|
end
|
95
99
|
end
|
@@ -2,7 +2,9 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
|
|
2
2
|
|
3
3
|
pending if Fog.mocking?
|
4
4
|
|
5
|
-
|
5
|
+
domain_name = uniq_id + '.com'
|
6
|
+
|
7
|
+
domain_tests(Fog::DNS[:rackspace], {:name => domain_name, :email => 'hostmaster@' + domain_name, :records => [{:ttl => 300, :name => domain_name, :type => 'A', :data => '192.168.1.1'}]}) do
|
6
8
|
|
7
9
|
tests('success on single record') do
|
8
10
|
|
@@ -10,18 +12,18 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
|
|
10
12
|
Fog::DNS[:rackspace].list_records(@domain_id).body
|
11
13
|
end
|
12
14
|
|
13
|
-
tests("add_records(#{@domain_id}, [{ :name => 'test1
|
14
|
-
response = wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].add_records(@domain_id, [{ :name => 'test1.
|
15
|
-
@record_id = response.body['records'].first['id']
|
16
|
-
response.body
|
15
|
+
tests("add_records(#{@domain_id}, [{ :name => 'test1.#{domain_name}', :type => 'A', :data => '192.168.2.1'}])").formats(RECORD_LIST_FORMAT) do
|
16
|
+
response = wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].add_records(@domain_id, [{ :name => 'test1.' + domain_name, :type => 'A', :data => '192.168.2.1'}])
|
17
|
+
@record_id = response.body['response']['records'].first['id']
|
18
|
+
response.body['response']
|
17
19
|
end
|
18
20
|
|
19
21
|
tests("list_record_details(#{@domain_id}, #{@record_id})").formats(RECORD_FORMAT) do
|
20
22
|
Fog::DNS[:rackspace].list_record_details(@domain_id, @record_id).body
|
21
23
|
end
|
22
24
|
|
23
|
-
tests("modify_record(#{@domain_id}, #{@record_id}, { :ttl => 500, :name => 'test2
|
24
|
-
wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].modify_record(@domain_id, @record_id, { :ttl => 500, :name => 'test2.
|
25
|
+
tests("modify_record(#{@domain_id}, #{@record_id}, { :ttl => 500, :name => 'test2.#{domain_name}', :data => '192.168.3.1' })").succeeds do
|
26
|
+
wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].modify_record(@domain_id, @record_id, { :ttl => 500, :name => 'test2.' + domain_name, :data => '192.168.3.1' })
|
25
27
|
end
|
26
28
|
|
27
29
|
tests("remove_record(#{@domain_id}, #{@record_id})").succeeds do
|
@@ -33,14 +35,14 @@ Shindo.tests('Fog::DNS[:rackspace] | dns records requests', ['rackspace', 'dns']
|
|
33
35
|
|
34
36
|
records_attributes =
|
35
37
|
[
|
36
|
-
{ :name => 'test1.
|
37
|
-
{ :name =>
|
38
|
+
{ :name => 'test1.' + domain_name, :type => 'A', :data => '192.168.2.1'},
|
39
|
+
{ :name => domain_name, :type => 'MX', :priority => 10, :data => 'mx.' + domain_name}
|
38
40
|
]
|
39
41
|
|
40
42
|
tests("add_records(#{@domain_id}, #{records_attributes})").formats(RECORD_LIST_FORMAT) do
|
41
43
|
response = wait_for Fog::DNS[:rackspace], Fog::DNS[:rackspace].add_records(@domain_id, records_attributes)
|
42
|
-
@record_ids = response.body['records'].collect { |record| record['id'] }
|
43
|
-
response.body
|
44
|
+
@record_ids = response.body['response']['records'].collect { |record| record['id'] }
|
45
|
+
response.body['response']
|
44
46
|
end
|
45
47
|
|
46
48
|
tests("remove_records(#{@domain_id}, #{@record_ids})").succeeds do
|
@@ -183,11 +183,11 @@ Shindo.tests('Fog::DNS[:slicehost] | DNS requests', ['slicehost', 'dns']) do
|
|
183
183
|
response = Fog::DNS[:slicehost].get_record(@record_id)
|
184
184
|
if response.status == 200
|
185
185
|
mail_domain = 'mail.' + @domain
|
186
|
-
record = response.body
|
187
|
-
if (record['
|
188
|
-
(record['
|
186
|
+
record = response.body
|
187
|
+
if (record['record_type'] == 'MX') and (record['name'] == @domain) and
|
188
|
+
(record['value'] == mail_domain) and (record['ttl'] == 3600) and (record['active'] == 'N') and
|
189
189
|
(record['aux'] == "10")
|
190
|
-
result= true
|
190
|
+
result = true
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
@@ -197,7 +197,7 @@ Shindo.tests('Fog::DNS[:slicehost] | DNS requests', ['slicehost', 'dns']) do
|
|
197
197
|
test('get records - verify all parameters for one record') do
|
198
198
|
pending if Fog.mocking?
|
199
199
|
|
200
|
-
result= false
|
200
|
+
result = false
|
201
201
|
|
202
202
|
response = Fog::DNS[:slicehost].get_records()
|
203
203
|
if response.status == 200
|
@@ -205,22 +205,69 @@ Shindo.tests('Fog::DNS[:slicehost] | DNS requests', ['slicehost', 'dns']) do
|
|
205
205
|
|
206
206
|
#find mx record
|
207
207
|
records.each {|record|
|
208
|
-
if record['
|
208
|
+
if (record['record_type'] == 'MX') and (record['name'] == @domain)
|
209
209
|
|
210
210
|
mail_domain = 'mail.' + @domain
|
211
|
-
if (record['
|
212
|
-
(record['
|
211
|
+
if (record['record_type'] == 'MX') and (record['name'] == @domain) and
|
212
|
+
(record['value'] == mail_domain) and (record['ttl'] == 3600) and (record['active'] == 'N') and
|
213
213
|
(record['aux'] == "10")
|
214
|
-
result= true
|
215
|
-
break
|
214
|
+
result = true
|
216
215
|
end
|
217
|
-
|
216
|
+
break
|
218
217
|
end
|
219
218
|
}
|
220
219
|
end
|
221
220
|
|
222
221
|
result
|
223
222
|
end
|
223
|
+
|
224
|
+
test('update record - verify all parameters for one record') do
|
225
|
+
pending if Fog.mocking?
|
226
|
+
|
227
|
+
result = false
|
228
|
+
|
229
|
+
specific_record = nil
|
230
|
+
|
231
|
+
response = Fog::DNS[:slicehost].get_records()
|
232
|
+
if response.status == 200
|
233
|
+
records = response.body['records']
|
234
|
+
|
235
|
+
#find mx record
|
236
|
+
records.each {|record|
|
237
|
+
if (record['record_type'] == 'MX') and (record['name'] == @domain)
|
238
|
+
specific_record = record
|
239
|
+
break
|
240
|
+
end
|
241
|
+
}
|
242
|
+
end
|
243
|
+
|
244
|
+
if (specific_record) #Try to change the TTL for this MX record if we've successfully created it.
|
245
|
+
response = Fog::DNS[:slicehost].update_record(specific_record['id'], specific_record['record_type'], specific_record['zone_id'],
|
246
|
+
specific_record['name'], specific_record['value'], {:ttl => 7200, :active => "N", :aux => "10"})
|
247
|
+
|
248
|
+
mail_domain = 'mail.' + @domain
|
249
|
+
|
250
|
+
record = Fog::DNS[:slicehost].get_record(specific_record['id']).body
|
251
|
+
|
252
|
+
if (record['record_type'] == 'MX') and (record['name'] == @domain) and
|
253
|
+
(record['value'] == mail_domain) and (record['ttl'] == 7200) and (record['active'] == 'N') and
|
254
|
+
(record['aux'] == "10")
|
255
|
+
result = true
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
259
|
+
|
260
|
+
result
|
261
|
+
end
|
262
|
+
|
263
|
+
test("newly created zone returns only records which we added to it, not other records already in account") do
|
264
|
+
pending if Fog.mocking?
|
265
|
+
|
266
|
+
@new_zone = Fog::DNS[:slicehost].zones.get(@zone_id)
|
267
|
+
|
268
|
+
records = @new_zone.records
|
269
|
+
records.length == @new_records.length
|
270
|
+
end
|
224
271
|
|
225
272
|
test("delete #{@new_records.count} records created") do
|
226
273
|
pending if Fog.mocking?
|