From f9bb45a035568929cf6545bd6630e5fb9cb7367e Mon Sep 17 00:00:00 2001 From: Andrew Stangl Date: Sun, 16 Mar 2014 10:01:53 +0000 Subject: [PATCH] change security group return object to match actual returned object --- .../requests/compute/network_interface_tests.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/aws/requests/compute/network_interface_tests.rb b/tests/aws/requests/compute/network_interface_tests.rb index ffc61a87f..f08d7d619 100644 --- a/tests/aws/requests/compute/network_interface_tests.rb +++ b/tests/aws/requests/compute/network_interface_tests.rb @@ -40,11 +40,23 @@ Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do @vpc = Fog::Compute[:aws].vpcs.create('cidr_block' => '10.0.10.0/24') @subnet = Fog::Compute[:aws].subnets.create('vpc_id' => @vpc.id, 'cidr_block' => '10.0.10.16/28') @security_group = Fog::Compute[:aws].security_groups.create('name' => 'sg_name', 'description' => 'sg_desc', 'vpc_id' => @vpc.id) + @owner_id = Fog::Compute[:aws].describe_security_groups('group-name' => 'default').body['securityGroupInfo'].first['ownerId'] - @subnet_id = @subnet.subnet_id @security_group_id = @security_group.group_id + @security_groups = [ + @security_group.name, { + 'groupDescription' => @security_group.description, + 'groupName' => @security_group.name, + 'groupId' => @security_group_id, + 'ipPermissionsEgress' => [], + 'ipPermissions' => [], + 'ownerId' => @owner_id, + 'vpcId' => @vpc.id + } + ] + DESCRIPTION = "Small and green" tests("#create_network_interface(#{@subnet_id})").formats(@network_interface_create_format) do data = Fog::Compute[:aws].create_network_interface(@subnet_id, {"PrivateIpAddress" => "10.0.10.23"}).body @@ -149,7 +161,7 @@ Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do tests("#describe_network_interface_attribute(#{@nic2_id}, 'description')").returns(DESCRIPTION) do Fog::Compute[:aws].describe_network_interface_attribute(@nic2_id, 'description').body["description"] end - tests("#describe_network_interface_attribute(#{@nic2_id}, 'groupSet'')").returns({ @security_group_id => "sg_name"}) do + tests("#describe_network_interface_attribute(#{@nic2_id}, 'groupSet')").returns({ @security_group_id => @security_groups }) do Fog::Compute[:aws].describe_network_interface_attribute(@nic2_id, 'groupSet').body["groupSet"] end